how can i make a ip limit ? pls help !
#6

put this somewhere outside of any publics in ur script:

Код:
stock GetNumberOfPlayersOnThisIP(test_ip[])
{
	new against_ip[32+1];
	new x = 0;
	new ip_count = 0;
	for(x=0; x<MAX_PLAYERS; x++) {
		if(IsPlayerConnected(x)) {
		    GetPlayerIp(x,against_ip,32);
		    if(!strcmp(against_ip,test_ip)) ip_count++;
		}
	}
	return ip_count;
}
replace that line:
Код:
for(x=0; x<MAX_PLAYERS; x++) {
with:
Код:
for(new x, m = GetMaxPlayers(); x<m; x++) {
for a better loop
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)