Advertisement
Guest User

Untitled

a guest
Nov 4th, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.01 KB | None | 0 0
  1. new Text:Tacho0;
  2. new Text:Tacho1;
  3. new Text:Tacho2[MAX_PLAYERS];
  4. new Text:Tacho3[MAX_PLAYERS];
  5. new Text:Tacho4[MAX_PLAYERS];
  6. new Text:Tacho5[MAX_PLAYERS];
  7. new Text:Tacho6[MAX_PLAYERS];
  8. new Text:Tacho7[MAX_PLAYERS];
  9. new Text:Tacho8[MAX_PLAYERS];
  10. new Text:Tacho9[MAX_PLAYERS];
  11. new Text:Tacho10[MAX_PLAYERS];
  12. new Text:Tacho11;
  13. new Text:Tacho12;
  14. new Text:Tacho13[MAX_PLAYERS];
  15. new Text:Tacho14;
  16. new Text:Tacho15;
  17. new Text:Tacho16[MAX_PLAYERS];
  18. new TachoTimer[MAX_PLAYERS];
  19.  
  20. stock TachoInit()
  21. {
  22. Tacho0 = TextDrawCreate(255.000000, 324.000000, "~n~~n~~n~~n~");
  23. TextDrawBackgroundColor(Tacho0, 255);
  24. TextDrawFont(Tacho0, 1);
  25. TextDrawLetterSize(Tacho0, 0.490000, 2.599998);
  26. TextDrawColor(Tacho0, -1);
  27. TextDrawSetOutline(Tacho0, 0);
  28. TextDrawSetProportional(Tacho0, 1);
  29. TextDrawSetShadow(Tacho0, 1);
  30. TextDrawUseBox(Tacho0, 1);
  31. TextDrawBoxColor(Tacho0, 96);
  32. TextDrawTextSize(Tacho0, 380.000000, 10.000000);
  33. TextDrawSetSelectable(Tacho0, 0);
  34.  
  35. Tacho1 = TextDrawCreate(261.000000, 328.000000, "~n~~n~~n~~n~");
  36. TextDrawBackgroundColor(Tacho1, 255);
  37. TextDrawFont(Tacho1, 1);
  38. TextDrawLetterSize(Tacho1, 0.490000, 2.399998);
  39. TextDrawColor(Tacho1, -1);
  40. TextDrawSetOutline(Tacho1, 0);
  41. TextDrawSetProportional(Tacho1, 1);
  42. TextDrawSetShadow(Tacho1, 1);
  43. TextDrawUseBox(Tacho1, 1);
  44. TextDrawBoxColor(Tacho1, 144);
  45. TextDrawTextSize(Tacho1, 373.000000, 10.000000);
  46. TextDrawSetSelectable(Tacho1, 0);
  47.  
  48. Tacho14 = TextDrawCreate(420.000000, 372.000000, "~n~~n~~n~");
  49. TextDrawBackgroundColor(Tacho14, 255);
  50. TextDrawFont(Tacho14, 1);
  51. TextDrawLetterSize(Tacho14, 0.500000, 1.000000);
  52. TextDrawColor(Tacho14, -1);
  53. TextDrawSetOutline(Tacho14, 0);
  54. TextDrawSetProportional(Tacho14, 1);
  55. TextDrawSetShadow(Tacho14, 1);
  56. TextDrawUseBox(Tacho14, 1);
  57. TextDrawBoxColor(Tacho14, 128);
  58. TextDrawTextSize(Tacho14, 470.000000, 30.000000);
  59. TextDrawSetSelectable(Tacho14, 0);
  60.  
  61. Tacho15 = TextDrawCreate(425.000000, 375.000000, "~n~~n~~n~");
  62. TextDrawBackgroundColor(Tacho15, 255);
  63. TextDrawFont(Tacho15, 1);
  64. TextDrawLetterSize(Tacho15, 0.500000, 0.799999);
  65. TextDrawColor(Tacho15, -1);
  66. TextDrawSetOutline(Tacho15, 0);
  67. TextDrawSetProportional(Tacho15, 1);
  68. TextDrawSetShadow(Tacho15, 1);
  69. TextDrawUseBox(Tacho15, 1);
  70. TextDrawBoxColor(Tacho15, 128);
  71. TextDrawTextSize(Tacho15, 464.000000, 30.000000);
  72. TextDrawSetSelectable(Tacho15, 0);
  73.  
  74. Tacho11 = TextDrawCreate(161.000000, 376.000000, "~n~~n~~n~");
  75. TextDrawBackgroundColor(Tacho11, 255);
  76. TextDrawFont(Tacho11, 1);
  77. TextDrawLetterSize(Tacho11, 0.500000, 1.000000);
  78. TextDrawColor(Tacho11, -1);
  79. TextDrawSetOutline(Tacho11, 0);
  80. TextDrawSetProportional(Tacho11, 1);
  81. TextDrawSetShadow(Tacho11, 1);
  82. TextDrawUseBox(Tacho11, 1);
  83. TextDrawBoxColor(Tacho11, 128);
  84. TextDrawTextSize(Tacho11, 211.000000, 0.000000);
  85. TextDrawSetSelectable(Tacho11, 0);
  86.  
  87. Tacho12 = TextDrawCreate(165.000000, 379.000000, "~n~~n~~n~");
  88. TextDrawBackgroundColor(Tacho12, 255);
  89. TextDrawFont(Tacho12, 1);
  90. TextDrawLetterSize(Tacho12, 0.440000, 0.799999);
  91. TextDrawColor(Tacho12, -1);
  92. TextDrawSetOutline(Tacho12, 0);
  93. TextDrawSetProportional(Tacho12, 1);
  94. TextDrawSetShadow(Tacho12, 1);
  95. TextDrawUseBox(Tacho12, 1);
  96. TextDrawBoxColor(Tacho12, 128);
  97. TextDrawTextSize(Tacho12, 206.000000, 0.000000);
  98. TextDrawSetSelectable(Tacho12, 0);
  99. for(new i=0;i<MAX_PLAYERS;i++)
  100. {
  101. Tacho2[i] = TextDrawCreate(281.000000, 311.000000, "Trashmaster");
  102. TextDrawBackgroundColor(Tacho2[i], 255);
  103. TextDrawFont(Tacho2[i], 0);
  104. TextDrawLetterSize(Tacho2[i], 0.460000, 1.899999);
  105. TextDrawColor(Tacho2[i], -1);
  106. TextDrawSetOutline(Tacho2[i], 0);
  107. TextDrawSetProportional(Tacho2[i], 1);
  108. TextDrawSetShadow(Tacho2[i], 1);
  109. TextDrawSetSelectable(Tacho2[i], 0);
  110.  
  111. Tacho3[i] = TextDrawCreate(259.000000, 330.000000, "Tank: 100L");
  112. TextDrawBackgroundColor(Tacho3[i], 255);
  113. TextDrawFont(Tacho3[i], 1);
  114. TextDrawLetterSize(Tacho3[i], 0.310000, 1.200000);
  115. TextDrawColor(Tacho3[i], -1);
  116. TextDrawSetOutline(Tacho3[i], 0);
  117. TextDrawSetProportional(Tacho3[i], 1);
  118. TextDrawSetShadow(Tacho3[i], 1);
  119. TextDrawSetSelectable(Tacho3[i], 0);
  120.  
  121. Tacho4[i] = TextDrawCreate(259.000000, 342.000000, "Tankart: Kerosin");
  122. TextDrawBackgroundColor(Tacho4[i], 255);
  123. TextDrawFont(Tacho4[i], 1);
  124. TextDrawLetterSize(Tacho4[i], 0.310000, 1.200000);
  125. TextDrawColor(Tacho4[i], -1);
  126. TextDrawSetOutline(Tacho4[i], 0);
  127. TextDrawSetProportional(Tacho4[i], 1);
  128. TextDrawSetShadow(Tacho4[i], 1);
  129. TextDrawSetSelectable(Tacho4[i], 0);
  130.  
  131. Tacho5[i] = TextDrawCreate(258.000000, 355.000000, "Batterie: 12 W");
  132. TextDrawBackgroundColor(Tacho5[i], 255);
  133. TextDrawFont(Tacho5[i], 1);
  134. TextDrawLetterSize(Tacho5[i], 0.310000, 1.200000);
  135. TextDrawColor(Tacho5[i], -1);
  136. TextDrawSetOutline(Tacho5[i], 0);
  137. TextDrawSetProportional(Tacho5[i], 1);
  138. TextDrawSetShadow(Tacho5[i], 1);
  139. TextDrawSetSelectable(Tacho5[i], 0);
  140.  
  141. Tacho6[i] = TextDrawCreate(259.000000, 368.000000, "Geschw.: 100 Km/h");
  142. TextDrawBackgroundColor(Tacho6[i], 255);
  143. TextDrawFont(Tacho6[i], 1);
  144. TextDrawLetterSize(Tacho6[i], 0.310000, 1.200000);
  145. TextDrawColor(Tacho6[i], -1);
  146. TextDrawSetOutline(Tacho6[i], 0);
  147. TextDrawSetProportional(Tacho6[i], 1);
  148. TextDrawSetShadow(Tacho6[i], 1);
  149. TextDrawSetSelectable(Tacho6[i], 0);
  150.  
  151. Tacho7[i] = TextDrawCreate(260.000000, 381.000000, "Km: 1000.2");
  152. TextDrawBackgroundColor(Tacho7[i], 255);
  153. TextDrawFont(Tacho7[i], 1);
  154. TextDrawLetterSize(Tacho7[i], 0.310000, 1.200000);
  155. TextDrawColor(Tacho7[i], -1);
  156. TextDrawSetOutline(Tacho7[i], 0);
  157. TextDrawSetProportional(Tacho7[i], 1);
  158. TextDrawSetShadow(Tacho7[i], 1);
  159. TextDrawSetSelectable(Tacho7[i], 0);
  160.  
  161. Tacho8[i] = TextDrawCreate(260.000000, 398.000000, "[~r~Tuer~w~]");
  162. TextDrawBackgroundColor(Tacho8[i], 255);
  163. TextDrawFont(Tacho8[i], 1);
  164. TextDrawLetterSize(Tacho8[i], 0.259999, 1.299999);
  165. TextDrawColor(Tacho8[i], -1);
  166. TextDrawSetOutline(Tacho8[i], 0);
  167. TextDrawSetProportional(Tacho8[i], 1);
  168. TextDrawSetShadow(Tacho8[i], 1);
  169. TextDrawSetSelectable(Tacho8[i], 0);
  170.  
  171. Tacho9[i] = TextDrawCreate(300.000000, 398.000000, "[~g~Licht~w~]");
  172. TextDrawBackgroundColor(Tacho9[i], 255);
  173. TextDrawFont(Tacho9[i], 1);
  174. TextDrawLetterSize(Tacho9[i], 0.280000, 1.299999);
  175. TextDrawColor(Tacho9[i], -1);
  176. TextDrawSetOutline(Tacho9[i], 0);
  177. TextDrawSetProportional(Tacho9[i], 1);
  178. TextDrawSetShadow(Tacho9[i], 1);
  179. TextDrawSetSelectable(Tacho9[i], 0);
  180.  
  181. Tacho10[i] = TextDrawCreate(342.000000, 398.000000, "[~r~Motor~w~]");
  182. TextDrawBackgroundColor(Tacho10[i], 255);
  183. TextDrawFont(Tacho10[i], 1);
  184. TextDrawLetterSize(Tacho10[i], 0.239999, 1.299999);
  185. TextDrawColor(Tacho10[i], -1);
  186. TextDrawSetOutline(Tacho10[i], 0);
  187. TextDrawSetProportional(Tacho10[i], 1);
  188. TextDrawSetShadow(Tacho10[i], 1);
  189. TextDrawSetSelectable(Tacho10[i], 0);
  190.  
  191.  
  192. Tacho13[i] = TextDrawCreate(167.000000, 383.000000, "1000 m");
  193. TextDrawBackgroundColor(Tacho13[i], 255);
  194. TextDrawFont(Tacho13[i], 1);
  195. TextDrawLetterSize(Tacho13[i], 0.280000, 1.400000);
  196. TextDrawColor(Tacho13[i], -1);
  197. TextDrawSetOutline(Tacho13[i], 0);
  198. TextDrawSetProportional(Tacho13[i], 1);
  199. TextDrawSetShadow(Tacho13[i], 1);
  200. TextDrawSetSelectable(Tacho13[i], 0);
  201.  
  202. Tacho16[i] = TextDrawCreate(426.000000, 373.000000, "~r~Stop");
  203. TextDrawBackgroundColor(Tacho16[i], 255);
  204. TextDrawFont(Tacho16[i], 1);
  205. TextDrawLetterSize(Tacho16[i], 0.490000, 2.699999);
  206. TextDrawColor(Tacho16[i], -1);
  207. TextDrawSetOutline(Tacho16[i], 0);
  208. TextDrawSetProportional(Tacho16[i], 1);
  209. TextDrawSetShadow(Tacho16[i], 1);
  210. TextDrawSetSelectable(Tacho16[i], 0);
  211. }
  212. return 1;
  213. }
  214.  
  215. forward ShowTacho(playerid, VehicleID);
  216. public ShowTacho(playerid, VehicleID) {
  217. if(IsPlayerInAnyVehicle(playerid)) {
  218. new Float:FahrzeugLeben, string[1024], car = GetPlayerVehicleID(playerid);
  219. GetVehicleHealth(car, FahrzeugLeben);
  220. format(string, sizeof(string), "%s", VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
  221. TextDrawSetString(Tacho2[playerid],string);
  222. format(string, sizeof(string), "Tank: %dL", Tank[car]);
  223. TextDrawSetString(Tacho3[playerid],string);
  224. format(string, sizeof(string), "Tankart: %s", TankTyp(car));
  225. TextDrawSetString(Tacho4[playerid],string);
  226. format(string, sizeof(string), "Batterie: %d W", Batterie[car]);
  227. TextDrawSetString(Tacho5[playerid],string);
  228. format(string, sizeof(string), "Geschw.: %d Km/h", GetVehicleSpeed(car));
  229. TextDrawSetString(Tacho6[playerid],string);
  230. format(string, sizeof(string), "Km: %d Km", Km[car]);
  231. TextDrawSetString(Tacho7[playerid],string);
  232. if(Locked[car] == true) {
  233. TextDrawSetString(Tacho8[playerid], "[~g~Tuer~w~]");
  234. } else {
  235. TextDrawSetString(Tacho8[playerid], "[~r~Tuer~w~]");
  236. }
  237. if(Licht[car] == true) {
  238. TextDrawSetString(Tacho9[playerid], "[~g~Licht~w~]");
  239. } else {
  240. TextDrawSetString(Tacho9[playerid], "[~r~Licht~w~]");
  241. }
  242. if(Motor[car] == true) {
  243. TextDrawSetString(Tacho10[playerid], "[~g~Motor~w~]");
  244. } else {
  245. TextDrawSetString(Tacho10[playerid], "[~r~Motor~w~]");
  246. }
  247. if(IsAFlyVeh(car))
  248. {
  249. new Float:VehiclePos[3];
  250. GetVehiclePos(car, VehiclePos[0], VehiclePos[1], VehiclePos[2]);
  251. format(string, sizeof(string), "%d", floatround(VehiclePos[2]));
  252. TextDrawSetString(Tacho13[playerid], string);
  253. }
  254. }
  255. else {
  256. TextDrawHideForPlayer(playerid, Tacho0);
  257. TextDrawHideForPlayer(playerid, Tacho1);
  258. TextDrawHideForPlayer(playerid, Tacho2[playerid]);
  259. TextDrawHideForPlayer(playerid, Tacho3[playerid]);
  260. TextDrawHideForPlayer(playerid, Tacho4[playerid]);
  261. TextDrawHideForPlayer(playerid, Tacho5[playerid]);
  262. TextDrawHideForPlayer(playerid, Tacho6[playerid]);
  263. TextDrawHideForPlayer(playerid, Tacho7[playerid]);
  264. TextDrawHideForPlayer(playerid, Tacho8[playerid]);
  265. TextDrawHideForPlayer(playerid, Tacho9[playerid]);
  266. TextDrawHideForPlayer(playerid, Tacho10[playerid]);
  267. TextDrawHideForPlayer(playerid, Tacho11);
  268. TextDrawHideForPlayer(playerid, Tacho12);
  269. TextDrawHideForPlayer(playerid, Tacho13[playerid]);
  270. KillTimer(TachoTimer[playerid]);
  271. }
  272. return 1;
  273. }
  274. //OnPlayerStateChange
  275. new CarModelID = GetVehicleModel(GetPlayerVehicleID(playerid));
  276. if(CarModelID==481||CarModelID==509||CarModelID==510)
  277. {
  278. return 1;
  279. }
  280. TachoTimer[playerid]=SetTimerEx("ShowTacho", 200, 1, "ii", playerid, GetPlayerVehicleID(playerid));
  281. TextDrawShowForPlayer(playerid, Tacho0);
  282. TextDrawShowForPlayer(playerid, Tacho1);
  283. TextDrawShowForPlayer(playerid, Tacho2[playerid]);
  284. TextDrawShowForPlayer(playerid, Tacho3[playerid]);
  285. TextDrawShowForPlayer(playerid, Tacho4[playerid]);
  286. TextDrawShowForPlayer(playerid, Tacho5[playerid]);
  287. TextDrawShowForPlayer(playerid, Tacho6[playerid]);
  288. TextDrawShowForPlayer(playerid, Tacho7[playerid]);
  289. TextDrawShowForPlayer(playerid, Tacho8[playerid]);
  290. TextDrawShowForPlayer(playerid, Tacho9[playerid]);
  291. TextDrawShowForPlayer(playerid, Tacho10[playerid]);
  292. TextDrawShowForPlayer(playerid, Tacho11);
  293. TextDrawShowForPlayer(playerid, Tacho12);
  294. if(IsAFlyVeh(GetPlayerVehicleID(playerid)))
  295. {
  296. TextDrawShowForPlayer(playerid, Tacho13[playerid]);
  297. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement