• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TalkAction /ban with nick, time and comment (tfs 0.3.4+)

Refresh, du you have for 0.4_DEV?:<

Since some version of 0.3 (probably 0.3.6) you can set ban time in rule violation comment. E.g. "Banned for something {+1h+20m+10s}" (1hour+20mins+10seconds)
 
TFS 0.4:

Lua:
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
                comment = parametres[2]
            end
			doAddAccountBanishment(accId, getPlayerGUIDByName(parametres[1]), os.time() + (86400 * 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

/ban player, coment

Script by Raphael Luiz!
 
@Up
Can you do that on 0.3.6pl1 (ban only character on days ?)
ex. /ban player, 4 days, noob
 
Ok, modified:

Lua:
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

/ban player, days, comment
 
is it possible to ban only one charcater, not account?really?



maybe:

setPlayerStorage

and onlogin

if getPlayerStorage blablalba then
return false
end

?

or something like that
 
Hmm.. i dont know maybe author of thread know.. I need the only one character, what i type
 
test:

Lua:
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
			doAddPlayerBanishment(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
 
Error:

Code:
[20:47:11.010] [Error - TalkAction Interface]
[20:47:11.010] data/talkactions/scripts/custom/gods/ban.lua:onSay
[20:47:11.010] Description:
[20:47:11.010] data/talkactions/scripts/custom/gods/ban.lua:17: attempt to call
global 'doAddBanishment' (a nil value)
[20:47:11.010] stack traceback:
[20:47:11.010]  data/talkactions/scripts/custom/gods/ban.lua:17: in function <da
ta/talkactions/scripts/custom/gods/ban.lua:4>

Any help?
 
Back
Top