From Multi Theft Auto: Wiki
This event is triggered when a player added a ban (like onBan).
- banPointer: The ban pointer which was added.
- responsibleElement: The player who added the ban
The source of this event is the player who was banned.
This example outputs the responsible element and the banned player's name when a ban takes place.
function outputBan ( banPointer, responsibleElement ) -- Define the banner and the ban pointer in the function.
local banner = getPlayerName( responsibleElement ) or "Console" -- Get the banner's name.
outputChatBox ( banner .." has banned ".. getPlayerName( source ) ..".", getRootElement(), 255, 0, 0 ) -- Output the ban.
addEventHandler ( "onPlayerBan", getRootElement(), outputBan ) -- Trigger the function when there is a ban.
|| Fixed responsible element parameter