Advertisement
IgorLuiz

[IG]Status

Jul 22nd, 2015
1,254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.37 KB | None | 0 0
  1. /*--------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. ############################################################|| Filterscript By: Igor Luiz ||####################################################################
  3. ###############################################################||Estradeiros Truck Server||#####################################################################
  4. ###################################################################||198.15.64.3:7789||#########################################################################
  5. --------------------------------------------------------------------------------------------------------------------------------------------------------------*/
  6. // Includes
  7. #include <a_samp>
  8. #include <zcmd>
  9. // Forwards
  10. forward Atualizar(playerid);
  11. forward IGJogadores();
  12. // Defines as TextDraws
  13. new
  14. PlayerText:IGStatus[MAX_PLAYERS][5],
  15. bool:Status[MAX_PLAYERS]
  16. ;
  17. // Define DrunkLevelLastt
  18. new DrunkLevelLastt[MAX_PLAYERS], FPS[MAX_PLAYERS];
  19.  
  20. CMD:status(playerid){
  21. if(!Status[playerid]){
  22. Status[playerid] = true;
  23. PlayerTextDrawHide(playerid, PlayerText:IGStatus[0][playerid]);
  24. PlayerTextDrawHide(playerid, PlayerText:IGStatus[1][playerid]);
  25. PlayerTextDrawHide(playerid, PlayerText:IGStatus[2][playerid]);
  26. PlayerTextDrawHide(playerid, PlayerText:IGStatus[3][playerid]);
  27. GameTextForPlayer(playerid, "~w~~h~Status: ~r~~h~Desativado~w~~h~.", 2000, 4);
  28. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
  29. }
  30. else
  31. {
  32. Status[playerid] = false;
  33. PlayerTextDrawShow(playerid, PlayerText:IGStatus[0][playerid]);
  34. PlayerTextDrawShow(playerid, PlayerText:IGStatus[1][playerid]);
  35. PlayerTextDrawShow(playerid, PlayerText:IGStatus[2][playerid]);
  36. PlayerTextDrawShow(playerid, PlayerText:IGStatus[3][playerid]);
  37. GameTextForPlayer(playerid, "~w~~h~Status: ~g~~h~Ativado~w~~h~.", 2000, 4);
  38. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  39. }
  40. return 1;
  41. }
  42. // Public
  43. public OnFilterScriptInit(){
  44. print("-----------------------------------");
  45. print(" |FS| IG'Status Ativado | 2015 |");
  46. print("-----------------------------------");
  47. return 1;
  48. }
  49. // Public
  50. public OnFilterScriptExit(){
  51. print("-----------------------------------");
  52. print(" |FS| IG'Status Desativado");
  53. print("----------------------------------");
  54. return 1;
  55. }
  56. // Public
  57. public OnPlayerConnect(playerid){
  58. SetTimerEx("Atualizar",1000,true,"i", playerid);
  59. Status[playerid] = false;
  60. IGStatus[0][playerid] = CreatePlayerTextDraw(playerid,145.000000,347.000000,"_");
  61. IGStatus[1][playerid] = CreatePlayerTextDraw(playerid,200.000000,333.000000,".");
  62. IGStatus[2][playerid] = CreatePlayerTextDraw(playerid,145.000000,414.000000,".");
  63. IGStatus[3][playerid] = CreatePlayerTextDraw(playerid,154.000000,332.000000,"STATUS");
  64. PlayerTextDrawUseBox(playerid, IGStatus[0][playerid],1);
  65. PlayerTextDrawBoxColor(playerid, IGStatus[0][playerid],0x00000066);
  66. PlayerTextDrawTextSize(playerid, IGStatus[0][playerid],196.000000,14.000000);
  67. PlayerTextDrawUseBox(playerid, IGStatus[1][playerid],1);
  68. PlayerTextDrawBoxColor(playerid, IGStatus[1][playerid],0x000000ff);
  69. PlayerTextDrawTextSize(playerid, IGStatus[1][playerid],141.000000,24.000000);
  70. PlayerTextDrawUseBox(playerid, IGStatus[2][playerid],1);
  71. PlayerTextDrawBoxColor(playerid, IGStatus[2][playerid],0x000000ff);
  72. PlayerTextDrawTextSize(playerid, IGStatus[2][playerid],196.000000,4.000000);
  73. PlayerTextDrawAlignment(playerid, IGStatus[0][playerid],0);
  74. PlayerTextDrawAlignment(playerid, IGStatus[1][playerid],0);
  75. PlayerTextDrawAlignment(playerid, IGStatus[2][playerid],0);
  76. PlayerTextDrawAlignment(playerid, IGStatus[3][playerid],0);
  77. PlayerTextDrawBackgroundColor(playerid, IGStatus[0][playerid],0xffffffff);
  78. PlayerTextDrawBackgroundColor(playerid, IGStatus[1][playerid],0x000000ff);
  79. PlayerTextDrawBackgroundColor(playerid, IGStatus[2][playerid],0x000000ff);
  80. PlayerTextDrawBackgroundColor(playerid, IGStatus[3][playerid],0x000000ff);
  81. PlayerTextDrawFont(playerid, IGStatus[0][playerid],2);
  82. PlayerTextDrawLetterSize(playerid, IGStatus[0][playerid],0.199999,1.400000);
  83. PlayerTextDrawFont(playerid, IGStatus[1][playerid],3);
  84. PlayerTextDrawLetterSize(playerid, IGStatus[1][playerid],-0.000000,1.000000);
  85. PlayerTextDrawFont(playerid, IGStatus[2][playerid],3);
  86. PlayerTextDrawLetterSize(playerid, IGStatus[2][playerid],-0.000000,-0.200000);
  87. PlayerTextDrawFont(playerid, IGStatus[3][playerid],2);
  88. PlayerTextDrawLetterSize(playerid, IGStatus[3][playerid],0.199999,1.000000);
  89. PlayerTextDrawColor(playerid, IGStatus[0][playerid],0xffffffff);
  90. PlayerTextDrawColor(playerid, IGStatus[1][playerid],0xffffffff);
  91. PlayerTextDrawColor(playerid, IGStatus[2][playerid],0xffffffff);
  92. PlayerTextDrawColor(playerid, IGStatus[3][playerid],0xffffffff);
  93. PlayerTextDrawSetOutline(playerid, IGStatus[1][playerid],1);
  94. PlayerTextDrawSetOutline(playerid, IGStatus[2][playerid],1);
  95. PlayerTextDrawSetProportional(playerid, IGStatus[0][playerid],1);
  96. PlayerTextDrawSetProportional(playerid, IGStatus[1][playerid],1);
  97. PlayerTextDrawSetProportional(playerid, IGStatus[2][playerid],1);
  98. PlayerTextDrawSetProportional(playerid, IGStatus[3][playerid],1);
  99. PlayerTextDrawSetShadow(playerid, IGStatus[0][playerid],0);
  100. PlayerTextDrawSetShadow(playerid, IGStatus[2][playerid],0);
  101. return 1;
  102. }
  103. // Public
  104. public OnPlayerSpawn(playerid){
  105. Atualizar(playerid);
  106. if(!Status[playerid]){
  107. PlayerTextDrawShow(playerid, PlayerText:IGStatus[0][playerid]);
  108. PlayerTextDrawShow(playerid, PlayerText:IGStatus[1][playerid]);
  109. PlayerTextDrawShow(playerid, PlayerText:IGStatus[2][playerid]);
  110. PlayerTextDrawShow(playerid, PlayerText:IGStatus[3][playerid]);
  111. }
  112. else
  113. SendClientMessage(playerid, -1, "{ffffff}|IG| {ff0000}Seu status se encontra desativado, digite {ffffff}/status {ff0000}para ativa-lo novamente.");
  114. return 1;
  115. }
  116. // Public
  117. public OnPlayerRequestClass(playerid, classid){
  118. PlayerTextDrawHide(playerid, PlayerText:IGStatus[0][playerid]);
  119. PlayerTextDrawHide(playerid, PlayerText:IGStatus[1][playerid]);
  120. PlayerTextDrawHide(playerid, PlayerText:IGStatus[2][playerid]);
  121. PlayerTextDrawHide(playerid, PlayerText:IGStatus[3][playerid]);
  122. return 1;
  123. }
  124. // Public
  125. public OnPlayerDeath(playerid, killerid, reason){
  126. PlayerTextDrawHide(playerid, PlayerText:IGStatus[0][playerid]);
  127. PlayerTextDrawHide(playerid, PlayerText:IGStatus[1][playerid]);
  128. PlayerTextDrawHide(playerid, PlayerText:IGStatus[2][playerid]);
  129. PlayerTextDrawHide(playerid, PlayerText:IGStatus[3][playerid]);
  130. return 1;
  131. }
  132. // Public
  133. public OnPlayerUpdate(playerid){
  134. new drunknew = GetPlayerDrunkLevel(playerid);
  135. if(drunknew < 100) return SetPlayerDrunkLevel(playerid, 2000);
  136. else
  137. {
  138. if (DrunkLevelLastt[playerid] != drunknew){
  139. new IGfps = DrunkLevelLastt[playerid] - drunknew;
  140. if ((IGfps > 0) && (IGfps < 200)) FPS[playerid] = IGfps;
  141. DrunkLevelLastt[playerid] = drunknew;
  142. }
  143. }
  144. return 1;
  145. }
  146. // Public que ira atualizar seus scores,ping,fps e a quantia de jogadores
  147. public Atualizar(playerid){
  148. new Format[128];
  149. format(Format, sizeof(Format), "~g~Score: ~w~%d~n~~g~Ping: ~w~%d~n~~g~Fps: ~w~%d~n~~g~Jogadores~n~~w~ %d/%d", GetPlayerScore(playerid), GetPlayerPing(playerid), FPS[playerid], IGJogadores(), GetMaxPlayers());
  150. PlayerTextDrawSetString(playerid, IGStatus[0][playerid], Format);
  151. return true;
  152. }
  153. // Public que ira contar os jogadores do servidor
  154. public IGJogadores(){
  155. new Jogadores = 0;
  156. for(new i = 0; i < MAX_PLAYERS; i++){
  157. if(IsPlayerConnected(i) && !IsPlayerNPC(i)){
  158. Jogadores++;
  159. }
  160. }
  161. return Jogadores;
  162. }
  163. // Stock
  164. stock GetPlayerFPS(playerid)
  165. {
  166. SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
  167. if(GetPVarInt(playerid, "DrunkL") < 100){
  168. SetPlayerDrunkLevel(playerid, 2000);
  169. }
  170. else
  171. {
  172. if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL")){
  173. SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
  174. SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
  175. if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256)){
  176. return GetPVarInt(playerid, "FPS") - 1;
  177. }
  178. }
  179. }
  180. return 0;
  181. }
  182. /*------------------------------------------------------------------------------------------------------------------------------------------------------------
  183. ################################################################||Estradeiros Truck Server||##################################################################
  184. ######################################################||Facebook: www.facebook.com/igor.luiz.7773||###########################################################
  185. #################################################################||Skype: Igor.luiz122||######################################################################
  186. -------------------------------------------------------------------------------------------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement