SR

Script Add Clan

Por srjuninho, 26 de abr. de 2014 em Archived

pedido
script
6
1.1k
srjuninhoS
26 de abril de 2014 às 13:59

Fala galera sabem aquele comando /clan Psycraft , 5


Eu queria colocar ele no meu serve agora só para eu "ADM" Poder usar em mim e nos player tipo /Clan Psycraft , juninho, 5


Tem como vocês me arrumarem?


SlicerS
26 de abril de 2014 às 14:31

 

 

function onSay(cid, words, param)
   if param == "" or param == " " then
      return doPlayerSendTextMessage(cid, 27, "Params needed! "..words.." [player name], [clan/rank/remove], [clan/rank value]")
   end
   
   if getPlayerGroupId(cid) ~= 6 then --n lembro se eh 5 ou 6 pra god...
      return false
   end

   local t = string.explode(param, ",")
   if not t[2] or (t[2] ~= "remove" and not t[3]) then
     return doPlayerSendTextMessage(cid, 27, "Params needed! "..words.." [player name], [clan/rank/remove], [clan/rank value]")
   end   

   local player = getPlayerByName(t[1])
   if not isPlayer(player) then
      return doPlayerSendTextMessage(cid, 27, "This player isn't online or doesn't exist!")
   end

   local choose = t[2]:lower()
   local value = tonumber(t[3]) or t[3]

   if choose == "clan" then
      if setPlayerClan(player, value) then
         return doPlayerSendTextMessage(cid, 27, "Operation completed!")
      else
         return doPlayerSendTextMessage(cid, 27, "This player are doing some task of rank or you choosed a invalid clan!")
      end
   elseif choose == "rank" then
      if setPlayerClanRank(player, value) then
         return doPlayerSendTextMessage(cid, 27, "Operation completed!")
      else
         return doPlayerSendTextMessage(cid, 27, "This player aren't in any clan or you choosed a invalid number!")
      end
   elseif choose == "remove" then
      if removePlayerClan(player) then
         return doPlayerSendTextMessage(cid, 27, "Operation completed!")
      else
         return doPlayerSendTextMessage(cid, 27, "This player are doing some task of rank, then you can't remove his clan!")
      end    
   else
      return doPlayerSendTextMessage(cid, 27, "Wrong choose! You need say if want change Rank, Clan or Remove!")
   end
return true
end    

--<talkaction words="xxxx" event="script" value="yyyy.lua"/>

 

 

 

achu q eh isso ae...

a ordem dos parametros eh:

"..words.." [player name], [clan/rank/remove], [clan/rank value]

exemplo:

[GOD]Ticho, clan, wingeon --deixa o god como wingeon
[GOD]Ticho, rank, 5 --deixa o god rank 5 do clan q ele tiver
[GOD]Ticho, remove --remove o clan atual do god

Editado Abril 26 por Slicer

srjuninhoS
26 de abril de 2014 às 15:15

 

 

 

function onSay(cid, words, param)
   if param == "" or param == " " then
      return doPlayerSendTextMessage(cid, 27, "Params needed! "..words.." [player name], [clan/rank/remove], [clan/rank value]")
   end
   
   if getPlayerGroupId(cid) ~= 6 then --n lembro se eh 5 ou 6 pra god...
      return false
   end

   local t = string.explode(param, ",")
   if not t[2] or (t[2] ~= "remove" and not t[3]) then
     return doPlayerSendTextMessage(cid, 27, "Params needed! "..words.." [player name], [clan/rank/remove], [clan/rank value]")
   end   

   local player = getPlayerByName(t[1])
   if not isPlayer(player) then
      return doPlayerSendTextMessage(cid, 27, "This player isn't online or doesn't exist!")
   end

   local choose = t[2]:lower()
   local value = tonumber(t[3]) or t[3]

   if choose == "clan" then
      if setPlayerClan(player, value) then
         return doPlayerSendTextMessage(cid, 27, "Operation completed!")
      else
         return doPlayerSendTextMessage(cid, 27, "This player are doing some task of rank or you choosed a invalid clan!")
      end
   elseif choose == "rank" then
      if setPlayerClanRank(player, value) then
         return doPlayerSendTextMessage(cid, 27, "Operation completed!")
      else
         return doPlayerSendTextMessage(cid, 27, "This player aren't in any clan or you choosed a invalid number!")
      end
   elseif choose == "remove" then
      if removePlayerClan(player) then
         return doPlayerSendTextMessage(cid, 27, "Operation completed!")
      else
         return doPlayerSendTextMessage(cid, 27, "This player are doing some task of rank, then you can't remove his clan!")
      end    
   else
      return doPlayerSendTextMessage(cid, 27, "Wrong choose! You need say if want change Rank, Clan or Remove!")
   end
return true
end    

--<talkaction words="xxxx" event="script" value="yyyy.lua"/>

 

 

 

achu q eh isso ae...

a ordem dos parametros eh:

"..words.." [player name], [clan/rank/remove], [clan/rank value]

exemplo:

[GOD]Ticho, clan, wingeon --deixa o god como wingeon
[GOD]Ticho, rank, 5 --deixa o god rank 5 do clan q ele tiver
[GOD]Ticho, remove --remove o clan atual do god

Me fala onde eu coloco esses parametros e tals

SlicerS
26 de abril de 2014 às 15:18

n eh onde por.. eh como tu flar no jogo...

vai no teu god e fla la...

 

/clan [GOD]Ticho, clan, wingeon

e ele vai virar wingeon...

 

ps: n esquece de mudar ali na tag da talkactions o words para "/clan"...

srjuninhoS
26 de abril de 2014 às 15:32

n eh onde por.. eh como tu flar no jogo...

vai no teu god e fla la...

/clan [GOD]Ticho, clan, wingeon

e ele vai virar wingeon...

 

ps: n esquece de mudar ali na tag da talkactions o words para "/clan"...

Eu quero saber onde vou colocar essas scripts e a outra la

zipter98Z
27 de abril de 2014 às 15:00

Cria um arquivo em data/talkactions/scripts com extensão .lua, e coloca nele o código que o Slicer passou. Aí, em talkactions.xml, você coloca a tag que ele mencionou no final do script:

 

<talkaction words="xxxx" event="script" value="yyyy.lua"/>

Mude xxxx para a palavra que irá chamar o código (/clan, no seu caso), e yyyy.lua para o nome do arquivo (por exemplo, clan.lua).