Squirrel/Server/Events/Player/onPlayerUseDetonator

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|onPlayerUseDetonator}} {{Squirrel/LUOnly}} This event is called when a player uses a remote detonator (weapon ID 12 in GTA3). == Syntax == <code>function onPla…')

Revision as of 16:58, 8 November 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events
LU This function works in Liberty Unleashed only.

This event is called when a player uses a remote detonator (weapon ID 12 in GTA3).

Syntax

  1. function onPlayerUseDetonator( Player plr )

Arguments

  • plr - This is the player who used the detonator

Returns

This event does not handle return values.

Example

This example will blow up the closest vehicle to a player when they use the detonator.

  1.  
  2. function onPlayerUseDetonator( plr )
  3. {
  4. local veh = GetClosestVehicle( plr );
  5. {
  6. if ( veh )
  7. {
  8. veh.Explode( plr );
  9. }
  10. return 1;
  11. }
  12.  

Notes

The functions GetClosestVehicle and Vehicle.Explode were used in this example. More info about these in the corresponding pages.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox