Scripting/Squirrel/Functions/Vehicle.Kill: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function is used to kill/explode any specified Vehicle. == SYNTAX == Vehicle.Kill() == Example == function onPlayerCommand( player, cmd, text ) { else if ( cmd == "kill...")
 
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function is used to kill/explode any specified Vehicle.
This function is used to kill/explode any specified Vehicle.


== SYNTAX ==
== Syntax ==
Vehicle.Kill()
Vehicle.Kill()


== Example ==
== Example ==
<source lang="squirrel">
function onPlayerCommand( player, cmd, text )
function onPlayerCommand( player, cmd, text )
{
{
else if ( cmd == "killcar" )
if ( cmd == "killcar" )
{
{
if ( !text ) MessagePlayer("Syntax: /" + cmd + " [Vehicle ID]", player );
if ( !text ) MessagePlayer("Syntax: /" + cmd + " [Vehicle ID]", player );
else {
else {
local veh = FindVehicle( text.tointeger() );
local veh = FindVehicle( text.tointeger() );
if ( !veh ) MessagePlayer("ERROR --> Invalid Vehicle/ID.", player );
else{
veh.Kill();
veh.Kill();
}
}
}
}
}
}
}
</source>


By Anik
== Related Functions ==
{{Scripting/Squirrel/Functions/Vehicle_Functions}}
[[Category:Scripting/Squirrel/Functions/Vehicle_Functions]]

Latest revision as of 22:03, 30 January 2017