Error.
#1

pawn Код:
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.
The code:

pawn Код:
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;
}
The line :
pawn Код:
else
Reply
#2

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;
}
Reply
#3

Quote:
Originally Posted by batonsa
Посмотреть сообщение
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;
}
I gets a lot of errors and warnings bro ..
Reply
#4

paste them here?
Reply
#5

Your else has to follow an 'if' statement.
Код:
        switch(RandomStart)
        {
	            ...
       	}
        else
        {
        	engineOn[vehicle] = 0;
        }
That should fix it
Код:
if(RandomStart)
{
	switch(RandomStart)
    	{
   		...
	}
}
else
{
        engineOn[vehicle] = 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)