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

Guild War

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
Someone could help me?
[---]
------Example------
Leader King:!war "Queens
[brodcast]The Kings guild is calling the guild Queens for a battle.
------Accept------
Leader Queen:!accept "Kings
[broadcast]The guild Queens has accepted the battle.
*After ten minutes: teleport all Queens to determined area.
*After ten minutes: teleport all Kings to determined area.
------Cancel------
Leader Queen:!cancel "Kings
[broadcast]The guild Queens did not accept the invitation to the battle.
[---]
Please!!
 
mmm, i hesitaited to pick this up because i don't have much time lately.
But if this still hasn't been 'Helped/replied' to ill have ago at it tommorw
for you ;D

No promises tho, as i dont have much time
 
Helpful functions:
getPlayerGuildId(cid)
getPlayerGuildName(cid)
getPlayerGuildRank(cid)

something like this, just a start ;)

Code:
function onSay(cid, words, param)
    if isPlayer(param) == TRUE then
        if getPlayerGuildId(param) ~= 0 then
            if getPlayerGuildRank(param) == 1 then -- idk how to use it, yet
                doPlayerSendTextMessage(param, 22, getCreatureName(cid).." invites you to open battle. Do you accept? (yes/no).")
                broadcastMessage(getCreatureName(cid).." invites "..param.." to battle.", MESSAGE_STATUS_WARNING)
                setPlayerStorageValue(param, WAR_INVITE, 1)
            else
                doPlayerSendTextMessage(cid, 22, param.." is not a leader.")
            end
        else
            doPlayerSendTextMessage(cid, 22, param.." has no guild.")
        end
    else
        doPlayerSendTextMessage(cid, 22, "This player does not exist or is offline.")
        setPlayerStorageValue(cid, WAR_INVITE, 0)
    end
    return TRUE
end

Accepting/refusing:
Code:
function onSay(cid, words, param)
    if param == "yes" then
        if getPlayerStorageValue(cid, WAR_INVITE) == 1 then
            setPlayerStorageValue(cid, WAR_INVITE, 0)
            -- checking online players guild and teleporting them :O
        else
            doPlayerSendTextMessage(cid, 22, "You are not invited to any battle.")
        end
    elseif param == "no" then
        broadcastMessage(getCreatureName(cid).." did not accept war invitation.", MESSAGE_STATUS_WARNING)
    end
    return TRUE
end

Have fun making it work ;p
 
Nice start...
Tags:
PHP:
	<talkaction words="!warinvite" script="invite.lua"/>
	<talkaction words="!waroptions" script="accepting_refusing.lua"/>

!warinvite "[GM]BomBa
!waroptions "yes
!waroptions "no
 
Sorry for not replying. but i don't have enough time to try it. Thought i should atleast tell you since i said i would try.
 
A little help

PHP:
local playersList = getOnlinePlayers()
for i = 1, #players do
    if (getPlayerGuildName(getPlayerByName(playerList[i]) == "Kings") then
        doTeleportThing(getPlayerByName(playerList[i], pos)
    end
end
 
Back
Top