• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Movements] Max player && idol kick

Jordan_August

New Member
Joined
Jul 24, 2012
Messages
122
Reaction score
4
Hello... I need some help on yet another script for 0.3.6. I have torn apart other scripts trying to make it work, but I guess lua is not my strong suite yet lol. I just need a onStepIn that basically only allows one player into a room at a time kinda like a xyz to xyz area. and it also kicks the person after x time. having the amount of players and idol time configurable would be ideal.. but ill appreciate any help at all. Thanks in advance.
 
Last edited:
Code:
function onStepIn(cid, item, position, fromPosition)
     if not isPlayer(cid) then
         return true
     end

     local spec = getSpectators({x = 91, y = 127, z = 7}, 5, 5, false)
     if spec ~= nil then
         for _, s in pairs(spec) do
             if isPlayer(s) then
                 doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "There is already someone in the area.")
                 doTeleportThing(cid, fromPosition)
                 doSendMagicEffect(fromPosition, CONST_ME_POFF)
                 return true
             end     
         end
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome to the area.")
     return true
end
About the part that should kick the player, you can add addEvent where a players enters the area, then run a function that kicks the player, like this.
http://otland.net/threads/boat-npc.217037/page-2#post-2084553
 
Code:
function onStepIn(cid, item, position, fromPosition)
     if not isPlayer(cid) then
         return true
     end

     local spec = getSpectators({x = 91, y = 127, z = 7}, 5, 5, false)
     if spec ~= nil then
         for _, s in pairs(spec) do
             if isPlayer(s) then
                 doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "There is already someone in the area.")
                 doTeleportThing(cid, fromPosition)
                 doSendMagicEffect(fromPosition, CONST_ME_POFF)
                 return true
             end    
         end
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome to the area.")
     return true
end
About the part that should kick the player, you can add addEvent where a players enters the area, then run a function that kicks the player, like this.
http://otland.net/threads/boat-npc.217037/page-2#post-2084553
Thanks Limos for the script and pointing me in the right direction!
 
Back
Top