Guest User

Untitled

a guest
Dec 7th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.01 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4.  
  5. //FPS
  6. new TimerFPS[MAX_PLAYERS];
  7. new Text:FPS[MAX_PLAYERS];
  8. //PING
  9. new Text:PingT[MAX_PLAYERS];
  10. //TEXTDRAW INTRO
  11. new Text:LOGIN;
  12. new Text:LOGIN2;
  13. new Text:LOGIN3;
  14. //NICK
  15. new Text:SEUNICK;
  16. new Text:NICK;
  17. //PLAYERS ON
  18. new Text:TextDrawPlayers;
  19. new PlayersOnline = 0;
  20. //SCORE
  21. new ScoreTextDraw[MAX_PLAYERS];
  22.  
  23. public OnGameModeInit()
  24. {
  25. //PING
  26. for( new i = 0; i < MAX_PLAYERS; i++ )
  27. {
  28. PingT[ i ] = TextDrawCreate(499.000000, 104.000000, " ");
  29. TextDrawBackgroundColor(PingT[ i ], 255);
  30. TextDrawAlignment(PingT[ i ], 1);
  31. TextDrawFont(PingT[ i ], 2);
  32. TextDrawLetterSize(PingT[ i ], 0.270000, 2.200000);
  33. TextDrawUseBox(PingT[ i ], 0);
  34. TextDrawColor(PingT[ i ], -1);
  35. TextDrawSetOutline(PingT[ i ], 1);
  36. TextDrawSetProportional(PingT[ i ], 1);
  37. TextDrawSetShadow(PingT[ i ], 2);
  38. }
  39. //SCORE
  40. for(new i = 0; i <GetMaxPlayers(); i ++)
  41. {
  42. ScoreTextDraw[i] = TextDrawCreate(498.000000, 142.000000, " ");
  43. TextDrawBackgroundColor(ScoreTextDraw[i], 255);
  44. TextDrawFont(ScoreTextDraw[i], 2);
  45. TextDrawLetterSize(ScoreTextDraw[i], 0.270000, 2.200000);
  46. TextDrawColor(ScoreTextDraw[i], -1);
  47. TextDrawSetOutline(ScoreTextDraw[i], 1);
  48. TextDrawSetProportional(ScoreTextDraw[i], 1);
  49. TextDrawSetShadow(ScoreTextDraw[i], 1);
  50. }
  51. //TEXTDRAW INTRO
  52. LOGIN = TextDrawCreate(-30.000000, -5.000000, "TelaPreta");
  53. TextDrawBackgroundColor(LOGIN, 255);
  54. TextDrawFont(LOGIN, 1);
  55. TextDrawLetterSize(LOGIN, 0.700000, 53.099998);
  56. TextDrawColor(LOGIN, -1);
  57. TextDrawSetOutline(LOGIN, 0);
  58. TextDrawSetProportional(LOGIN, 1);
  59. TextDrawSetShadow(LOGIN, 1);
  60. TextDrawUseBox(LOGIN, 1);
  61. TextDrawBoxColor(LOGIN, 255);
  62. TextDrawTextSize(LOGIN, 650.000000, 30.000000);
  63. //
  64. LOGIN2 = TextDrawCreate(111.000000, 77.000000, "BRASIL REAL TRUCKER");
  65. TextDrawBackgroundColor(LOGIN2, 255);
  66. TextDrawAlignment(LOGIN2, 1);
  67. TextDrawFont(LOGIN2, 2);
  68. TextDrawLetterSize(LOGIN2, 0.949999, 9.299999);
  69. TextDrawUseBox(LOGIN2, 0);
  70. TextDrawColor(LOGIN2, 0xFFFFFFAA);
  71. TextDrawSetOutline(LOGIN2, 1);
  72. TextDrawSetProportional(LOGIN2, 1);
  73. //
  74. LOGIN3 = TextDrawCreate(477.000000, 148.000000, "VR1.2");
  75. TextDrawBackgroundColor(LOGIN3, 255);
  76. TextDrawAlignment(LOGIN3, 1);
  77. TextDrawFont(LOGIN3, 2);
  78. TextDrawLetterSize(LOGIN3, 0.579999, 2.499999);
  79. TextDrawUseBox(LOGIN3, 0);
  80. TextDrawColor(LOGIN3, 0xFFFFFFAA);
  81. TextDrawSetOutline(LOGIN3, 1);
  82. TextDrawSetProportional(LOGIN3, 1);
  83. //NICK
  84. SEUNICK = TextDrawCreate(225.000000, 207.000000, "SEU NICK E:");
  85. TextDrawBackgroundColor(SEUNICK, 255);
  86. TextDrawFont(SEUNICK, 2);
  87. TextDrawLetterSize(SEUNICK, 0.859999, 3.699998);
  88. TextDrawColor(SEUNICK, -1);
  89. TextDrawSetOutline(SEUNICK, 1);
  90. TextDrawSetProportional(SEUNICK, 1);
  91. //
  92. NICK = TextDrawCreate(98.000000, 264.000000, " ");
  93. TextDrawBackgroundColor(NICK, 255);
  94. TextDrawFont(NICK, 2);
  95. TextDrawLetterSize(NICK, 0.909999, 12.200010);
  96. TextDrawColor(NICK, -1);
  97. TextDrawSetOutline(NICK, 1);
  98. TextDrawSetProportional(NICK, 1);
  99. TextDrawSetShadow(NICK, 2);
  100. TextDrawAlignment(NICK, 1);
  101. //PLAYERS ON
  102. TextDrawPlayers = TextDrawCreate(498.000000, 123.000000, "");
  103. TextDrawBackgroundColor(TextDrawPlayers, 255);
  104. TextDrawFont(TextDrawPlayers, 2);
  105. TextDrawBoxColor(TextDrawPlayers, 255);
  106. TextDrawColor(TextDrawPlayers, -1);
  107. TextDrawSetOutline(TextDrawPlayers, 1);
  108. TextDrawSetProportional(TextDrawPlayers, 1);
  109. TextDrawSetShadow(TextDrawPlayers, 1);
  110. TextDrawAlignment(TextDrawPlayers, 1);
  111. TextDrawUseBox(TextDrawPlayers, 0);
  112. TextDrawLetterSize(TextDrawPlayers, 0.329999, 2.299999);
  113. return 1;
  114. }
  115. public OnPlayerConnect(playerid)
  116. {
  117. //NICK
  118. new string[128];
  119. format(string, sizeof(string), "%s", rNome(playerid));
  120. TextDrawSetString(NICK, string);
  121. //FPS
  122. FPS[playerid] = TextDrawCreate(564.000000, 104.000000, " ");
  123. TextDrawBackgroundColor(FPS[playerid], 255);
  124. TextDrawFont(FPS[playerid], 2);
  125. TextDrawLetterSize(FPS[playerid], 0.270000, 2.200000);
  126. TextDrawColor(FPS[playerid], -1);
  127. TextDrawSetOutline(FPS[playerid], 1);
  128. TextDrawSetProportional(FPS[playerid], 1);
  129. TextDrawSetShadow(FPS[playerid], 2);
  130. //TEXTDRAW INTRO
  131. TextDrawShowForPlayer(playerid,LOGIN);
  132. TextDrawShowForPlayer(playerid,LOGIN2);
  133. TextDrawShowForPlayer(playerid,LOGIN3);
  134. //NICK
  135. TextDrawShowForPlayer(playerid,SEUNICK);
  136. TextDrawShowForPlayer(playerid,NICK);
  137. //-----------------------SETTIMERS------------------------------------//
  138. //SCORE
  139. SetTimer("AtualizarScore", 1000, 1);
  140. //PING
  141. SetTimer( "AtualizarPing", 1000, 1 );
  142. //FPS
  143. TimerFPS[playerid] = SetTimerEx("AtualizarFPS", 1000, true, "i", playerid);
  144. //PLAYERS ON
  145. PlayersOnline++;
  146. return 1;
  147. }
  148. public OnPlayerDisconnect(playerid, reason)
  149. {
  150. //FPS
  151. switch(reason)
  152. {
  153.  
  154. case 0..2: KillTimer(TimerFPS[playerid]);
  155. }
  156. //PLAYERS ON
  157. PlayersOnline--;
  158. }
  159. public OnPlayerRequestClass(playerid, classid)
  160. {
  161. //TEXTDRAW INTRO
  162. TextDrawHideForPlayer(playerid, LOGIN);
  163. TextDrawHideForPlayer(playerid, LOGIN2);
  164. TextDrawHideForPlayer(playerid, LOGIN3);
  165. //NICK
  166. TextDrawHideForPlayer(playerid, SEUNICK);
  167. TextDrawHideForPlayer(playerid, NICK);
  168. //SCORE
  169. TextDrawHideForPlayer(playerid, ScoreTextDraw[i]);
  170. //PLAYERS ON
  171. TextDrawHideForPlayer(playerid, TextDrawPlayers);
  172. return 1;
  173. }
  174. public OnPlayerSpawn(playerid)
  175. {
  176. //PING
  177. for( new i = 0; i < MAX_PLAYERS; i++ )
  178. {
  179. if( IsPlayerConnected( i ) )
  180. {
  181.  
  182. TextDrawShowForPlayer( i, PingT[ i ] );
  183. }
  184. }
  185. //FPS
  186. TextDrawShowForPlayer(playerid, FPS[playerid]);
  187. //SCORE
  188. TextDrawShowForPlayer(playerid, ScoreTextDraw[i]);
  189. //PLAYERS ON
  190. TextDrawShowForPlayer(playerid, TextDrawPlayers);
  191. }
  192. public OnPlayerDeath(playerid, killerid, reason)
  193. {
  194. TextDrawHideForPlayer(playerid, FPS[playerid]);
  195. TextDrawHideForPlayer(playerid, PingT[playerid]);
  196. TextDrawHideForPlayer(playerid, TextDrawPlayers);
  197. TextDrawHideForPlayer(playerid, ScoreTextDraw[i]);
  198. return 1;
  199. }
  200. //PING
  201. forward AtualizarPing();
  202. public AtualizarPing()
  203. {
  204. new string[ 16 ];
  205. for( new i = 0; i < MAX_PLAYERS; i++ )
  206. {
  207. if( IsPlayerConnected( i ) )
  208. {
  209. format( string, sizeof( string ), "~r~PING: ~w~%d", GetPlayerPing(i) );
  210. TextDrawSetString( PingT[ i ], string);
  211. }
  212. }
  213. return 1;
  214. }
  215. //FPS
  216. forward AtualizarFPS(playerid);
  217. public AtualizarFPS(playerid)
  218. {
  219. new string[128];
  220. format(string, sizeof(string), "~y~FPS: ~w~%d", GetPlayerFPS(playerid));
  221. TextDrawSetString(FPS[playerid], string);
  222. return 1;
  223. }
  224. //SCORE
  225. forward AtualizarScore(playerid);
  226. public AtualizarScore(playerid)
  227. {
  228. for(new i=0; i<MAX_PLAYERS; i++)
  229. {
  230. if(IsPlayerConnected(i))
  231. {
  232. new STR[26];
  233. format(STR, 26, "~b~SCORES: ~w~%i", GetPlayerScore(i));
  234. TextDrawSetString(ScoreTextDraw[i], STR);
  235. }
  236. }
  237. return 1;
  238. }
  239. //PLAYERS
  240. forward PlayersOnlineText();
  241. public PlayersOnlineText()
  242. {
  243. new String[100];
  244. format(String, sizeof(String), "~w~~h~PLAYERS: ~w~%d~w~~w~/~w~%d", PlayersOnline, GetMaxPlayers());
  245. TextDrawSetString(TextDrawPlayers, String);
  246. return 1;
  247. }
  248. //FPS
  249. stock GetPlayerFPS(playerid)
  250. {
  251. SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
  252. if(GetPVarInt(playerid, "DrunkL") < 100)
  253. {
  254. SetPlayerDrunkLevel(playerid, 2000);
  255. }
  256. else
  257. {
  258. if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
  259. {
  260. SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
  261. SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
  262. if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
  263. {
  264. return GetPVarInt(playerid, "FPS") - 1;
  265. }
  266. }
  267. }
  268. return 0;
  269. }
  270. //NICK
  271. stock rNome(playerid)
  272. {
  273. new rnome[MAX_PLAYER_NAME];
  274. GetPlayerName(playerid, rnome, MAX_PLAYER_NAME);
  275. return rnome;
  276. }
Advertisement
Add Comment
Please, Sign In to add comment