OnPlayerBan: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Cancel Effect) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 13: | Line 13: | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the [[player]] who was banned. | The [[event system#Event source|source]] of this event is the [[player]] who was banned. | ||
==Cancel effect== | |||
This event cannot be canceled. | |||
==Example== | ==Example== | ||
Line 20: | Line 23: | ||
local banner = getPlayerName( responsibleElement ) or "Console" -- Get the banner's name. | local banner = getPlayerName( responsibleElement ) or "Console" -- Get the banner's name. | ||
outputChatBox ( banner .." has banned ".. getPlayerName( source ) ..".", | outputChatBox ( banner .." has banned ".. getPlayerName( source ) ..".", root, 255, 0, 0 ) -- Output the ban. | ||
end | end | ||
addEventHandler ( "onPlayerBan", | addEventHandler ( "onPlayerBan", root, outputBan ) -- Trigger the function when there is a ban. | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 29: | Line 32: | ||
{{ChangelogItem|1.3.0-9.03908|Fixed responsible element parameter}} | {{ChangelogItem|1.3.0-9.03908|Fixed responsible element parameter}} | ||
{{See also/Server event|Player events}} | |||
[[ru:onPlayerBan]] | [[ru:onPlayerBan]] |
Latest revision as of 17:11, 6 December 2023
This event is triggered when a player added a ban (like onBan).
Parameters
ban banPointer, player responsibleElement
Source
The source of this event is the player who was banned.
Cancel effect
This event cannot be canceled.
Example
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 ) ..".", root, 255, 0, 0 ) -- Output the ban. end addEventHandler ( "onPlayerBan", root, 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
- onPlayerACInfo
- onPlayerBan
- onPlayerChangeNick
- onPlayerChat
- onPlayerClick
- onPlayerCommand
- onPlayerConnect
- onPlayerContact
- onPlayerDamage
- onPlayerJoin
- onPlayerLogin
- onPlayerLogout
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerModInfo
- onPlayerMute
- onPlayerNetworkStatus
- onPlayerPickupHit
- onPlayerPickupLeave
- onPlayerPickupUse
- onPlayerPrivateMessage
- onPlayerQuit
- onPlayerScreenShot
- onPlayerSpawn
- onPlayerStealthKill
- onPlayerTarget
- onPlayerUnmute
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerVoiceStart
- onPlayerVoiceStop
- onPlayerWasted
- onPlayerWeaponFire
- onPlayerWeaponSwitch