Variables store.
#1

Hi,

Ex: i store in variable that values:

78.4564
79.9.5
9.549
79.9.5
3.54.9
79.9.5
3.54.9

I want to do cikle or what threw that variables, and check is there more than 2 variables same than something happin...

I want to do IP protection, from mass ip. Just i want save player ip in variable, and then check how much there is ips in that variables.

new STOREIPADDRES[ 1000 ][ 20 ];
new GetPlayerIpEx[ MAX_PLAYERS ][ 25 ];

GetPlayerIp( playerid, GetPlayerIpEx[ playerid ], MAX_PLAYER_NAME );
Код:
for( IPCIKLEX[ playerid ] = 0; IPCIKLEX[ playerid ] < 999; IPCIKLEX[ playerid ] ++ )
 	{
 	    if( isnull( STORESIPADDRES[ IPCIKLEX[ playerid ] ] ) )
		{
 	    	strmid(STORESIPADDRES[ IPCIKLEX[ playerid ] ],GetPlayerIpEx[ playerid ],0,20,20);
 	    	break;
 	    }
 	}
Reply
#2

you can't save into a variable/float any ip, use a string and compare them
Reply
#3

Код:
GetPlayerIp( playerid, GetPlayerIpEx[ playerid ], MAX_PLAYER_NAME );

   
 	for( IPCIKLEX[ playerid ] = 0; IPCIKLEX[ playerid ] < 100; IPCIKLEX[ playerid ] ++ )
 	{
 	    if( !strcmp(STORESIPADDRES[ IPCIKLEX[ playerid ] ],"no",true ) ) //Ar zaidejas namo savininkas
		{
 	    	strmid(STORESIPADDRES[ IPCIKLEX[ playerid ] ],GetPlayerIpEx[ playerid ],0,20,20);
 	    	break;
 	    }
 	}
 	for( IPCIKLEX[ playerid ] = 0; IPCIKLEX[ playerid ] < 100; IPCIKLEX[ playerid ] ++ )
 	{
 	    for( IPCIKLEX2[ playerid ] = 0; IPCIKLEX2[ playerid ] < 300; IPCIKLEX2[ playerid ] ++ )
 		{
 	    	if( !strcmp(STORESIPADDRES[ IPCIKLEX[ playerid ] ],STORESIPADDRES[ IPCIKLEX2[ playerid ] ],true ) ) //Ar zaidejas namo savininkas
			{
			    COUNTIPS[ IPCIKLEX[ playerid ] ] ++;
			}
		}
	}
 	for( IPCIKLEX[ playerid ] = 0; IPCIKLEX[ playerid ] < 100; IPCIKLEX[ playerid ] ++ )
 	{
 	    if( COUNTIPS[ IPCIKLEX[ playerid ] ] > 3 )
 	    {
 	        new BANIP[ 50 ];
 	        format(BANIP,50,"banip %s",GetPlayerIpEx[ playerid ] );
 	        SendRconCommand(BANIP);
 	    }
 	}
What bad in this code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)