Advertisement
Silver_Dragon

GTA_SAMP: GetPlayerFPS

Apr 7th, 2015
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. new FPS[MAX_PLAYERS];
  2. new FPSCALC[MAX_PLAYERS];
  3. new FPSCALCALT[MAX_PLAYERS];
  4.  
  5.  
  6. stock GetPlayerFPS(playerid)
  7. {
  8. FPSCALC[playerid] = GetPlayerDrunkLevel(playerid);
  9. if(FPSCALC[playerid] < 100)
  10. {
  11. SetPlayerDrunkLevel(playerid,2000);
  12. }
  13. else if(FPSCALCALT[playerid] != FPSCALC[playerid])
  14. {
  15. FPS[playerid] = FPSCALCALT[playerid] - FPSCALC[playerid];
  16. FPSCALCALT[playerid] = FPSCALC[playerid];
  17.  
  18. if(FPS[playerid] > 0 && FPS[playerid] < 265)
  19. {
  20. return FPS[playerid] -= 1;
  21. }
  22. }
  23. return 0;
  24. }
  25.  
  26.  
  27. public OnPlayerUpdate(playerid)
  28. {
  29. GetPlayerFPS(playerid);
  30. return 1;
  31. }
  32.  
  33.  
  34. public OnPlayerCommandText(playerid, cmdtext[]) //%i not %.0f !!!
  35. {
  36. if(!strcmp(cmdtext, "/fps", true))
  37. {
  38. new string[128];
  39. format(string,sizeof(string),"FPS: %i",FPS[playerid]);// Use "FPS[ID]" not "GetPlayerFPS(id)"
  40. SendClientMessage(playerid,0xFFFFFFF,string);
  41. }
  42. return 1;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement