Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MAX_CONNECT_IN_ROW 3
- #define MAX_REJOIN_TIME 4000
- new ipCheck[25], IPfound, IPtime;
- public OnPlayerConnect(playerid)
- {
- new pIP[25];
- GetPlayerIp(playerid, pIP, 25);
- if(strcmp(ipCheck, pIP, false) == 0 && ( GetTickCount() - IPtime ) < MAX_REJOIN_TIME )
- {
- IPfound++;
- if(IPfound > MAX_CONNECT_IN_ROW)
- {
- new str[100];
- format(str, 100, "banip %s", pIP);
- SendRconCommand(str);
- Kick(playerid);
- IPfound=0;
- }
- }
- else
- {
- IPfound=0;
- }
- format(ipCheck, 25, "%s", pIP);
- IPtime=GetTickCount();
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment