Ir para conteúdo

[Talkactions] Guildwar


netflat

Posts Recomendados

Achei um GuildWar na net e queria que invez de o player dizer:

 

/war-invite

 

dizer

 

/war invite

 

Só muda a barra mais eu acho que tem que mudar algo no script...

 

dofile("./GuildWar.lua")
function onSay(cid, words, param)
if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then
	local myGuild = getPlayerGuildId(cid)
	if words == "/war-invite" then
		if GuildIsInPEace(myGuild) == true then
			if param ~= "" then
				if guildExist(param) ~= LUA_ERROR then
					local invitedGuild = getGuildId(param)
					if invitedGuild ~= LUA_ERROR then
						if invitedGuild ~= myGuild then
							if GuildIsInPEace(invitedGuild) == true then
								doInviteToWar(myGuild, invitedGuild)
								doBroadcastMessage(BroadCast[1][1] ..getPlayerGuildName(cid).. BroadCast[1][2] ..getGuildNameById(invitedGuild).. BroadCast[1][3], BroadCast_Type)
							else
								doPlayerSendCancel(cid, CancelMessagesWar[6])
							end
						else
							doPlayerSendCancel(cid, CancelMessagesWar[8])
						end
					else
						doPlayerSendCancel(cid, CancelMessagesWar[4])
					end
				else
					doPlayerSendCancel(cid, CancelMessagesWar[4])
				end
			else
				doPlayerSendCancel(cid, CancelMessagesWar[7])
			end
		else
			doPlayerSendCancel(cid, CancelMessagesWar[5])
		end
	elseif words == "/war-accept" then
		if getGuildWarInfo(myGuild).By ~= 0 then
			local enemyGuild = getGuildWarInfo(myGuild).By
			doBroadcastMessage(BroadCast[2][1] ..getPlayerGuildName(cid).. BroadCast[2][2] ..getGuildNameById(enemyGuild).. BroadCast[2][3], BroadCast_Type)
			WarAccept(myGuild, enemyGuild)
		else
			doPlayerSendCancel(cid, CancelMessagesWar[1])
		end
	elseif words == "/war-reject" then
		if getGuildWarInfo(myGuild).By ~= 0 then
			doBroadcastMessage(BroadCast[3][1] ..getPlayerGuildName(cid).. BroadCast[3][2] ..getGuildNameById(getGuildWarInfo(myGuild).By).. BroadCast[3][3], BroadCast_Type)
			cleanInfo(getGuildWarInfo(myGuild).By)
			cleanInfo(myGuild)
		else
			doPlayerSendCancel(cid, CancelMessagesWar[1])	
		end
	elseif words == "/war-cancel-invite" then
		if getGuildWarInfo(myGuild).To ~= 0 then
			if getGuildWarInfo(myGuild).With == 0 then
				doBroadcastMessage(BroadCast[4][1] ..getPlayerGuildName(cid).. BroadCast[4][2] ..getGuildNameById(getGuildWarInfo(myGuild).To).. BroadCast[4][3], BroadCast_Type)
				cleanInfo(getGuildWarInfo(myGuild).To)
				cleanInfo(myGuild)
			else
				doPlayerSendCancel(cid, CancelMessagesWar[3])
			end
		else
			doPlayerSendCancel(cid, CancelMessagesWar[1])	
		end
	elseif words == "/war-challenge" then
		local map = Maps[param]
		if map then
			if getGuildWarInfo(myGuild).With ~= 0 and getGuildWarInfo(myGuild).ON == 0 then
				local enemyGuild = getGuildWarInfo(myGuild).With
				addEvent(StarWar, 15 * 1000, {myGuild = myGuild, enemyGuild = enemyGuild, map = param})
				doBroadcastMessage(BroadCast[5][1] ..getPlayerGuildName(cid).. BroadCast[5][2] ..getGuildNameById(enemyGuild).. BroadCast[5][3] .. param ..".", BroadCast_Type)
			else
				doPlayerSendCancel(cid, CancelMessagesWar[10])
			end
		else
			doPlayerSendCancel(cid, CancelMessagesWar[9])
		end
	elseif words == "/war-cancel" then
		local enemy = getGuildWarInfo(myGuild).With
		if enemy ~= 0 then
			if (os.time() - getGuildWarInfo(myGuild).T) >= (60 * DelayToCancel) then
				StopWar(myGuild, enemy)
				doBroadcastMessage(BroadCast[6][1] ..getGuildNameById(myGuild).. BroadCast[6][2] ..getGuildNameById(enemy).. BroadCast[6][3], BroadCast_Type)
			else
				doPlayerSendCancel(cid, CancelMessagesWar[11])
			end
		else
			doPlayerSendCancel(cid, CancelMessagesWar[10])
		end
	end
