02.02.2013, 16:57
You can try doing something like this.
pawn Код:
if(newkeys == KEY_FIRE)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new rndNum = Random(1);
switch(rndNum)
{
case 1: // Success
{
TogglePlayerControllable(playerid, 1);
engineOn[vehicle] = 1;
SendClientMessage(playerid, COLOR_RED, "The engine started normaly.");
}
case 0: // Fail
{
engineOn[vehicle] = 0;
SendClientMessage(playerid, COLOR_RED, "The engine didn't start,try again.");
}
}
}
return 1;
}