Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- public OnPlayerConnect(playerid)
- {
- if((GetTickCount()-GetPVarInt(playerid, "ConnectionTime")) < 200 && CountIP(PlayerIP(playerid)) >= 5)
- {
- Ban(playerid);
- }
- SetPVarInt(playerid, "ConnectionTime", GetTickCount());
- return 1;
- }
- CountIP(ip[])
- {
- new countip;
- for(new i = 0; i < GetMaxPlayers(); i++)
- if(IsPlayerConnected(i) && !strcmp(PlayerIP(i),ip))
- countip++;
- return countip;
- }
- PlayerIP(playerid)
- {
- new ip[16];
- GetPlayerIp(playerid,ip,sizeof(ip));
- return ip;
- }
Advertisement
Add Comment
Please, Sign In to add comment