Squirrel/Client/Events/Vehicle/onClientVehicleShot
From Liberty Unleashed Wiki
(Difference between revisions)
(→Notes) |
(→Notes) |
||
Line 30: | Line 30: | ||
=== Notes === | === Notes === | ||
− | Molotovs and flamethrower both return a weapon ID of 9. | + | * Molotovs and flamethrower both return a weapon ID of 9. |
− | Grenades and RPG return an ID 18 | + | * Grenades and RPG return an ID 18 |
The functions [[Squirrel/Client/Functions/Vehicles/GetVehicleName|GetVehicleName]] and [[Squirrel/Client/Functions/Misc/GetWeaponName|GetWeaponName]] were used in this example. More info about them can be found in the corresponding pages. | The functions [[Squirrel/Client/Functions/Vehicles/GetVehicleName|GetVehicleName]] and [[Squirrel/Client/Functions/Misc/GetWeaponName|GetWeaponName]] were used in this example. More info about them can be found in the corresponding pages. |
Revision as of 21:29, 16 November 2016
This is called when a vehicle is shot.
Syntax
function onClientVehicleShot( Vehicle vehicle, Player player, int weapon )
Arguments
- vehicle - The vehicle that was shot
- player - The player that shot the vehicle.
- weapon - ID representing the type of weapon used to shoot the vehicle
Returns
This event does not handle return values.
Example
This example will show a message to the player indicating which player shot what car and with what weapon.
function onClientVehicleShot( vehicle, player, weapon ) { Message(player.Name + " shot a " + GetVehicleName( vehicle ) + " with a " + GetWeaponName( weapon ) ); }
Notes
- Molotovs and flamethrower both return a weapon ID of 9.
- Grenades and RPG return an ID 18
The functions GetVehicleName and GetWeaponName were used in this example. More info about them can be found in the corresponding pages.