Have a problem mabey you can help.... - 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: Have a problem mabey you can help.... (
/showthread.php?tid=203299)
Have a problem maybe you can help.... -
trapped1 - 26.12.2010
Код:
\samp03csvr_RC7_win32\gamemodes\penls.pwn(3692) : error 002: only a single statement (or expression) can follow each "case"
\samp03csvr_RC7_win32\gamemodes\penls.pwn(3692) : error 029: invalid expression, assumed zero
\samp03csvr_RC7_win32\gamemodes\penls.pwn(3692) : warning 215: expression has no effect
\samp03csvr_RC7_win32\gamemodes\penls.pwn(3692) : error 017: undefined symbol "i"
\samp03csvr_RC7_win32\gamemodes\penls.pwn(3692) : fatal error 107: too many error messages on one line
code line
Код:
case 10:
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (!IsPlayerInVehicle(i, stealcar))
{
SetAllPlayerCheckpoint(cwx, cwy, cwz, 16.0, 255);
SetVehicleParamsForPlayer(stealcar,i,1,0);
}
}
}
return 1;
}
for(new i = 0; i <= MAX_PLAYERS; i++) //code error line
{
if(IsPlayerConnected(i))
{
if (!IsPlayerInVehicle(i, stealcar))
{
SetPlayerCheckpoint(i,scx, scy, scz,5.0 );
SetVehicleParamsForPlayer(stealcar,i,1,0);
}
//SetAllPlayerCheckpoint(scx, scy, scz, 16.0, 255);
}
}
return 1;
}
Re: Have a problem mabey you can help.... -
JaTochNietDan - 26.12.2010
It looks like it is part of a switch statement, but not under a specific case, are you sure the rest of the syntax is correct? Also it should not be <= MAX_PLAYERS, unless you're using a custom MAX_PLAYERS value. As MAX_PLAYERS is 500 and ID 500 is never used in SA-MP, that is why we always do < MAX_PLAYERS.
Also as the error says, you can only have one statement or expression in a case, so you'll need to work around that also.
Re: Have a problem mabey you can help.... -
trapped1 - 26.12.2010
Thanks for your replay I changed <MAX_PLAYERS and yeah maybe the case is fu**ed up idk really just need help.. If some one can help me...
Re: Have a problem mabey you can help.... -
Babul - 26.12.2010
Код:
case 10:
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if (!IsPlayerInVehicle(i,stealcar))
{
SetAllPlayerCheckpoint(cwx,cwy,cwz,16.0,255);
SetVehicleParamsForPlayer(stealcar,i,1,0);
}
}
}
return 1;
}//case 10 closed. b) moving this line (bracket only) right before the return 1; would help aswell
//case 11: missing, there cant be a for(){} loop in a switch(){}, unless you place it in a case:{}
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if (!IsPlayerInVehicle(i, stealcar))
{//since its obvious that those 2 loops are showing 1 checkpoint to each player, i dont think they should be both in the same case 10:. add that case 11: mentioned above
SetPlayerCheckpoint(i,scx, scy, scz,5.0 );
SetVehicleParamsForPlayer(stealcar,i,1,0);
}
//SetAllPlayerCheckpoint(scx, scy, scz, 16.0, 255);
}
}
return 1;
Re: Have a problem mabey you can help.... -
trapped1 - 26.12.2010
It dosnt work sorry..
But thanks for the help.. If I do case 11: it gives me a new errors