Problem with system
#1

Hi.

I have a problem with my system pls check it.

Код:
public PingKick()
{
	if(ServerInfo[MaxPing] != 0)
	{
	    PingPos++;
        PingPos %= PING_MAX_EXCEEDS;
		foreach (new i : Player) {
		  if(IsPlayerConnected(i)) {
			PlayerInfo[i][pPing][PingPos] = GetPlayerPing(i);

		    if(GetPlayerPing(i) > ServerInfo[MaxPing])
			{
				if(PlayerInfo[i][PingCount] == 0) PlayerInfo[i][PingTime] = TimeStamp();

	   			PlayerInfo[i][PingCount]++;
				if(TimeStamp() - PlayerInfo[i][PingTime] > PING_TIMELIMIT)
				{
	    			PlayerInfo[i][PingTime] = TimeStamp();
					PlayerInfo[i][PingCount] = 1;
				}
				else if(PlayerInfo[i][PingCount] >= PING_MAX_EXCEEDS)
				{
				    new Sum, Average, x, string[128];
					while (x < PING_MAX_EXCEEDS) {
						Sum += PlayerInfo[i][pPing][x];
						x++;
					}
					Average = (Sum / PING_MAX_EXCEEDS);
					format(string,sizeof(string),"%s has been kicked from the server. (Reason: High Ping (%d) | Average (%d) | Max Allowed (%d) )", pName(i), GetPlayerPing(i), Average, ServerInfo[MaxPing] );
  		    		SendClientMessageToAll(COLOR_GREY,string);
					SaveToFile("KickLog",string);
					SetTimerEx("kickplayer", 2000, false, "i",i);
				}
			}
		  }
		}
	}
}
The errors are

Код:
C:\Users\ўггелпт\Desktop\samp037_svr_R2-1-1_win32\samp037_svr_R2-1-1_win32\gamemodes\FDSTDMpwn(5264) : error 017: undefined symbol "foreach"
C:\Users\ўггелпт\Desktop\samp037_svr_R2-1-1_win32\samp037_svr_R2-1-1_win32\gamemodes\FDSTDMpwn(5264) : error 029: invalid expression, assumed zero
C:\Users\ўггелпт\Desktop\samp037_svr_R2-1-1_win32\samp037_svr_R2-1-1_win32\gamemodes\FDSTDM.pwn(5264) : error 017: undefined symbol "i"
C:\Users\ўггелпт\Desktop\samp037_svr_R2-1-1_win32\samp037_svr_R2-1-1_win32\gamemodes\FDSTDM.pwn(5264) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
i have already defined the #include <foreach> lel

Pls help !

Thx!!!
Reply
#2

u need to include foreach or YSI
Reply
#3

how ?

pls tell me
Reply
#4

And You can replace this with

OnPlayerUpdate Callback better than this long code

if the principal is kick after Ping +500

OnPlayerUpdate(playerid)
{
if(GetPlayerPing(playerid) == 500);
// SendClient Message bla blablabala
Kick(playerid);
return 1;
}
Reply
#5

if no replace just include

just download this https://github.com/Misiur/YSI-Includ...ive/YSI.tl.zip

and add this in u script #include <YSI/y_iterate>
Reply
#6

any other ideas?
Reply
#7

Use include y_iterate, or update your foreach.
Код:
#include <YSI\y_iterate> // This is a foreach
Reply
#8

thx ! +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)