I tryed to make teleport, which will teleport only knights. Here is my script:
I've get error in console:
Whats wrong? =\
PHP:
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE and item.actionid == 12555 then
if GetPlayerVocation(cid) == 4 then
doPlayerSendTextMessage(cid,22,"Feel free to train")
doTeleportThing(cid, {x = getPlayerPosition(cid).x - 2, y = getPlayerPosition(cid).y, z = getPlayerPosition(cid).z }, 0)
else
doTeleportThing(cid, frompos, 0)
doPlayerSendTextMessage(cid,22,"Only warriors can go there.")
end
end
return TRUE
end
I've get error in console:
Code:
[09/10/2008 17:39:04] Lua Script Error: [MoveEvents Interface]
[09/10/2008 17:39:04] data/movements/scripts/citizen.lua:onStepIn
[09/10/2008 17:39:04] data/movements/scripts/citizen.lua:3: attempt to call global 'GetPlayerVocation' (a nil value)
[09/10/2008 17:39:04] stack traceback:
[09/10/2008 17:39:04] data/movements/scripts/citizen.lua:3: in function <data/movements/scripts/citizen.lua:1>
Whats wrong? =\