• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Can you help to fix this????

f@bio

Fudera Otserver
Joined
Jul 10, 2007
Messages
213
Reaction score
0
Location
Brasil
@@ Hello friends, i'm have a problem with a movement for sell items...

This is my script and him make a many error on console:
-- Sistema de vendas usando movimentos BY F@bio -- Fudera Otserver...

function onAddItem(moveitem, tileitem, position, cid)

local playerPos = getCreaturePosition(cid)

if moveitem.itemid == 2498 then
doPlayerAddMoney(cid, 18000)
doRemoveItem(moveitem.uid) --royal helmet
doSendMagicEffect(position, CONST_ME_HITBYFIRE)
doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_GOLD)
end
return TRUE
end

-- When i'm take item on a tile send this error:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/sell_move.lua:eek:nAddItem

attempt to index a number value
stack traceback:
[C]: in function 'doSendAnimatedText'
data/movements/scripts/sell_move.lua:10: in function <data/movements/scr
ipts/sell_move.lua:3>

-- And when i'm delete ANIMATED TXT, this make other error:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/sell_move.lua:eek:nAddItem

luaGetCreaturePosition(). Creature not found

--- Plx someone help on this, i't a evolution on my server, to prevent lags and others...

Many thx for all...
 
try this:p

PHP:
function onAddItem(moveitem, tileitem, position)


if moveitem.itemid == 2498 then
doRemoveItem(moveitem.uid)
doPlayerAddMoney(cid, 18000)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HITBYFIRE)
doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_GOLD)
end
return TRUE
end

rep++ if work please:p

@f@bio
you try with:
Code:
	isItemMoveable = isItemMovable

isMoveable checks only if the item is moveable. Not if moved.
 
cid was added to additem event in beta 2

just look at the soruces and
Code:
uint32_t MoveEvent::executeAddRemItem(Creature* actor, Item* item, Item* tileItem, const Position& pos)
so use

onAddItem(cid, moveitem, tileitem, position)

newbies
 
Last edited:
try this:p

PHP:
function onAddItem(moveitem, tileitem, position)


if moveitem.itemid == 2498 then
doRemoveItem(moveitem.uid)
doPlayerAddMoney(cid, 18000)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HITBYFIRE)
doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_GOLD)
end
return TRUE
end

rep++ if work please:p



isMoveable checks only if the item is moveable. Not if moved.

When i'm use this appear thi error:

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/sell_move.lua:eek:nAddItem

luaDoPlayerAddMoney(). Player not found

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/sell_move.lua:eek:nAddItem

attempt to index a number value
stack traceback:
[C]: in function 'doSendMagicEffect'
data/movements/scripts/sell_move.lua:9: in function <data/movements/scri
pts/sell_move.lua:3>

More ideias??? many thx for all...
 
^.- why you dont read?

PHP:
function onAddItem(cid, moveitem, tileitem, position)

if moveitem.itemid == 2498 then
doRemoveItem(moveitem.uid)
doPlayerAddMoney(cid, 18000)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HITBYFIRE)
doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_GOLD)
end
return TRUE
end
of course you should use tfs 0.3 beta 2 or beta 3
 
then you fucked it wont work, you could use anything like .

PHP:
    local cid = get thing from pos -> where the player should be.
    if isPlayer(cid) then
        doPlayerAddMoney(cid, 18000)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HITBYFIRE)
        doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_GOLD)
    end

Time to learn baby, i wont make it.
 
then you fucked it wont work, you could use anything like .

PHP:
    local cid = get thing from pos -> where the player should be.
    if isPlayer(cid) then
        doPlayerAddMoney(cid, 18000)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HITBYFIRE)
        doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_GOLD)
    end

Time to learn baby, i wont make it.

if isPlayer(cid) == TRUE

xD :)
 
when you use...

if isPlayer(cid) == TRUE then

it can be.

if TRUE == TRUE then
-> Become true -> if true then
continue

or

if FALSE == TRUE then
-> become false -> if false then
stop

if isPlayer(cid) then

if true then continue
 
Back
Top