eyez
Member
- Joined
- Oct 11, 2016
- Messages
- 129
- Reaction score
- 19
How can i do to each player can have only 3 characters in training monk per IP?
entering_monks_script.lua
leave_monks_script.lua
entering_monks_script.lua
Code:
function onStepIn(cid, item, position, fromPosition)
for i = 17001, 17100 do
local pos = getThingPos(i)
if not isPlayer(getTopCreature(pos).uid) then
doTeleportThing(cid, pos)
doCreatureSay(cid, 'Training time!.', TALKTYPE_ORANGE_1, false, cid)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 17000, 1)
return true
end
end
doTeleportThing(cid, fromPosition, true)
doCreatureSay(cid, 'All training slots are taken', TALKTYPE_ORANGE_1, false, cid)
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
leave_monks_script.lua
Code:
function onStepIn(cid, item, position, fromPosition)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getPlayerPosition(cid), 10)
setPlayerStorageValue(cid, 17000, 0)
return true
end