Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define LIMIT_IP 3
- public OnPlayerConnect( playerid )
- {
- IgracIP[16];
- GetPlayerIp( playerid, IgracIP, 4 );
- if ( GetNumberOfPlayersOnThisIP( IgracIP ) > LIMIT_IP )
- {
- new string[75];
- format( string, 75, "Igrac %s je izbacen sa servera. [Moguce povezivanje botova])", GetName( playerid ) );
- SCMToAll( -1, string );
- Kick(playerid);
- return 1;
- }
- return 1;
- }
- stock GetNumberOfPlayersOnThisIP( test_ip[ ] )
- {
- new against_ip[ 16 ], ip_count = 0;
- foreach(new x: Player)
- {
- GetPlayerIp( x, against_ip, 16 );
- if( !strcmp( against_ip, test_ip ) )
- ip_count++;
- }
- return ip_count;
- }
Advertisement
Add Comment
Please, Sign In to add comment