Oto m?j drugi skrypt
Gdy kliknie si? prawym na ksi??k? o ID 9002, teleportuje nas o tyle kratek ile ustawimy, w t? stron?, w kt?r? si? patrzymy.
ksiazka.lua
actions.xml
Testowane na TFS.
Gdy kliknie si? prawym na ksi??k? o ID 9002, teleportuje nas o tyle kratek ile ustawimy, w t? stron?, w kt?r? si? patrzymy.
ksiazka.lua
Code:
[COLOR="DarkGreen"]-- BY SENERI[/COLOR]
function onUse(cid, item, frompos, item2, topos)
local access = getPlayerAccess(cid)
local ile = 5 [COLOR="DarkGreen"]-- o ile kratek ma teleportowa?[/COLOR]
local pos = getPlayerPosition(cid)
local dir = getPlayerLookDir(cid)
if (access > 3) then
if (dir == NORTH) then
pos.y=pos.y-ile
elseif (dir == SOUTH) then
pos.y=pos.y+ile
elseif (dir == EAST) then
pos.x=pos.x+ile
elseif (dir == WEST) then
pos.x=pos.x-ile
end
doTeleportThing(cid, pos)
doSendMagicEffect(pos, 5) [COLOR="DarkGreen"]-- efekt przy u?yciu[/COLOR]
else
doPlayerSendCancel(cid, "Nie jestes GMem.")
end
end
actions.xml
Code:
<action itemid="9002" script="ksiazka.lua" />
Testowane na TFS.