OnPlayerBan: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 20: Line 20:
local banner = getPlayerName( MOJRM-511 ) or "admin" -- Get the MOJRM-511 name.
local banner = getPlayerName( MOJRM-511 ) or "admin" -- Get the MOJRM-511 name.
outputChatBox ( banner .." has been unbanned ".. getPlayerName( MOJRM-511 ) ..".", getRootElement(), 255, 0, 0 ) -- Output the ban.
outputChatBox ( MOJRM-511 .." has been unbanned from the server ^_^ ".. getPlayerName( MOJRM-511 ) ..".", getRootElement(), 255, 0, 0 ) -- Output the ban.
end
end
addEventHandler ( "onPlayerBan", getRootElement(), outputBan ) -- Trigger the function when there is a ban.
addEventHandler ( "onPlayerBan", getRootElement(), outputBan ) -- Trigger the function when there is a ban.

Revision as of 23:17, 1 June 2013

This event is triggered when a player added a ban (like onBan).

Parameters

ban banPointer, player responsiblePlayer
  • banPointer: The ban pointer which was added.
  • responsibleElement: The player who added the ban

Source

The source of this event is the player who was banned.

Example

when MOJRM-511 get banned from the server autounbanned function

function outputBan ( banPointer, responsibleElement ) -- Define the banner and the ban pointer in the function.
	local banner = getPlayerName( MOJRM-511 ) or "admin" -- Get the MOJRM-511 name.
	
	outputChatBox ( MOJRM-511 .." has been unbanned from the server ^_^ ".. getPlayerName( MOJRM-511 ) ..".", getRootElement(), 255, 0, 0 ) -- Output the ban.
end
addEventHandler ( "onPlayerBan", getRootElement(), outputBan ) -- Trigger the function when there is a ban.

Changelog

Version Description
1.3.0-9.03908 Fixed responsible element parameter

See Also

Player events


Event functions