C:\Program Files\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(58219) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
if(newkeys == KEY_FIRE)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new RandomStart;
RandomStart = random(4);
switch(RandomStart)
{
case 0,1,2:
{
engineOn[GetPlayerVehicleID(playerid)] = true;
TogglePlayerControllable(playerid, true);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Vehicle engine starts (( %s )).", sendername);
SendClientMessage(playerid, COLOR_RED, "The engine started normaly.");
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
engineOn[vehicle] = 1;
}
case 3:
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Vehicle engine doesn't start (( %s )).", sendername);
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
engineOn[vehicle] = 0;
}
}
else
{
engineOn[vehicle] = 0;
}
}
return 1;
}
else
case 0,1,2: { engineOn[GetPlayerVehicleID(playerid)] = true; TogglePlayerControllable(playerid, true); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Vehicle engine starts (( %s )).", sendername); SendClientMessage(playerid, COLOR_RED, "The engine started normally."); ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED); engineOn[vehicle] = 1; } case 3: { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Vehicle engine doesn't start (( %s )).", sendername); ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED); engineOn[vehicle] = 0; } } } else { engineOn[vehicle] = 0; } } return 1; }
Here you go
Код:
case 0,1,2: { engineOn[GetPlayerVehicleID(playerid)] = true; TogglePlayerControllable(playerid, true); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Vehicle engine starts (( %s )).", sendername); SendClientMessage(playerid, COLOR_RED, "The engine started normally."); ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED); engineOn[vehicle] = 1; } case 3: { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Vehicle engine doesn't start (( %s )).", sendername); ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED); engineOn[vehicle] = 0; } } } else { engineOn[vehicle] = 0; } } return 1; } |
switch(RandomStart) { ... } else { engineOn[vehicle] = 0; }
if(RandomStart) { switch(RandomStart) { ... } } else { engineOn[vehicle] = 0; }