From Multi Theft Auto: Wiki
Revision as of 16:25, 24 February 2010 by Ca11um
This event is triggered when a pickup is spawned or respawned.
This event has no arguments
This example get's the area and city name when a pickup spawns and outputs it to all the players.
function outputSpawn () local area = getElementZoneName ( source ) -- Get the area name where the pickup spawned. local city = getElementZoneName ( source, true ) -- Get the city name where the pickup spawned. outputChatBox ( "A pickup has spawned in " .. area .. " ( " .. city .. " )", getRootElement(), 255, 0, 0 ) -- Output the pickup spawn. end addEventHandler ( "onPickupSpawn", getRootElement(), outputSpawn ) -- Trigger the function when a pickup spawns.