function onSay(cid, words, param, channel)
if words == "!party" then
x = getCreatureByName(param)
if param == "" or param == nill or (not isPlayer(getCreatureByName(param))) then
doPlayerSendTextMessage(cid, 1, "parametros invalidos")
return TRUE
elseif getPlayerStorageValue(cid, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja esta em party")
return TRUE
elseif getPlayerStorageValue(cid, 6653) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja foi covido para um party rejeite a outra primeiro")
return TRUE
elseif getPlayerStorageValue(x, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "o player em questão ja esta em party com outra pessoa")
return TRUE
elseif getPlayerStorageValue(cid, 6653) >= 1 then
doPlayerSendTextMessage(cid, 1, "o player em questão ja foi comvidado para outra party aguarde ele reponder a outra party")
return TRUE
else
doPlayerSendTextMessage(x, 1, "o player "..getCreatureName(cid).." esta comvidando vc para party,digite !joinparty ou !regect.")
setPlayerStorageValue(x, 6653, cid)
doPlayerSendTextMessage(cid, 1, "vc comvidou o player "..getCreatureName(x).." para party aguarde a resposta")
return TRUE
end
elseif words == "!joinparty" then
if getPlayerStorageValue(cid, 6653) <= 1 then
doPlayerSendTextMessage(cid, 1, "vc n foi comvidado para um party")
elseif getPlayerStorageValue(cid, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja esta em party com o player "..getCreatureName(getPlayerStorageValue(cid, 6654)).."")
else
y = getPlayerStorageValue(cid, 6653)
setPlayerStorageValue(cid, 6653, 0)
setPlayerStorageValue(y, 6654, cid)
registerCreatureEvent(cid, "party")
registerCreatureEvent(y, "party")
setPlayerStorageValue(cid, 6654, y)
doPlayerSendTextMessage(y, 1, "o player "..getCreatureName(cid).." aceito a party com vc.")
setPlayerStorageValue(y, 6653, 0)
return TRUE
end
elseif words == "!reject" then
if getPlayerStorageValue(cid, 6653) <= 1 then
doPlayerSendTextMessage(cid, 1, "vc n foi comvidado para um party")
elseif getPlayerStorageValue(cid, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja esta em party com o player "..getCreatureName(getPlayerStorageValue(cid, 6654)).."")
else
y = getPlayerStorageValue(cid, 6653)
setPlayerStorageValue(cid, 6653, 0)
doPlayerSendTextMessage(y, 1, "o player "..getCreatureName(cid).." rejeitou a party com vc.")
end
elseif words == "!leaveparty"
z = getPlayerStorageValue(cid, 6654)
if z <= 1 then
doPlayerSendTextMessage(cid, 1, "voce n esta em party")
else
setPlayerStorageValue(cid, 6654, 0)
doPlayerSendTextMessage(cid, 1, "vc saiu da party")
doPlayerSendTextMessage(z, 1, "o player "..getCreatureName(cid).." saiu da party")
setPlayerStorageValue(z, 6654, 0)
return TRUE
end
end
end
va em crearurescript.xml e adicione essa tag(n presisa registra em login)
<event type="statschange" name="partylua" script="party.lua"/>
agora va em talkactions/script e adicione um arquivo lua com nome partysystem.lua e cole isso dentro dele
function onSay(cid, words, param, channel)
if words == "!party" then
x = getCreatureByName(param)
if param == "" or param == nill or (not isPlayer(getCreatureByName(param))) then
doPlayerSendTextMessage(cid, 1, "parametros invalidos")
return TRUE
elseif getPlayerStorageValue(cid, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja esta em party")
return TRUE
elseif getPlayerStorageValue(cid, 6653) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja foi covido para um party rejeite a outra primeiro")
return TRUE
elseif getPlayerStorageValue(x, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "o player em questão ja esta em party com outra pessoa")
return TRUE
elseif getPlayerStorageValue(cid, 6653) >= 1 then
doPlayerSendTextMessage(cid, 1, "o player em questão ja foi comvidado para outra party aguarde ele reponder a outra party")
return TRUE
else
doPlayerSendTextMessage(x, 1, "o player "..getCreatureName(cid).." esta comvidando vc para party,digite !joinparty ou !regect.")
setPlayerStorageValue(x, 6653, cid)
doPlayerSendTextMessage(cid, 1, "vc comvidou o player "..getCreatureName(x).." para party aguarde a resposta")
return TRUE
end
elseif words == "!joinparty" then
if getPlayerStorageValue(cid, 6653) <= 1 then
doPlayerSendTextMessage(cid, 1, "vc n foi comvidado para um party")
elseif getPlayerStorageValue(cid, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja esta em party com o player "..getCreatureName(getPlayerStorageValue(cid, 6654)).."")
else
y = getPlayerStorageValue(cid, 6653)
setPlayerStorageValue(cid, 6653, 0)
setPlayerStorageValue(y, 6654, cid)
setPlayerStorageValue(cid, 6654, y)
doPlayerSendTextMessage(y, 1, "o player "..getCreatureName(cid).." aceito a party com vc.")
setPlayerStorageValue(y, 6653, 0)
return TRUE
end
elseif words == "!reject" then
if getPlayerStorageValue(cid, 6653) <= 1 then
doPlayerSendTextMessage(cid, 1, "vc n foi comvidado para um party")
elseif getPlayerStorageValue(cid, 6654) >= 1 then
doPlayerSendTextMessage(cid, 1, "vc ja esta em party com o player "..getCreatureName(getPlayerStorageValue(cid, 6654)).."")
else
y = getPlayerStorageValue(cid, 6653)
setPlayerStorageValue(cid, 6653, 0)
doPlayerSendTextMessage(y, 1, "o player "..getCreatureName(cid).." rejeitou a party com vc.")
end
elseif words == "!leaveparty"
z = getPlayerStorageValue(cid, 6654)
if z <= 1 then
doPlayerSendTextMessage(cid, 1, "voce n esta em party")
else
setPlayerStorageValue(cid, 6654, 0)
doPlayerSendTextMessage(cid, 1, "vc saiu da party")
doPlayerSendTextMessage(z, 1, "o player "..getCreatureName(cid).." saiu da party")
setPlayerStorageValue(z, 6654, 0)
return TRUE
end
end
end
agora va em talkactions.xml e adicione essa tag
<talkaction words="!party;!joinparty;!reject;!leaveparty" script="partysystem.lua"/>