setUnbanTime | Multi Theft Auto: Wiki Skip to content

setUnbanTime

Client-side
Server-side
Shared

Pair: getUnbanTime

This function sets a new unban time of a given ban using unix timestamp (seconds since Jan 01 1970).

OOP Syntax Help! I don't understand this!

  • Method: ban:setUnbanTime(...)
  • Variable: .unbanTime

Syntax

bool setUnbanTime ( ban theBan, int theTime )
Required Arguments
  • theBan: The ban of which to change the unban time of.
  • theTime: The new unban time.

Returns

  • bool: result

Returns true if changed successfully, false otherwise.

Code Examples

server
addCommandHandler('setbantime', function(plr, cmd, nick, time)
if (not hasObjectPermissionTo(plr, 'function.setUnbanTime')) then
return
end
if (not nick or not time) then
outputChatBox('Syntax: /setunbantime <nick> <time>', plr)
return
end
local found = false
for k,v in ipairs(getBans()) do
if (getBanNick(v) == nick) then
setUnbanTime(v, time)
found = true
end
end
if (not found) then
outputChatBox('Player '..nick..' isn\'t banned.', plr)
return
end
end)