Have a problem mabey you can help....
#1

Код:
\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;
        }
Reply
#2

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.
Reply
#3

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...
Reply
#4

Код:
		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;
Reply
#5

It dosnt work sorry.. But thanks for the help.. If I do case 11: it gives me a new errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)