Advertisement
Guest User

GetPlayerFPS SA:MP

a guest
Mar 21st, 2019
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.46 KB | None | 0 0
  1. /*  SA-MP FPS Include
  2.  *
  3.  *  (c) Copyright 2019, Kaliber
  4.  *
  5.  */
  6. /******************************************************************************/
  7. /*
  8.     native GetPlayerFPS(playerid);
  9. */
  10. /******************************************************************************/
  11. #if defined _fps_included
  12.     #endinput
  13. #endif
  14. #define _fps_included
  15. /******************************************************************************/
  16. #if !defined _samp_included
  17.     #include <a_samp>
  18. #endif
  19. /******************************************************************************/
  20. #define fps_Hook:: _fps@_
  21. /******************************************************************************/
  22. #define GetPlayerFPS(%0) public_fps{%0}
  23. /******************************************************************************/
  24. #if defined FILTERSCRIPT
  25.     public OnFilterScriptInit()
  26.     {
  27.         SetTimer(!"@fps",251,1);
  28.         #if defined _fps@_OnFilterScriptInit
  29.             return fps_Hook::OnFilterScriptInit();
  30.         #else
  31.             return 1;
  32.         #endif
  33.     }
  34.     #if defined _fps@_OnFilterScriptInit
  35.         forward fps_Hook::OnFilterScriptInit();
  36.     #endif
  37.     #if defined _ALS_OnFilterScriptInit
  38.         #undef OnFilterScriptInit
  39.     #else
  40.         #define _ALS_OnFilterScriptInit
  41.     #endif
  42.     #define OnFilterScriptInit _fps@_OnFilterScriptInit
  43. #else
  44.     public OnGameModeInit()
  45.     {
  46.         SetTimer(!"@fps",251,1);
  47.         #if defined _fps@_OnGameModeInit
  48.             return fps_Hook::OnGameModeInit();
  49.         #else
  50.             return 1;
  51.         #endif
  52.     }
  53.     #if defined _fps@_OnGameModeInit
  54.         forward fps_Hook::OnGameModeInit();
  55.     #endif
  56.     #if defined _ALS_OnGameModeInit
  57.         #undef OnGameModeInit
  58.     #else
  59.         #define _ALS_OnGameModeInit
  60.     #endif
  61.     #define OnGameModeInit _fps@_OnGameModeInit
  62. #endif
  63. /******************************************************************************/
  64. new public_fps[MAX_PLAYERS char];
  65. /******************************************************************************/
  66. static drunk[MAX_PLAYERS];
  67. /******************************************************************************/
  68. static @fps();@fps()
  69. {
  70.     for(new i=GetPlayerPoolSize(),d,fps; i!=-1; i--)
  71.     {
  72.         d = GetPlayerDrunkLevel(i);
  73.         if(d < 100) SetPlayerDrunkLevel(i,2000);
  74.         else
  75.         {
  76.             fps = drunk[i]-d;
  77.             if(fps > 0) public_fps{i} = fps;
  78.             drunk[i] = d;
  79.         }
  80.     }
  81.     return 1;
  82. }
  83. /******************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement