26.09.2012, 22:37
You can toggle the status of a vehicle's engine using SetVehicleParamsEx along with GetVehicleParamsEx.
When creating the hotwire command itself, you can use the random function along with a switch statement to simulate the user succeeding or failing.
If they succeed, toggle the status of the vehicle's engine to true. (Which would obviously turn it on). You can also use GetPlayerState to determine if they are in a vehicle and in the position of driver.
When creating the hotwire command itself, you can use the random function along with a switch statement to simulate the user succeeding or failing.
pawn Код:
switch(random(2))
{
case 0: // User has failed or succeeded in hot wiring. [Option 1].
case 1: // Same situation, content would fall in accordingly. [Option 2].
}
pawn Код:
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You aren't the driver of a vehicle.");