Scripting Help
#1

(130) : error 002: only a single statement (or expression) can follow each "case"

1 Error.

Код:
switch(glob0[playerid]) {
		case 1:
			SetPlayerPos(playerid, -2787.6155 + random(66), -294.2366 + random(8), 7.0399);
			SetPlayerFacingAngle(playerid, random(360)); // Line 130
			SetPlayerColor(playerid, 0x87CEEBAA);
			SetPlayerPos(playerid, 1672.6181 + random(23), 1440.2609 + random(15), 10.7791);
			SetPlayerFacingAngle(playerid, random(360));
			SetPlayerColor(playerid, 0xFF0000AA);
			SetPlayerPos(playerid, -1639.0776 + random(66), 655.8917 + random(14), 7.1901);
			SetPlayerFacingAngle(playerid, random(360));
			SetPlayerColor(playerid, 0x0000FFAA);
			SetPlayerPos(playerid, 2471.2419 + random(36), -1684.1921 + random(30), 13.5459);
			SetPlayerFacingAngle(playerid, random(360));
			SetPlayerColor(playerid, 0x32CD32AA);
            return 1;
}
Help
Reply
#2

Can anyone help me ?
Reply
#3

pawn Код:
switch(glob0[playerid])
    {
    case 1:
        {
        SetPlayerPos(playerid, -2787.6155 + random(66), -294.2366 + random(8), 7.0399);
        SetPlayerFacingAngle(playerid, random(360)); // Line 130
        SetPlayerColor(playerid, 0x87CEEBAA);
        SetPlayerPos(playerid, 1672.6181 + random(23), 1440.2609 + random(15), 10.7791);
        SetPlayerFacingAngle(playerid, random(360));
        SetPlayerColor(playerid, 0xFF0000AA);
        SetPlayerPos(playerid, -1639.0776 + random(66), 655.8917 + random(14), 7.1901);
        SetPlayerFacingAngle(playerid, random(360));
        SetPlayerColor(playerid, 0x0000FFAA);
        SetPlayerPos(playerid, 2471.2419 + random(36), -1684.1921 + random(30), 13.5459);
        SetPlayerFacingAngle(playerid, random(360));
        SetPlayerColor(playerid, 0x32CD32AA);
        return 1;
        }
    }
You have to use opening ( { ) and closing ( } ) brackets at a case, else it gives you errors.

Jesse
Reply
#4

Thanks for the code but , i got 12 errors after i paste the code
Reply
#5

The '12 errors' please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)