Difference between revisions of "Lua:player spawn"
From Fortress Forever Wiki
Jump to navigationJump to searchm (Lua:Player spawn moved to Lua:player spawn) |
|||
Line 1: | Line 1: | ||
+ | {{Infobox manual/Header}} | ||
This function is called whenever a player spawns in the map. | This function is called whenever a player spawns in the map. | ||
Line 24: | Line 25: | ||
[[Category:Lua Commands]] | [[Category:Lua Commands]] | ||
+ | {{Infobox manual/Footer}} |
Revision as of 17:37, 31 December 2007
Here is an example of giving the player full health, full armor, full rockets, full shells, and 1 grenade upon spawning (player_id is the player this event is called on and must be passed in to the functions used as shown in the example): function player_spawn( player_id ) -- 400 for overkill. of course the values -- get clamped in game code AddHealth( player_id, 400 ) AddArmor( player_id, 400 ) AddAmmo( player_id, "AMMO_NAILS", -400 ) AddAmmo( player_id, "AMMO_SHELLS", 400 ) AddAmmo( player_id, "AMMO_ROCKETS", 400 ) AddAmmo( player_id, "AMMO_CELLS", -400 ) AddAmmo( player_id, "AMMO_DETPACK", -1 ) AddAmmo( player_id, "AMMO_RADIOTAG", -400 ) AddAmmo( player_id, "AMMO_GREN1", -4 ) AddAmmo( player_id, "AMMO_GREN2", -4 ) -- Players get 1 gren1 AddAmmo( player_id, "AMMO_GREN1", 1 ) end |