OnPlayerSelectedMenuRow Errors
#1

I have a script for my server, but every time I try to complie it, I get errors. There are a few 'case' above it, and when I remove this case (5) I don't get errors. I simply added this
below them, and I got errors...

pawn Код:
case 5: // Garbage Man
{
GameTextForPlayer(playerid, "~w~You are now a Garbage Man!~N~Type ~R~/job ~W~for more information", 5000, 3);
PlayerInfo[playerid][pJob] = 7;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
for(new i=0;i<MAX_VEHICLES;i++)
{
if(IsAGarbage(i))
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
}
and the errors...

Код:
C:\Users\Lachlan\p.pwn(27541) : error 014: invalid statement; not in switch
C:\Users\Lachlan\p.pwn(27541) : warning 215: expression has no effect
C:\Users\Lachlan\p.pwn(27541) : error 001: expected token: ";", but found ":"
C:\Users\Lachlan\p.pwn(27541) : error 029: invalid expression, assumed zero
C:\Users\Lachlan\p.pwn(27541) : fatal error 107: too many error messages on one line
To view the full OnPlayerSelectedMenuRow, click HERE

Help would be GREATLY appreciated! Thankyou.
Reply
#2

the 2 closing brackets } at line 78 and 79 are closing the loop where the case5 should be inserted.
cut 2 lines out and paste them behind the case 5, then you will get this ending:
Код:
case 4: //Helicopter Transporter
{
GameTextForPlayer(playerid, "~w~You are now a Heli Transporter!~N~Type ~R~/job ~W~for more information", 5000, 3);
PlayerInfo[playerid][pJob] = 6;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
for(new i=0;i<MAX_VEHICLES;i++)
{
if(IsACargobob(i))
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
}
case 5: // Garbage Man
{
GameTextForPlayer(playerid, "~w~You are now a Garbage Man!~N~Type ~R~/job ~W~for more information", 5000, 3);
PlayerInfo[playerid][pJob] = 7;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
for(new i=0;i<MAX_VEHICLES;i++)
{
if(IsAGarbage(i))
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
}
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)