Hello i want to add a level system like a door that only allows players with a certain level or + to pass and i wanted to tested but i dont know how to add the script to the actions.xml lol xD this is my script
and i was thinking maybe putting like a door for level 3000 thats why i need this script, thank you!
Code:
-- level doors based on actionId
-- to make door for level x create door on map and set its actionid to x+1000
function onUse(cid, item, frompos, item2, topos)
reqlevel = item.actionid - 1000 -- actionids below 100 are reserved
if reqlevel > 0 then
if getPlayerLevel(cid) >= reqlevel then
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Por favor, fique em frente da porta.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'Voce precisa ' .. reqlevel .. ' para passar esta porta.')
end
return 1
else
return 0
end
end