Advertisement
Adoniiz

FPS v0.2

Nov 6th, 2011
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. /////////////////////////////////////////////////////////////////////////////////////
  2. // Creditos: //
  3. // By Adoniiz/AdonisxD, JerneiL y the_chaoz por darme la idea de su inc, callbackz.//
  4. /////////////////////////////////////////////////////////////////////////////////////
  5.  
  6. #include <a_samp>
  7. #pragma tabsize 0
  8. #define Blanco 0xFFFFFFFF
  9. #define Rojo 0xFF0000FF
  10.  
  11. new VerFPS[MAX_PLAYERS];
  12. new VarFPS;
  13. new pDrunkLevelLast[MAX_PLAYERS];
  14. new pFPS[MAX_PLAYERS];
  15. new Text:FPS[MAX_PLAYERS];
  16. forward ActFPS(playerid);
  17.  
  18. public OnFilterScriptInit()
  19. {
  20. print("\n\n -------------------------------");
  21. print(" | FPS 0.1 By Adoniiz/AdonisxD |");
  22. print(" -------------------------------\n");
  23. for(new playerid = 0; playerid < GetMaxPlayers(); playerid ++)
  24. {
  25. FPS[playerid] = TextDrawCreate(596.000000, 0.000000, "_");
  26. TextDrawBackgroundColor(FPS[playerid], 255);
  27. TextDrawFont(FPS[playerid], 3);
  28. TextDrawLetterSize(FPS[playerid], 0.669999, 1.900000);
  29. TextDrawColor(FPS[playerid], -65281);
  30. TextDrawSetOutline(FPS[playerid], 0);
  31. TextDrawSetProportional(FPS[playerid], 1);
  32. TextDrawSetShadow(FPS[playerid], 1);
  33. }
  34. return 1;
  35. }
  36.  
  37. public OnFilterScriptExit()
  38. {
  39. return 1;
  40. }
  41.  
  42. main()
  43. {
  44. print("\n\n--------------------------");
  45. print("FPS 0.1 By Adoniiz/AdonisxD");
  46. print("--------------------------\n");
  47. }
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51. VerFPS[playerid] = 0;
  52. return 1;
  53. }
  54.  
  55. public OnPlayerDisconnect(playerid, reason)
  56. {
  57. VerFPS[playerid] = 0;
  58. return 1;
  59. }
  60.  
  61. public OnPlayerCommandText(playerid, cmdtext[])
  62. {
  63. if(!strcmp(cmdtext, "/fps", true) || !strcmp(cmdtext, "/verfps", true))
  64. {
  65. if(VerFPS[playerid] == 0)
  66. {
  67. VarFPS = SetTimerEx("ActFPS", 500, true, "i",playerid);
  68. SendClientMessage(playerid, Blanco, "{0094FF}[>] {FFFFFF}Has activado los FPS, para verlos mira arriba en la parte superior derecha y veras unas numeros {FFD800}amarillos");
  69. VerFPS[playerid] = 1;
  70. }
  71. else if(VerFPS[playerid] == 1)
  72. {
  73. KillTimer(VarFPS);
  74. VerFPS[playerid] = 0;
  75. TextDrawHideForPlayer(playerid, FPS[playerid]);
  76. SendClientMessage(playerid, Rojo,"Has desactivado los FPS");
  77. }
  78. return 1;
  79. }
  80. return 0;
  81. }
  82.  
  83. public OnPlayerUpdate(playerid)
  84. {
  85. new drunknew;
  86. drunknew = GetPlayerDrunkLevel(playerid);
  87.  
  88. if (drunknew < 100) { // go back up, keep cycling.
  89. SetPlayerDrunkLevel(playerid, 2000);
  90. } else {
  91.  
  92. if (pDrunkLevelLast[playerid] != drunknew) {
  93.  
  94. new wfps = pDrunkLevelLast[playerid] - drunknew;
  95.  
  96. if ((wfps > 0) && (wfps < 200))
  97. pFPS[playerid] = wfps;
  98.  
  99. pDrunkLevelLast[playerid] = drunknew;
  100. }
  101.  
  102. }
  103. return 1;
  104. }
  105. public ActFPS(playerid)
  106. {
  107. new string[128];
  108. format(string, sizeof(string), "%i",GetPlayerFPS(playerid));
  109. TextDrawSetString(FPS[playerid], string);
  110. TextDrawShowForPlayer(playerid, FPS[playerid]);
  111. return 1;
  112. }
  113. stock GetPlayerFPS(playerid) return pFPS[playerid];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement