Advertisement
MichaelFR

Ping Anticheat

Jan 7th, 2017
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. /* Credits: Michael*/
  2. #include <a_samp>
  3. #include <foreach>
  4. #include <YSI\y_timers>
  5. #define Sec(%0)                 (( %0 ) * ( 1000 ))
  6. public OnFilterScriptInit() { return 1; }
  7. public OnFilterScriptExit() { return 1; }
  8.  
  9. stock PlayerName(playerid)
  10. {
  11.     new pName[MAX_PLAYER_NAME];
  12.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  13.     return pName;
  14. }
  15.  
  16. task PingProvjera[Sec(3)]()
  17. {
  18.     foreach (Player, i)
  19.     {
  20.     new string[128],ping,virtual;
  21.     ping = GetPlayerPing(i);
  22.     virtual = GetPlayerVirtualWorld(i);
  23.     if(ping == 65535) return 1;//izbjegavanje pinga na connectu(ne dirajte)
  24.     if(ping > 250)//izbacuje text ako prelazi napisan ping(promjenite 250 po volji ako zelite)
  25.     {
  26.     //Ovdje dodati ako zelite po svojoj zelji nesto tipa ako je igrac u waru na eventu itd..
  27.  
  28.     format(string,sizeof(string),"[PingAC] Igrac %s[ID:%d] Ima prevelik ping! [%d]",PlayerName(i),i,ping);
  29.     SendClientMessageToAll(-1,string);
  30.     }
  31.     }
  32.     return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement