SetBanNick

From Multi Theft Auto: Wiki
Revision as of 15:22, 6 August 2016 by Walid (talk | contribs) (Added oop syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function sets a new nick for a ban.

Syntax

bool setBanNick ( ban theBan, string theNick )


OOP Syntax Help! I don't understand this!

Method: ban:setNick(...)
Variable: .nick
Counterpart: getBanNick


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

Returns true if changed, false otherwise.

Example

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

See Also