OnPlayerModInfo: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server event}} This event is triggered when a player has modified certain files ==Parameters== <syntaxhighlight lang="lua"> int category, table ids, table names </syntaxhighlight> *'''cate...") |
|||
Line 24: | Line 24: | ||
This example asks awkward questions unless the player has only changed the radar graphic | This example asks awkward questions unless the player has only changed the radar graphic | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function onPlayerModInfo ( category, ids, names ) | ||
if category == 'gta3.img' then | |||
for k,v in pairs(names) do | |||
if not string.find( v, "radar" ) then | |||
outputChatBox( getPlayerName(source) .. ", why have you modified " .. v .. "?" ) | |||
end | |||
end | |||
end | |||
end | end | ||
addEventHandler ( "onPlayerModInfo", | addEventHandler ( "onPlayerModInfo", getRootElement(),onPlayerModInfo ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{See also/Server event|Player events}} | {{See also/Server event|Player events}} |
Revision as of 02:39, 29 July 2011
This event is triggered when a player has modified certain files
Parameters
int category, table ids, table names
- category: An integer indicating what category of file has been modified. Currently there is only one category:
- 1: gta3.img
- ids: A table with the id's of the parts of the file that have been modified
- names: A table with the names of the parts of the file that have been modified
Source
The source of this event is the player
Example
This example asks awkward questions unless the player has only changed the radar graphic
function onPlayerModInfo ( category, ids, names ) if category == 'gta3.img' then for k,v in pairs(names) do if not string.find( v, "radar" ) then outputChatBox( getPlayerName(source) .. ", why have you modified " .. v .. "?" ) end end end end addEventHandler ( "onPlayerModInfo", getRootElement(),onPlayerModInfo )
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
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled