vichoko
Member
I'm looking for this talkaction /ban with the option to add a comment and the lenght of the ban time.
I asked for this talkaction in other forum, but i didn't got it to work; and i think that's because the script they gave me was for a older version of TFS.
Anyway i'll put it here, if someone can convert it to TFS 1.0 it could be cool.
For the other side, if someone have this talkaction that i'm looking for that is working it will be useful too
Thanks for reading!
I asked for this talkaction in other forum, but i didn't got it to work; and i think that's because the script they gave me was for a older version of TFS.
Anyway i'll put it here, if someone can convert it to TFS 1.0 it could be cool.
For the other side, if someone have this talkaction that i'm looking for that is working it will be useful too
Thanks for reading!
Code:
<talkaction log="yes" words="/ban" access="3" event="script" value="ban.lua"/>
Code:
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 comment = ""
if(parametres[2] == nil) then
doPlayerSendCancel(cid, "You must enter ban days.")
return true
elseif(isNumber(parametres[2]) == false) then
doPlayerSendCancel(cid, "Ban days use only numbers.")
return true
end
if(parametres[3] ~= nil) then
comment = parametres[3]
end
doAddAccountBanishment(accId, getPlayerGUIDByName(parametres[1]), os.time() + (86400 * parametres[2]), 4, 2, comment, getPlayerGUID(cid), '')
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