OnPlayerModInfo: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string filename, table itemlist | |||
</syntaxhighlight> | </syntaxhighlight> | ||
*''' | *'''filename''': An string with the filename of the modified file | ||
*'''itemlist''': A table with the details of each modification within the file | |||
*''' | |||
==Source== | ==Source== | ||
Line 22: | Line 15: | ||
==Example== | ==Example== | ||
This example | This example prints all information into the chatbox | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | addEventHandler ( "onPlayerModInfo", root, | ||
function ( filename, itemList ) | |||
-- Print player name and file name | |||
outputChatBox( tostring(getPlayerName(source)) .. " " .. tostring(filename) ) | |||
-- Print details on each modification | |||
for idx,item in ipairs(itemList) do | |||
local line = tostring(idx) .. ")" | |||
for k,v in pairs(item) do | |||
line = line .. " " .. tostring(k) .. "=" .. .. tostring(v) | |||
end | |||
outputChatBox( line ) | |||
end | |||
end | |||
) | |||
addEventHandler ( "onPlayerModInfo", getRootElement(),onPlayerModInfo ) | addEventHandler ( "onPlayerModInfo", getRootElement(),onPlayerModInfo ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{See also/Server event|Player events}} | {{See also/Server event|Player events}} |
Revision as of 14:21, 29 July 2011
This event is triggered when a player has modified certain files
Parameters
string filename, table itemlist
- filename: An string with the filename of the modified file
- itemlist: A table with the details of each modification within the file
Source
The source of this event is the player
Example
This example prints all information into the chatbox
addEventHandler ( "onPlayerModInfo", root, function ( filename, itemList ) -- Print player name and file name outputChatBox( tostring(getPlayerName(source)) .. " " .. tostring(filename) ) -- Print details on each modification for idx,item in ipairs(itemList) do local line = tostring(idx) .. ")" for k,v in pairs(item) do line = line .. " " .. tostring(k) .. "=" .. .. tostring(v) end outputChatBox( line ) 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