SHARE
TWEET

Untitled

Dravizz Apr 11th, 2020 166 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ****** data/playerDB.txt ******
  2.  
  3.     Float:ArmourPlayer,
  4.     Float:HealthPlayer,
  5.     HealthCheck,
  6.  
  7.  
  8. ****** GM PRADŽIOJE ******
  9.  
  10. stock SetPlayerHealthEx(playerid, Float:health)
  11. {
  12.     playerDB[playerid][HealthCheck] = gettime() + 5;
  13.     playerDB[playerid][HealthPlayer] = health;
  14.     return SetPlayerHealth(playerid, health);
  15. }
  16. stock SetPlayerArmourEx(playerid, Float:health)
  17. {
  18.     playerDB[playerid][HealthCheck] = gettime() + 5;
  19.     playerDB[playerid][ArmourPlayer] = health;
  20.     return SetPlayerArmour(playerid, health);
  21. }
  22.  
  23. ****** OnPlayerDeath ******
  24.  
  25. playerDB[playerid][HealthCheck]= -5;
  26.  
  27. ****** OnPlayerSpawn ******
  28.  
  29. playerDB[playerid][HealthCheck]= gettime() +5;
  30.  
  31. ****** public Clear ******
  32.  
  33.     playerDB[playerid][HealthCheck] = -5;
  34.     playerDB[playerid][HealthPlayer] = 100.0;
  35.     playerDB[playerid][ArmourPlayer] = 0.0;
  36.    
  37. ****** public SavePlayerData ******
  38.  
  39.     if(HP > playerDB[playerid][HealthPlayer]) { HP = playerDB[playerid][HealthPlayer]; }
  40.     if(ARM > playerDB[playerid][ArmourPlayer]) { ARM = playerDB[playerid][ArmourPlayer]; }
  41.    
  42.    
  43. ******  SEKUNDINIAME TIMERYJE ******
  44.  
  45.         if((playerDB[i][HealthCheck] < gettime() && playerDB[i][HealthCheck] != -5) && playerDB[i][AFK_Time] < 1)
  46.         {
  47.             new Float:aa, Float:bb;
  48.             GetPlayerHealth(i, aa);
  49.             GetPlayerArmour(i, bb);
  50.             if(aa > playerDB[i][HealthPlayer])
  51.             {
  52.                 new msg[200];
  53.                 format(msg, sizeof(msg), "[ANTICHEAT] %s {ffffff}buvo išmestas už nelegalų pasigydymą.", GetPlayerNameEx(i));
  54.                 SendClientMessageToAll(RED, msg);
  55.                 printf("[HEAL] %s buvo išmestas už čytus", GetPlayerNameEx(i));
  56.                 SetPlayerHealth(i, playerDB[i][HealthPlayer]);
  57.             }
  58.             else
  59.             {
  60.                 playerDB[i][HealthPlayer] = aa;
  61.             }
  62.             if(bb > playerDB[i][ArmourPlayer])
  63.             {
  64.                 new msg[200];
  65.                 format(msg, sizeof(msg), "[ANTICHEAT] %s {ffffff}buvo išmestas už nelegalų pasigydymą.", GetPlayerNameEx(i));
  66.                 SendClientMessageToAll(RED, msg);
  67.                 printf("[ARMOUR] %s buvo išmestas už čytus", GetPlayerNameEx(i));
  68.                 SetPlayerArmour(i, playerDB[i][ArmourPlayer]);
  69.             }
  70.             else
  71.             {
  72.                 playerDB[i][ArmourPlayer] = bb;
  73.             }
  74.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top