Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.94 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #pragma tabsize 0
  6. #define GasMax 100
  7. #define Abastecendo 5000
  8. #define RunOutTime 15000
  9. #define AMARELO 0xFFFF00AA
  10. #define VERMELHO 0xFF000096
  11. #define AZUL 0x33AA33A
  12. #define SLOT 1
  13.  
  14. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  15. forward Petrobras(playerid);
  16. forward Texaco(playerid);
  17. forward APetrobras(playerid);
  18. forward ATexaco(playerid);
  19. forward Float:GetDistanceBetweenPlayerToPoint(p1,Float:px,Float:py,Float:pz);
  20. forward Veiculoparado();
  21. forward Checargas();
  22. forward Velocimetro();
  23. forward Tontura(playerid);
  24. forward Semcinto(playerid);
  25. forward Comcinto(playerid);
  26. forward Capacete(playerid);
  27. forward RetirarlogoasTextDraw(playerid);
  28.  
  29. enum SavePlayerPosEnum
  30. {
  31. Float:LastX,
  32. Float:LastY,
  33. Float:LastZ
  34. };
  35.  
  36. new Text:Fundo;
  37. new Text:Velocidade;
  38. new Text:Modelo;
  39. new Text:Gasolina;
  40. new Text:Motor;
  41. new Text:Cinto;
  42. new CSEG[MAX_PLAYERS];
  43. new TempoChecargas;
  44. new TempoVeiculoparado;
  45. new Gas[MAX_VEHICLES];
  46. new AbasPetro[MAX_PLAYERS];
  47. new AbasTexaco[MAX_PLAYERS];
  48. new SavePlayerPos[MAX_PLAYERS][SavePlayerPosEnum];
  49. new UpdateSeconds = 1;
  50. new Float:CarroMotor;
  51. new string[256];
  52. new Float:x1;
  53. new Float:y1;
  54. new Float:z1;
  55. new Float:x2;
  56. new Float:y2;
  57. new Float:z2;
  58. new spe;
  59. new Float:pos[4];
  60. new Petrobrasup;
  61. new Texacoup;
  62. new PrecoPetro;
  63. new PrecoTexaco;
  64. new Float:x;
  65. new Float:y;
  66. new Float:z;
  67. new Float:Distancia;
  68. new TempoVelocimetro;
  69. new Valor;
  70.  
  71.  
  72.  
  73. new Modelos[][] ={"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial",
  74. "Sentinel","Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
  75. "Voodoo", "Pony", "Mule", "Cheetah", "Ambulancia", "Leviathan", "Moonbeam",
  76. "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
  77. "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
  78. "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
  79. "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
  80. "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
  81. "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
  82. "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
  83. "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
  84. "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
  85. "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
  86. "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
  87. "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
  88. "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
  89. "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
  90. "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
  91. "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
  92. "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
  93. "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
  94. "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
  95. "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
  96. "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
  97. "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
  98. "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
  99. "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
  100. "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
  101. "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Carro Policial",
  102. "Carro Policial", "Carro Policial", "Ranger Policial", "Picador", "S.W.A.T", "Alpha",
  103. "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
  104. "Tiller", "Utility Trailer"
  105. };
  106.  
  107. public OnPlayerConnect(playerid)
  108. {
  109. CSEG[playerid] = 0;
  110. return 1;
  111. }
  112.  
  113. public RetirarlogoasTextDraw(playerid)
  114. {
  115. TextDrawHideForPlayer(playerid,Velocidade);
  116. TextDrawHideForPlayer(playerid,Modelo);
  117. TextDrawHideForPlayer(playerid,Gasolina);
  118. TextDrawHideForPlayer(playerid,Motor);
  119. TextDrawHideForPlayer(playerid,Cinto);
  120. return 1;
  121. }
  122. public OnFilterScriptInit()
  123. {
  124. print("------------------[VELOCITACHI 0.1]------------------");
  125. print("Velocitachi: Ok");
  126. print("Cinto de Segurança: Ok");
  127. print("Gasolina System: Ok");
  128. print("Petrobras: Ok");
  129. print("Texaco: Ok");
  130. print("Petrobras: Ok");
  131. print("Capacete: Ok");
  132. print("---------------FS By hitachi_uchila------------------");
  133. print("Digite /velocitachi in game para ver os Creditos");
  134.  
  135. for(new c = 0;c < MAX_VEHICLES;c++)
  136. {
  137. Gas[c] = GasMax;
  138. }
  139. TempoVeiculoparado = SetTimer("Veiculoparado", RunOutTime, 1);
  140. TempoChecargas = SetTimer("Checargas", RunOutTime, 1);
  141. TempoVelocimetro = SetTimer("Velocimetro",500,1);
  142.  
  143. Fundo = TextDrawCreate(640.000000, 102.000000," ~n~ ~n~ ~n~ ~n~ ");
  144. TextDrawBackgroundColor(Fundo,255);
  145. TextDrawFont(Fundo,1);
  146. TextDrawLetterSize(Fundo, 0.300000, 0.800000);
  147. TextDrawColor(Fundo, -1);
  148. TextDrawSetOutline(Fundo,0);
  149. TextDrawSetProportional(Fundo,0);
  150. TextDrawUseBox(Fundo,1);
  151. TextDrawBoxColor(Fundo,1010580610);
  152. TextDrawTextSize(Fundo,482.000000, 405.000000);
  153.  
  154. Velocidade = TextDrawCreate(488.000000, 131.000000, "Velocidade: ~w~");
  155. TextDrawBackgroundColor(Velocidade, 255);
  156. TextDrawFont(Velocidade, 1);
  157. TextDrawLetterSize(Velocidade, 0.400000, 1.000000);
  158. TextDrawColor(Velocidade, -16776961);
  159. TextDrawSetOutline(Velocidade, 0);
  160. TextDrawSetProportional(Velocidade, 1);
  161. TextDrawSetShadow(Velocidade, 1);
  162.  
  163. Modelo = TextDrawCreate(486.000000, 101.000000, "Modelo: ~w~");
  164. TextDrawBackgroundColor(Modelo, 255);
  165. TextDrawFont(Modelo, 1);
  166. TextDrawLetterSize(Modelo, 0.400000, 1.000000);
  167. TextDrawColor(Modelo, -16776961);
  168. TextDrawSetOutline(Modelo, 0);
  169. TextDrawSetProportional(Modelo, 1);
  170. TextDrawSetShadow(Modelo, 1);
  171.  
  172. Gasolina = TextDrawCreate(487.000000, 121.000000, "Gasolina:~w~");
  173. TextDrawBackgroundColor(Gasolina, 255);
  174. TextDrawFont(Gasolina, 1);
  175. TextDrawLetterSize(Gasolina, 0.400000, 1.000000);
  176. TextDrawColor(Gasolina, -16776961);
  177. TextDrawSetOutline(Gasolina, 0);
  178. TextDrawSetProportional(Gasolina, 1);
  179. TextDrawSetShadow(Gasolina, 1);
  180.  
  181. Motor = TextDrawCreate(487.000000, 111.000000, "Motor: ~w~");
  182. TextDrawBackgroundColor(Motor, 255);
  183. TextDrawFont(Motor, 1);
  184. TextDrawLetterSize(Motor, 0.400000, 1.000000);
  185. TextDrawColor(Motor, -16776961);
  186. TextDrawSetOutline(Motor, 0);
  187. TextDrawSetProportional(Motor, 1);
  188. TextDrawSetShadow(Motor, 1);
  189.  
  190. Cinto = TextDrawCreate(489.000000, 140.000000, "Cinto: ");
  191. TextDrawBackgroundColor(Cinto, 255);
  192. TextDrawFont(Cinto, 1);
  193. TextDrawLetterSize(Cinto, 0.400000, 1.000000);
  194. TextDrawColor(Cinto, -16776961);
  195. TextDrawSetOutline(Cinto, 0);
  196. TextDrawSetProportional(Cinto, 1);
  197. TextDrawSetShadow(Cinto, 1);
  198.  
  199. return 1;
  200. }
  201.  
  202. public OnFilterScriptExit()
  203. {
  204. KillTimer(TempoVeiculoparado);
  205. KillTimer(TempoChecargas);
  206. KillTimer(TempoVelocimetro);
  207. return 1;
  208. }
  209.  
  210. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  211. {
  212. CSEG[playerid] = 0;
  213. if(IsABike(GetPlayerVehicleID(playerid)))
  214. {
  215. Capacete(playerid);
  216. SetTimerEx("Capacete", 3000, 0, "i", playerid);
  217. SendClientMessage(playerid,VERMELHO,"[SERVER] Use /capacete para colocar! ");
  218. GameTextForPlayer(playerid, "~y~Coloque ~n~ o ~n~ ~g~Capacete", 3000, 4);
  219. TextDrawShowForPlayer(playerid,Modelo);
  220. TextDrawShowForPlayer(playerid,Velocidade);
  221. TextDrawShowForPlayer(playerid,Motor);
  222. TextDrawShowForPlayer(playerid,Gasolina);
  223. TextDrawShowForPlayer(playerid,Fundo);
  224. TextDrawShowForPlayer(playerid,Cinto);
  225. }
  226. else
  227. {
  228. SendClientMessage(playerid,VERMELHO,"[SERVER] Use /cinto para colocar! ");
  229. GameTextForPlayer(playerid, "~y~Coloque ~n~ o ~n~ ~g~Cinto de Seguranca", 3000, 4);
  230. TextDrawShowForPlayer(playerid,Modelo);
  231. TextDrawShowForPlayer(playerid,Velocidade);
  232. TextDrawShowForPlayer(playerid,Motor);
  233. TextDrawShowForPlayer(playerid,Gasolina);
  234. TextDrawShowForPlayer(playerid,Fundo);
  235. TextDrawShowForPlayer(playerid,Cinto);
  236. }
  237. return 1;
  238. }
  239. public OnPlayerExitVehicle(playerid, vehicleid)
  240. {
  241. RetirarlogoasTextDraw(playerid);
  242. TextDrawHideForPlayer(playerid,Modelo);
  243. TextDrawHideForPlayer(playerid,Fundo);
  244. TextDrawHideForPlayer(playerid,Velocidade);
  245. TextDrawHideForPlayer(playerid,Gasolina);
  246. TextDrawHideForPlayer(playerid,Motor);
  247. Capacete(playerid);
  248. return 1;
  249. }
  250. public OnPlayerUpdate(playerid)
  251. {
  252. if(IsPlayerInAnyVehicle(playerid))
  253. {
  254. if(CSEG[playerid] == 0)
  255. {
  256. Capacete(playerid);
  257. }
  258. }
  259. else
  260. {
  261. Capacete(playerid);
  262. RetirarlogoasTextDraw(playerid);
  263. }
  264. return 1;
  265. }
  266. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  267. {
  268. new Acidente = floatround(Valor/1600);
  269. if(Acidente > 16)
  270. {
  271. if(CSEG[playerid] == 0)
  272. {
  273. new Float:VIDA,Float:TakiX,Float:TakiY,Float:TakiZ;
  274. GetPlayerHealth(playerid, VIDA);
  275. SetPlayerHealth(playerid, VIDA-25.0);
  276. SendClientMessage(playerid,VERMELHO,"[SERVER] Voce bateu e esse Acidente foi feio, Voce deve estar meio zomzo! ");
  277. SetTimerEx("Tontura", 30000, 0, "i", playerid);
  278. SetPlayerDrunkLevel(playerid, 500000);
  279. if(VelocidadeKM(playerid) >= 120)
  280. {
  281. SendClientMessage(playerid,VERMELHO,"[SERVER] Voce bateu tão forte que seu carro explodiu! ");
  282. CreateExplosion(TakiX, TakiY, TakiZ, 6, 10);
  283. CreateExplosion(TakiX-2,TakiY-2,TakiZ+1, 0, 4.5);
  284. RemovePlayerFromVehicle(playerid);
  285. GetPlayerPos(playerid, TakiX,TakiY,TakiZ);
  286. SetPlayerPos(playerid, TakiX-17,TakiY-8,TakiZ-15);
  287. }
  288. }
  289. else
  290. {
  291. SetTimerEx("Tontura", 30000, 0, "i", playerid);
  292. SetPlayerDrunkLevel(playerid, 1000);
  293. new Float:VIDA;
  294. GetPlayerHealth(playerid, VIDA);
  295. SetPlayerHealth(playerid, VIDA-3.0);
  296. }
  297. }
  298. return 1;
  299. }
  300. public Tontura(playerid)
  301. {
  302. SetPlayerDrunkLevel(playerid, 0);
  303. return 1;
  304. }
  305. public OnPlayerCommandText(playerid, cmdtext[])
  306. {
  307. if(!strcmp(cmdtext, "/abastecer", true)){
  308. if(IsPlayerConnected(playerid)){
  309. if(Petrobras(playerid)){
  310. GameTextForPlayer(playerid,"~y~Aguarde Enquanto o Frentista Reabastece seu Veiculo!",2000,3);
  311. SetTimer("APetrobras",Abastecendo,0);
  312. AbasPetro[playerid] = 1;}
  313. if(Texaco(playerid)){
  314. GameTextForPlayer(playerid,"~r~Aguarde Enquanto o Frentista Reabastece seu Veiculo!",2000,3);
  315. SetTimer("ATexaco",Abastecendo,0);
  316. AbasTexaco[playerid] = 1;}
  317. else{
  318. SendClientMessage(playerid,0xAFAFAFAA," Voce pode Comprar mais Gasolina Apenas em Postos!");}}
  319. return 1;}
  320. if(!strcmp(cmdtext, "/cinto", true)){
  321. if(IsPlayerInAnyVehicle(playerid)){
  322. if(CSEG[playerid] == 1)
  323. {
  324. SendClientMessage(playerid,AZUL,"[SERVER] Cinto de Segurança Retirado!");
  325. CSEG[playerid] = 0;
  326. return 1;
  327. }
  328. if(CSEG[playerid] == 0)
  329. {
  330. SendClientMessage(playerid,AZUL,"[SERVER] Cinto de Segurança Colocado!");
  331. CSEG[playerid] = 1;
  332. }
  333. return 1;}}
  334. if(!strcmp(cmdtext, "/capacete", true)){
  335. if(IsABike(GetPlayerVehicleID(playerid))){
  336. if(CSEG[playerid] == 1)
  337. {
  338. SendClientMessage(playerid,AZUL,"[SERVER] Capacete Retirado!");
  339. Capacete(playerid);
  340. CSEG[playerid] = 0;
  341. return 1;
  342. }
  343. if(CSEG[playerid] == 0)
  344. {
  345. SendClientMessage(playerid,AZUL,"[SERVER] Capacete Colocado!");
  346. TogglePlayerControllable(playerid, 0);
  347. ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
  348. SetTimerEx("Colocarcapacete", 4500, 0, "i", playerid);
  349. CSEG[playerid] = 1;
  350. }
  351. return 1;}}
  352. if(!strcmp(cmdtext, "/velocitachi", true))
  353. {
  354. SendClientMessage(playerid,AZUL,"____________________CREDITOS_____________________");
  355. SendClientMessage(playerid,0xAFAFAFAA,"Cinto de Segurança: hitachi_uchila");
  356. SendClientMessage(playerid,0xAFAFAFAA,"Velocimetro: hitachi_uchila");
  357. SendClientMessage(playerid,0xAFAFAFAA,"Capacete: Não Lembro Aperfeiçoado por: hitachi_uchila");
  358. SendClientMessage(playerid,0xAFAFAFAA,"Cinto de Segurança: hitachi_uchila");
  359. SendClientMessage(playerid,0xAFAFAFAA,"Posto de Gasolina : hitachi_uchila");
  360. SendClientMessage(playerid,0xAFAFAFAA,"Stock De Getar A Velocidade : Dark Team PT");
  361. return 1;}
  362. return 0;
  363. }
  364. forward Colocarcapacete(playerid);
  365. public Colocarcapacete(playerid)
  366. {
  367. new newstate;
  368. new oldstate;
  369. OnPlayerStateChange(playerid,newstate,oldstate);
  370. TogglePlayerControllable(playerid, 1);
  371. if(IsABike(GetPlayerVehicleID(playerid)))
  372. {
  373. switch(GetPlayerSkin(playerid))
  374. {
  375. #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
  376. case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
  377. case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
  378. case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  379. case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  380. case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  381. case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
  382. case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  383. case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  384. case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  385. case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  386. case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  387. case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  388. case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
  389. case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
  390. case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
  391. case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  392. case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  393. case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
  394. case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  395. case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
  396. case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
  397. case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
  398. case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
  399. case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  400. case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  401. }
  402. }
  403. return 1;
  404. }
  405. public OnPlayerDeath(playerid, killerid, reason)
  406. {
  407. RetirarlogoasTextDraw(playerid);
  408. RemovePlayerFromVehicle(playerid);
  409. TextDrawHideForPlayer(playerid,Modelo);
  410. TextDrawHideForPlayer(playerid,Fundo);
  411. TextDrawHideForPlayer(playerid,Velocidade);
  412. TextDrawHideForPlayer(playerid,Gasolina);
  413. TextDrawHideForPlayer(playerid,Motor);
  414. Capacete(playerid);
  415. return 1;
  416. }
  417.  
  418. public Velocimetro()
  419. {
  420. for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
  421. {
  422. if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
  423. {
  424. format(string,sizeof(string),"Modelo: ~w~%s", Modelos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
  425. TextDrawSetString(Modelo, string);
  426. TextDrawShowForPlayer(playerid, Modelo);
  427. GetVehicleHealth(GetPlayerVehicleID(playerid), CarroMotor);
  428. TextDrawHideForPlayer(playerid, Motor);
  429. format(string,sizeof(string),"Motor: ~w~ %0.0f%%", CarroMotor);
  430. TextDrawSetString(Motor, string);
  431. TextDrawShowForPlayer(playerid, Motor);
  432. format(string,sizeof(string),"Gasolina:~w~ %d% Lts", Gas[GetPlayerVehicleID(playerid)]);
  433. TextDrawSetString(Gasolina, string);
  434. TextDrawShowForPlayer(playerid, Gasolina);
  435. format(string,sizeof(string),"Velocidade:~w~%d Km/h", VelocidadeKM(playerid));
  436. TextDrawSetString(Velocidade, string);
  437. TextDrawShowForPlayer(playerid, Velocidade);
  438. if(CSEG[playerid] == 0){
  439. TextDrawSetString(Cinto, "Cinto:~w~ Nao");
  440. TextDrawShowForPlayer(playerid, Cinto);}
  441. if(CSEG[playerid] == 1){
  442. TextDrawSetString(Cinto, "Cinto:~g~Sim");
  443. TextDrawShowForPlayer(playerid, Cinto);}
  444. if(IsABike(GetPlayerVehicleID(playerid))){
  445. if(CSEG[playerid] == 1){
  446. TextDrawSetString(Cinto, "Capacete:~g~Sim");
  447. TextDrawShowForPlayer(playerid, Cinto);}
  448. if(CSEG[playerid] == 0){
  449. TextDrawSetString(Cinto, "Capacete:~w~ Nao");
  450. TextDrawShowForPlayer(playerid, Cinto);}}
  451. }
  452. else
  453. {
  454. RetirarlogoasTextDraw(playerid);
  455. TextDrawHideForPlayer(playerid,Velocidade);
  456. TextDrawHideForPlayer(playerid,Modelo);
  457. TextDrawHideForPlayer(playerid,Gasolina);
  458. TextDrawHideForPlayer(playerid,Motor);
  459. TextDrawHideForPlayer(playerid,Cinto);
  460. }
  461. }
  462. }
  463. public Float:GetDistanceBetweenPlayerToPoint(p1,Float:px,Float:py,Float:pz)
  464. {
  465. if(!IsPlayerConnected(p1))
  466. return -1.00;
  467.  
  468. GetPlayerPos(p1,x1,y1,z1);
  469. x2 = px;
  470. y2 = py;
  471. z2 = pz;
  472. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  473. }
  474.  
  475. public Petrobras(playerid)
  476. {
  477. if(IsPlayerConnected(playerid))
  478. {
  479. if(IsPlayerInRangeOfPoint(playerid,15.0,1004.0070,-939.3102,42.1797) || IsPlayerInRangeOfPoint(playerid,15.0,1944.3260,-1772.9254,13.3906))
  480. {//LS
  481. return 1;
  482. }
  483. else if(IsPlayerInRangeOfPoint(playerid,15.0,2202.2349,2474.3494,10.5258) || IsPlayerInRangeOfPoint(playerid,15.0,614.9333,1689.7418,6.6968))
  484. {//LV
  485. return 1;
  486. }
  487. else if(IsPlayerInRangeOfPoint(playerid,15.0,2113.7390,920.1079,10.5255) || IsPlayerInRangeOfPoint(playerid,15.0,-1327.7218,2678.8723,50.0625))
  488. {//LV
  489. return 1;
  490. }
  491. else if(IsPlayerInRangeOfPoint(playerid,15.0,-2029.4968,156.4366,28.9498) || IsPlayerInRangeOfPoint(playerid,15.0,-2408.7590,976.0934,45.4175))
  492. {//SF
  493. return 1;
  494. }
  495. else if(IsPlayerInRangeOfPoint(playerid,15.0,-2243.9629,-2560.6477,31.8841) || IsPlayerInRangeOfPoint(playerid,15.0,-1676.6323,414.0262,6.9484))
  496. {//Between LS and SF
  497. return 1;
  498. }
  499. }
  500. return 0;
  501. }
  502. public Texaco(playerid)
  503. {
  504. if(IsPlayerConnected(playerid))
  505. {
  506.  
  507. if(IsPlayerInRangeOfPoint(playerid,15.0,-1328.8250,2677.2173,49.7665) || IsPlayerInRangeOfPoint(playerid,15.0,70.3882,1218.6783,18.5165))
  508. {//LV
  509. return 1;
  510. }
  511. else if(IsPlayerInRangeOfPoint(playerid,15.0,2146.5759,2750.8442,10.6447) || IsPlayerInRangeOfPoint(playerid,15.0,2146.8779,2739.6157,10.6435))
  512. {//LV2
  513. return 1;
  514. }
  515. else if(IsPlayerInRangeOfPoint(playerid,15.0,-90.5515,-1169.4578,2.4079) || IsPlayerInRangeOfPoint(playerid,15.0,-1609.7958,-2718.2048,48.5391))
  516. {//LS
  517. return 1;
  518. }
  519. else if(IsPlayerInRangeOfPoint(playerid,15.0,1595.3046,2191.1331,10.6454) || IsPlayerInRangeOfPoint(playerid,15.0,1596.3274,2206.7070,10.6449))
  520. {//LV3
  521. return 1;
  522. }
  523. else if(IsPlayerInRangeOfPoint(playerid,15.0,-736.9305,2742.6138,47.0158))
  524. {//Landtankstelle
  525. return 1;
  526. }
  527. }
  528. return 0;
  529. }
  530. public Checargas()
  531. {
  532. for(new i=0;i<MAX_PLAYERS;i++)
  533. {
  534. if(IsPlayerConnected(i))
  535. {
  536. if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
  537. {
  538. if(Gas[GetPlayerVehicleID(i)] >= 1)
  539. {
  540. Gas[GetPlayerVehicleID(i)]--;
  541. }
  542. }
  543. }
  544. }
  545. return 1;
  546. }
  547.  
  548.  
  549. public Veiculoparado()
  550. {
  551. for(new i=0; i<MAX_PLAYERS; i++)
  552. {
  553. if(IsPlayerConnected(i))
  554. {
  555. if(IsPlayerInAnyVehicle(i))
  556. {
  557. GetPlayerPos(i, x, y, z);
  558. Distancia = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
  559. Valor = floatround(Distancia * 3600);
  560. if(UpdateSeconds > 1)
  561. {
  562. Valor = floatround(Valor / UpdateSeconds);
  563. }
  564. if(Valor == 0)
  565. {
  566. Gas[GetPlayerVehicleID(i)]++;
  567. }
  568. SavePlayerPos[i][LastX] = x;
  569. SavePlayerPos[i][LastY] = y;
  570. SavePlayerPos[i][LastZ] = z;
  571. }
  572. }
  573. }
  574. return 1;
  575. }
  576.  
  577. public APetrobras()
  578. {
  579. for(new i=0; i<MAX_PLAYERS; i++)
  580. {
  581. if(IsPlayerConnected(i))
  582. {
  583. Petrobrasup = GasMax - Gas[GetPlayerVehicleID(i)];
  584. if(AbasPetro[i] == 1)
  585. {
  586. PrecoPetro = Petrobrasup * 10;
  587. if(GetPlayerMoney(i) >= PrecoPetro)
  588. {
  589. Gas[GetPlayerVehicleID(i)] += Petrobrasup;
  590. format(string,sizeof(string),"[PETROBRAS]Enchemos o seu Tanque Por Apenas R$%d!",PrecoPetro);
  591. SendClientMessage(i,AMARELO,string);
  592. SendClientMessage(i,AMARELO,"A Petrobras Agradeçe a Sua Preferencia! VOLTE SEMPRE !");
  593. GivePlayerMoney(i,-PrecoPetro);
  594. if(PrecoPetro > 0)
  595. PrecoPetro = 0;
  596. AbasPetro[i] = 0;
  597. }
  598. else
  599. {
  600. format(string,sizeof(string),"[PETROBRAS]Você Precisa de R$%d para encher o Tanque!",PrecoPetro);
  601. SendClientMessage(i,AMARELO,string);
  602. }
  603. }
  604. }
  605. }
  606. return 1;
  607. }
  608. public ATexaco()
  609. {
  610. for(new i=0; i<MAX_PLAYERS; i++)
  611. {
  612. if(IsPlayerConnected(i))
  613. {
  614. Texacoup = GasMax - Gas[GetPlayerVehicleID(i)];
  615. if(AbasTexaco[i] == 1)
  616. {
  617. PrecoTexaco = Texacoup * 10;
  618. if(GetPlayerMoney(i) >= PrecoTexaco)
  619. {
  620. Gas[GetPlayerVehicleID(i)] += Texacoup;
  621. format(string,sizeof(string),"[TEXACO]Enchemos o seu Tanque Por Apenas R$%d!",PrecoTexaco);
  622. SendClientMessage(i,VERMELHO,string);
  623. GivePlayerMoney(i,-PrecoTexaco);
  624. if(PrecoTexaco > 0)
  625. PrecoTexaco = 0;
  626. AbasTexaco[i] = 0;
  627. }
  628. else
  629. {
  630. format(string,sizeof(string),"[TEXACO]Você Precisa de R$%d para encher o Tanque!",PrecoTexaco);
  631. SendClientMessage(i,VERMELHO,string);
  632. }
  633. }
  634. }
  635. }
  636. return 1;
  637. }
  638. public OnPlayerStateChange(playerid, newstate, oldstate) //All this made Hiddos, so credits to him :D
  639. {
  640. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  641. {
  642. if(IsABike(GetPlayerVehicleID(playerid)))
  643. {
  644. switch(GetPlayerSkin(playerid))
  645. {
  646. #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
  647. case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
  648. case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
  649. case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  650. case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  651. case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  652. case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
  653. case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  654. case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  655. case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  656. case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  657. case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  658. case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  659. case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
  660. case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
  661. case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
  662. case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  663. case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  664. case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
  665. case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  666. case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
  667. case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
  668. case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
  669. case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
  670. case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  671. case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  672. }
  673. }
  674. }
  675. else
  676. {
  677. }
  678. return 1;
  679. }
  680. public Capacete(playerid){
  681. RemovePlayerAttachedObject(playerid, SLOT);
  682. return 1;}
  683. stock IsABike(vehicleid) //Made by me :D
  684. {
  685. new result;
  686. new model = GetVehicleModel(vehicleid);
  687. switch(model)
  688. {
  689. case 509, 481, 510, 462, 448, 581, 522, 461, 521, 523, 463, 586, 468, 471: result = model;
  690. default: result = 0;
  691. }
  692. return result;
  693. }
  694. stock VelocidadeKM(playerid)
  695. {
  696. if(IsPlayerInAnyVehicle(playerid))
  697. {
  698. GetVehicleVelocity(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]);
  699. pos[3] = floatmul(floatsqroot(floatadd(floatadd(floatpower(pos[0], 2), floatpower(pos[1], 2)), floatpower(pos[2], 2))), 170.0);
  700. spe = floatround(pos[3] * 1);
  701. }
  702. else
  703. return false;
  704. return spe;
  705. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement