Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Pkickas[MAX_PLAYERS];
- public OnGameModeInit()
- {
- SetTimer("AntiPing", 1000, true);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Pkickas[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- forward AntiPing(playerid);
- public AntiPing(playerid)
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerPing(i) > 400)
- {
- if(Pkickas[i] == 0)
- {
- Pkickas[i]++;
- SendClientMessage(i, -1, "[Serveris] Jūs gavote pirmajį įspėjimą. Prašome mažinti [PING]");
- }
- else if(Pkickas[i] == 1)
- {
- Pkickas[i]++;
- SendClientMessage(i, -1, "[Serveris] Jūs gavote antrajį įspėjimą. Prašome mažinti [PING]");
- }
- else if(Pkickas[i] == 2)
- {
- Pkickas[i]++;
- SendClientMessage(i, -1, "[Serveris] Jūs gavote trečiajį įspėjimą, ir esate išmestas iš serverio!");
- Kick(i);
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement