Ir para conteúdo

Featured Replies

Postado

Vá em data > talkactions > script crie um arquivo chamado ban.lua

Coloque o seguinte dentro :

 

local default_comment = ""
local default_lenght = 1 -- ban time in hours

function onSay(cid, words, param)
local parametres = string.explode(param, ",")
if(parametres[1] ~= nil) then
local accId = getAccountIdByName(parametres[1])
if(accId > 0) then
local lenght = default_lenght
local comment = default_comment
if(parametres[2] ~= nil and tonumber(parametres[2]) > 0) then
lenght = tonumber(parametres[2])
end
if(parametres[3] ~= nil) then
comment = parametres[3]
end
doAddBanishment(accId, lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)
local player = getPlayerByNameWildcard(parametres[1])
if(isPlayer(player) == TRUE) then
doRemoveCreature(player)
end
else
doPlayerSendCancel(cid, "Player with name " .. parametres[1] .. " doesn't exist.")
end
else
doPlayerSendCancel(cid, "You must enter name.")
end
return true
end

 

 

 

Depois vá em data > talkactions > talkaction.xml e adicione essa tag :

<talkaction log="yes" words="/ban" access="3" event="script" value="ban.lua"/>

 

Para usar o comando use /ban NOMEDOPLAYER, quantas horas dura o ban, motivo

IquIkKG.png

MSN : [email protected]

Skype : Denis.silveiraa

Postado
  • Autor

Vá em data > talkactions > script crie um arquivo chamado ban.lua

Coloque o seguinte dentro :

 

local default_comment = ""
local default_lenght = 1 -- ban time in hours

function onSay(cid, words, param)
local parametres = string.explode(param, ",")
if(parametres[1] ~= nil) then
local accId = getAccountIdByName(parametres[1])
if(accId > 0) then
local lenght = default_lenght
local comment = default_comment
if(parametres[2] ~= nil and tonumber(parametres[2]) > 0) then
lenght = tonumber(parametres[2])
end
if(parametres[3] ~= nil) then
comment = parametres[3]
end
doAddBanishment(accId, lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)
local player = getPlayerByNameWildcard(parametres[1])
if(isPlayer(player) == TRUE) then
doRemoveCreature(player)
end
else
doPlayerSendCancel(cid, "Player with name " .. parametres[1] .. " doesn't exist.")
end
else
doPlayerSendCancel(cid, "You must enter name.")
end
return true
end

 

 

 

Depois vá em data > talkactions > talkaction.xml e adicione essa tag :

<talkaction log="yes" words="/ban" access="3" event="script" value="ban.lua"/>

 

Para usar o comando use /ban NOMEDOPLAYER, quantas horas dura o ban, motivo

 

irei testar jaja edi

 

 

 

/eu executo o comando , o player desloga, porem ele loga denovo, nos outro foruns falaram qeu o "doAddBanishment" em alguns ot nao sao  mas usados, pode ser isso ?

Editado por Tiago6795 (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.8k

Informação Importante

Confirmação de Termo