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…')
 
m (Fixed the example)
Line 28: Line 28:
 
               veh.Explode( plr );
 
               veh.Explode( plr );
 
           }
 
           }
 +
    }
 
      
 
      
 
     return 1;
 
     return 1;

Revision as of 19:09, 22 December 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. }
  11. return 1;
  12. }
  13.  

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