o player pode usar !aceitar, se tiver pk, se tiver fora de pz, QUERO MUDAR ISSO, O JOGADOR SO PODE USAR !ACEITAR SE TIVER EM PROTECTION ZONE !
script
--[[ Fight System by Subwat]]--
--[[ Updated by Vodkart ]]--
function onSay(cid, words, param)
config = {
level1= 100, -- level necessario do player 1 pra usar o fight system.
level2= 100, -- level necessario do player 2 pra usar o fight system.
pid=getPlayerGUID(cid), -- não mecha
premium = "yes", -- se precisa ser premium account ("yes" or "no")
redskull="no", -- players com red skull podem huntar? ("yes" or "no").
prot="yes", -- players precisam estar em protection zone pra huntar? ("yes" or "no").
bat="yes", --players precisam estar sem fight pra huntar? ("yes" or "no").
Posplayer1 = {x=1112, y=1198, z=7}, -- para onde o jogador que deu fight sera levado
Posplayer2 = {x=1117, y=1197, z=7}, -- para onde o jogador que aceito fight sera levado
RemoveItem = "yes", -- se ira remover o item ("yes" or "no")
item = 2160, -- id do item
storage = 9696
}
if words == '!fight' then
local player = getPlayerByName(param)
local pid = getPlayerByNameWildcard(param)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"apenas player sem red skull podem Usar Fight System.")
elseif (getPlayerLevel(cid) < config.level1) then
doPlayerSendTextMessage(cid,22,"você precisa ter level " .. config.level1 .. " pra usar o fight system.")
elseif (getPlayerLevel(player) < config.level2 ) then
doPlayerSendTextMessage(cid,22,"o jogador não tem level " .. config.level2 .. " para vc dar fight system.")
elseif(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"você precisa estar em protection zone pra usar o fight system.")
elseif(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"você precisa estar sem battler pra usar o fight system.")
elseif(config.redskull == "no") and (getCreatureSkullType(player) == 4) then
doPlayerSendTextMessage(cid,22,"o outro player precisa estar sem red skull usar o fight system.")
elseif(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(player)) == FALSE) then
doPlayerSendTextMessage(cid,22,"o outro player precisa estar em protection zone pra usar o fight system.")
elseif(config.bat == "yes") and (getCreatureCondition(player, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"o outro player precisa estar sem battler pra usar o fight system.")
elseif(config.premium == "yes") and (not isPremium(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "apenas players com premium account podem dar fight.")
elseif(config.RemoveItem == "yes") and (doPlayerRemoveItem(cid, config.item, 1) == FALSE) then
doPlayerSendTextMessage(cid, 22, "Desculpe,voce não tem 1 " .. getItemNameById(config.item) .. " para dar fight.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
elseif isPlayer(player) then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Voce acaba de Desafiar o Player chamado " .. getPlayerName(player) .." espere ele aceitar.")
doPlayerSendTextMessage(player,MESSAGE_STATUS_WARNING,getCreatureName(cid) .. ' Acaba De Dar Fight em Você,o pvp entre os dois não resultará em skulls deseja aceitar? diga !aceitar se não diga !recusar.')
setPlayerStorageValue(player, config.storage, 1)
doTeleportThing(cid,config.Posplayer1)
doCreatureSetSkullType(cid, 2)
end
return TRUE
end
if words == '!aceitar' then
if getPlayerStorageValue(cid,config.storage) >= 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "o jogador aceito,começara o fight.")
setPlayerStorageValue(cid, config.storage, -1)
doCreatureSetSkullType(cid, 2)
doTeleportThing(cid,config.Posplayer2)
else
doPlayerSendTextMessage(cid, 22, "Desculpe,voce não foi envitado para fight.")
end
return TRUE
end
if words == '!recusar' then
if getPlayerStorageValue(cid,config.storage) >= 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "você recusou o fight.")
setPlayerStorageValue(cid, config.storage, -1)
end
return TRUE
end
return TRUE
end