SA-MP Forums Archive
OnPlayerSelectedMenuRow Errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerSelectedMenuRow Errors (/showthread.php?tid=143491)



OnPlayerSelectedMenuRow Errors - sexybeast - 23.04.2010

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.


Re: OnPlayerSelectedMenuRow Errors - Babul - 23.04.2010

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);
}
}
}
}
}