Advertisement
FamiliaSAMP

FILTERSCRIPT - IG'S STATUS [FAMILIASAMP.COM]

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