else
	doPlayerSendCancel(cid, CancelMessagesWar[2])
end
local file = io.open("data/logs/Wars.txt", "a") 
file:write("".. os.date("%d %B %Y %X ", os.time()) .." -->  "..getCreatureName(cid)..": "..words.." "..param.."\n") 
file:close() 
return TRUE
end

 

<!-- Guilds Wars -->
   <talkaction words="/war-invite" event="script" value="GuildWar.lua"/>    
   <talkaction words="/war-accept" event="script" value="GuildWar.lua"/>    
   <talkaction words="/war-reject" event="script" value="GuildWar.lua"/>
   <talkaction words="/war-cancel" event="script" value="GuildWar.lua"/>    
   <talkaction words="/war-challenge" event="script" value="GuildWar.lua"/>    
   <talkaction words="/war-cancel-invite" event="script" value="GuildWar.lua"/>

 

Obrigado quem ajudar =D

Link para o comentário
Compartilhar em outros sites

if words == "/war-invite" then

 

 

ta na 5º linha do script, é só modificar, tem outros comandos no script que ta assim, para procurar os outros aperte CTRL + F e procure por words.

Editado por Saymon14
Link para o comentário
Compartilhar em outros sites

aiii cykoo arrumei pra vc irmão:

 

dofile("./GuildWar.lua")
function onSay(cid, words, param)
       if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then
               local myGuild = getPlayerGuildId(cid)
               if (param) == "invite" then
                       if GuildIsInPEace(myGuild) == true then
                               if param ~= "" then
                                       if guildExist(param) ~= LUA_ERROR then
                                               local invitedGuild = getGuildId(param)
                                               if invitedGuild ~= LUA_ERROR then
                                                       if invitedGuild ~= myGuild then
                                                               if GuildIsInPEace(invitedGuild) == true then
                                                                       doInviteToWar(myGuild, invitedGuild)
                                                                       doBroadcastMessage(BroadCast[1][1] ..getPlayerGuildName(cid).. BroadCast[1][2] ..getGuildNameById(invitedGuild).. BroadCast[1][3], BroadCast_Type)
                                                               else
                                                                       doPlayerSendCancel(cid, CancelMessagesWar[6])
                                                               end
                                                       else
                                                               doPlayerSendCancel(cid, CancelMessagesWar[8])
                                                       end
                                               else
                                                       doPlayerSendCancel(cid, CancelMessagesWar[4])
                                               end
                                       else
                                               doPlayerSendCancel(cid, CancelMessagesWar[4])
                                       end
                               else
                                       doPlayerSendCancel(cid, CancelMessagesWar[7])
                               end
                       else
                               doPlayerSendCancel(cid, CancelMessagesWar[5])
                       end
               elseif (param) == "accept" then
                       if getGuildWarInfo(myGuild).By ~= 0 then
                               local enemyGuild = getGuildWarInfo(myGuild).By
                               doBroadcastMessage(BroadCast[2][1] ..getPlayerGuildName(cid).. BroadCast[2][2] ..getGuildNameById(enemyGuild).. BroadCast[2][3], BroadCast_Type)
                               WarAccept(myGuild, enemyGuild)
                       else
                               doPlayerSendCancel(cid, CancelMessagesWar[1])
                       end
               elseif (param) == "reject" then
                       if getGuildWarInfo(myGuild).By ~= 0 then
                               doBroadcastMessage(BroadCast[3][1] ..getPlayerGuildName(cid).. BroadCast[3][2] ..getGuildNameById(getGuildWarInfo(myGuild).By).. BroadCast[3][3], BroadCast_Type)
                               cleanInfo(getGuildWarInfo(myGuild).By)
                               cleanInfo(myGuild)
                       else
                               doPlayerSendCancel(cid, CancelMessagesWar[1])   
                       end
               elseif (param) == "cancel invite" then
                       if getGuildWarInfo(myGuild).To ~= 0 then
                               if getGuildWarInfo(myGuild).With == 0 then
                                       doBroadcastMessage(BroadCast[4][1] ..getPlayerGuildName(cid).. BroadCast[4][2] ..getGuildNameById(getGuildWarInfo(myGuild).To).. BroadCast[4][3], BroadCast_Type)
                                       cleanInfo(getGuildWarInfo(myGuild).To)
                                       cleanInfo(myGuild)
                               else
                                       doPlayerSendCancel(cid, CancelMessagesWar[3])
                               end
                       else
                               doPlayerSendCancel(cid, CancelMessagesWar[1])   
                       end
               elseif (param) == "challenge" then
                       local map = Maps[param]
                       if map then
                               if getGuildWarInfo(myGuild).With ~= 0 and getGuildWarInfo(myGuild).ON == 0 then
                                       local enemyGuild = getGuildWarInfo(myGuild).With
                                       addEvent(StarWar, 15 * 1000, {myGuild = myGuild, enemyGuild = enemyGuild, map = param})
                                       doBroadcastMessage(BroadCast[5][1] ..getPlayerGuildName(cid).. BroadCast[5][2] ..getGuildNameById(enemyGuild).. BroadCast[5][3] .. param ..".", BroadCast_Type)
                               else
                                       doPlayerSendCancel(cid, CancelMessagesWar[10])
                               end
                       else
                               doPlayerSendCancel(cid, CancelMessagesWar[9])
                       end
               elseif (param) == "cancel" then
                       local enemy = getGuildWarInfo(myGuild).With
                       if enemy ~= 0 then
                               if (os.time() - getGuildWarInfo(myGuild).T) >= (60 * DelayToCancel) then
                                       StopWar(myGuild, enemy)
                                       doBroadcastMessage(BroadCast[6][1] ..getGuildNameById(myGuild).. BroadCast[6][2] ..getGuildNameById(enemy).. BroadCast[6][3], BroadCast_Type)
                               else
                                       doPlayerSendCancel(cid, CancelMessagesWar[11])
                               end
                       else
                               doPlayerSendCancel(cid, CancelMessagesWar[10])
                       end
               end
       else
               doPlayerSendCancel(cid, CancelMessagesWar[2])
       end
       local file = io.open("data/logs/Wars.txt", "a") 
       file:write("".. os.date("%d %B %Y %X ", os.time()) .." -->  "..getCreatureName(cid)..": "..words.." "..param.."\n") 
       file:close() 
       return TRUE
end

 

 

E a Tag vc só vai usar essa:

 

<!-- Guilds Wars -->
   <talkaction words="/war" event="script" value="GuildWar.lua"/>

 

@ CORRIGIDO xD

 

esse funciona....

 

abraçoo

nooixxx cyko

Editado por MarcelloMkez
Link para o comentário
Compartilhar em outros sites

como não esta funcionando diegool? nao intendi seu problema...

 

abraço

 

________________________

 

REALMENTE EU ENCONTREI O ERRO ALI ENCIMA, JA SEI COMO ARRUMAR, ASSIM QUE CHEGA EM CASA POSTO NOVAMENTE O SCRIPT FUNCIONANDO!!

 

abraço

 

___________________________________

 

@topico

 

pronto corrigi ali encima, pode pegar la agr vai funcionar xD

 

Abraço

Editado por MarcelloMkez
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...