setBanNick | Multi Theft Auto: Wiki Skip to content

setBanNick

Client-side
Server-side
Shared

Pair: getBanNick

This function sets a new nick for a ban.

OOP Syntax Help! I don't understand this!

  • Method: ban:setNick(...)
  • Variable: .nick

Syntax

bool setBanNick ( ban theBan, string theNick )
Required Arguments
  • theBan: The ban you want to change the nick of.
  • theNick: A string representing the nick you want to set the ban to.

Returns

  • bool: result

Returns true if changed, false otherwise.

Code Examples

server
-- this example looks if there is a ban with nick 'Steve', and if there is, it changes ban nick to 'Mike'
local function changeBanNick()
for i,ban in pairs(getBans()) do
if (getBanNick(ban) == "Steve") then
setBanNick(ban,"Mike")
end
end
end
addCommandHandler("setbannick",changeBanNick)