• 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!

Guilds Waiting room

magista

RL name " Amir reda "
Joined
Jul 22, 2011
Messages
157
Solutions
1
Reaction score
21
Location
Egypt
Hello guys,

I need a movement script if the player member of a guild he will teleported to the waiting room and then a broadcast message will announce that tha player name joined the waiting room and count how many players from his guild in waiting room . Maximum 15 players players of same guild . Last thing maximum guilds that can join this room are 4 guilds .

can any1 edit this ??

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local teleportto = {x = 32046, y = 31802, z = 7} -- waiting room
    if isPlayer(cid) then
        if getPlayerGuildId(cid) > 0 then
        doBroadcastMessage(getPlayerName(cid).." from guild "..getPlayerGuildName(cid).." has been joined War Event.This guild have now Players in waiting room", MESSAGE_EVENT_ADVANCE)
        setGlobalStorageValue(1200,getGlobalStorageValue(1200)+1)
        doTeleportThing(cid, teleportto)
        doSendMagicEffect(teleportto,CONST_ME_TELEPORT)
        doPlayerSetStorageValue(cid, 9001,1)
        else
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(fromPosition,CONST_ME_POFF)
        doPlayerSendCancel(cid, "You Don't Have A Guild")
        end
    end
    return true
end
 
Last edited:
Not tested.
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

local max = 20 -- max players per guild
local teleportto = {x = 32046, y = 31802, z = 7} -- waiting room
local guildid = getPlayerGuildId(cid) -- guild id func

    if not isPlayer(cid) then
        return false
     end

    if getGlobalStorageValue(getPlayerGuildId(cid)) == max then
        doPlayerSendCancel(cid, "The even is full.")
        doTeleportThing(cid, fromPosition)
        return false
    end

      if getPlayerGuildId(cid) < 0 then
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(fromPosition,CONST_ME_POFF)
        doPlayerSendCancel(cid, "You don't have any guild.")
            return false
        end

        doBroadcastMessage(getPlayerName(cid).." from guild "..getPlayerGuildName(cid).." has joined the War Event. This guild have now "..getGlobalStorageValue(guildid).." Players in waiting room", MESSAGE_EVENT_ADVANCE)
        setGlobalStorageValue(1200,getGlobalStorageValue(1200)+1)
        doTeleportThing(cid, teleportto)
        doSendMagicEffect(teleportto,CONST_ME_TELEPORT)
        doPlayerSetStorageValue(cid, 9001,1)
        setGlobalStorageValue(guildid, tonumber(getGlobalStorageValue(guildid)+1))
    return true
end
 
Back
Top Bottom