Guest User

Untitled

a guest
May 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.92 KB | None | 0 0
  1. //===============================================================================================//
  2. //---Include----//
  3. //===============================================================================================//
  4. #include <a_samp>
  5. //===============================================================================================//
  6. #define COLOR_RED 0xAA3333AA
  7. #define nolanzado 0
  8. #define lanzado 1
  9. #define COLOR_GREEN "{6EF83C}"
  10. //===============================================================================================//
  11. //---Variable----//
  12. //===============================================================================================//
  13. new Text:bar[MAX_PLAYERS];
  14. new Text:boxbar[MAX_PLAYERS];
  15. new EnAuto[MAX_PLAYERS];
  16. new Float:healthcar;
  17. new Menu:MenuRC;
  18. new Text:Recargar;
  19. new Bandito;
  20. new Tanke;
  21. new Heli;
  22. new Baron;
  23. new Cam;
  24. new c1;
  25. new c2;
  26. new c3;
  27. new c4;
  28. new c5;
  29. new c6;
  30. new misil;
  31. new dinamita;
  32. new estado;
  33. new EscogioAuto[MAX_PLAYERS];
  34. new Text:TLogo1[MAX_PLAYERS];
  35. new Text:TLogo2[MAX_PLAYERS];
  36. new Text:TLogo3[MAX_PLAYERS];
  37. new Text:TLogo4[MAX_PLAYERS];
  38. new Text:TLogo5[MAX_PLAYERS];
  39. new Text:TLogo6[MAX_PLAYERS];
  40. //===============================================================================================//
  41. //---Forwards----//
  42. //===============================================================================================//
  43. forward camera1();
  44. forward camera2();
  45. forward camera3();
  46. forward camera4();
  47. forward camera5();
  48. forward camera6();
  49. forward BanditPos(vehicleid);
  50. forward HeliPos(vehicleid);
  51. forward TankPos(vehicleid);
  52. forward BaronPos(vehicleid);
  53. forward CamPos(vehicleid);
  54. forward menu(playerid);
  55. forward ActualizarTextdrawHP(playerid);
  56. forward ActualizarTextdrawBAR(playerid);
  57. forward explode();
  58. forward timeractivar();
  59. forward barraoff();
  60. forward explotarcam();
  61. forward explotarminas();
  62. forward cuenta1(playerid);
  63. forward cuenta2(playerid);
  64. forward cuenta3(playerid);
  65. forward cuenta4(playerid);
  66. forward cuenta5(playerid);
  67. forward cuenta6(playerid);
  68. forward explotardinamita();
  69. //===============================================================================================//
  70.  
  71. //===============================================================================================//
  72.  
  73. new Float:gRandomBanditSpawn[2][3] = {
  74. {-1131.2023,1057.7405,1345.5339},
  75. {-974.0007,1061.7638,1344.7887}
  76. };
  77. //===============================================================================================//
  78.  
  79. //===============================================================================================//
  80. new Float:gRandomHeliSpawn[2][3] = {
  81. {-1131.9438,1041.8555,1345.1920},
  82. {-973.4492,1077.2356,1344.4493}
  83. };
  84. //===============================================================================================//
  85.  
  86. //===============================================================================================//
  87. new Float:gRandomTankSpawn[2][3] = {
  88. {-973.2541,1023.8723,1344.2207},
  89. {-1133.8323,1094.9630,1344.9735}
  90. };
  91. //===============================================================================================//
  92.  
  93. //===============================================================================================//
  94. new Float:gRandomBaronSpawn[2][3] = {
  95. {-1131.8693,1029.0829,1345.0251},
  96. {-975.5798,1090.0739,1344.2656}
  97. };
  98. //===============================================================================================//
  99.  
  100. //===============================================================================================//
  101. new Float:gRandomCamSpawn[2][3] = {
  102. {-973.1904,1042.2570,1351.8818},
  103. {-1132.7958,1077.9701,1352.6290}
  104. };
  105. //===============================================================================================//
  106.  
  107. //===============================================================================================//
  108.  
  109. main()
  110. {
  111. print(" ");
  112. print(" ");
  113. print(" ___________________________________");
  114. print(" | | ");
  115. print(" | HostName: TEST | ");
  116. print(" | Sa-Mp: 0.3d | ");
  117. print(" | GameMode: TEST | ");
  118. print(" | MapName: San Andreas | ");
  119. print(" | WebSite: TEST | ");
  120. print(" | Credits: SAMP | ");
  121. print(" |___________________________________| ");
  122. print(" ");
  123. print(" ");
  124. }
  125.  
  126. //===============================================================================================//
  127.  
  128. public OnGameModeInit()
  129. {
  130. SetGameModeText("RC WAR");
  131. SetWeather(20);
  132. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  133.  
  134. MenuRC = CreateMenu("RC Menu", 1, 50.0, 180.0, 200.0, 200.0);
  135. SetMenuColumnHeader(MenuRC, 0, "Vehiculos RC");
  136. AddMenuItem(MenuRC, 0, "Bandito");
  137. AddMenuItem(MenuRC, 0, "Tanke");
  138. AddMenuItem(MenuRC, 0, "Helicoptero");
  139. AddMenuItem(MenuRC, 0, "Baron");
  140. AddMenuItem(MenuRC, 0, "Cam");
  141.  
  142. Recargar = TextDrawCreate(1.000000,310.000000,"recarga en:--");
  143. TextDrawAlignment(Recargar,0);
  144. TextDrawBackgroundColor(Recargar,0xffff00cc);
  145. TextDrawFont(Recargar,3);
  146. TextDrawLetterSize(Recargar,0.499999,1.500000);
  147. TextDrawColor(Recargar,0xff0000ff);
  148. TextDrawSetOutline(Recargar,1);
  149. TextDrawSetProportional(Recargar,1);
  150. TextDrawSetShadow(Recargar,8);
  151. return 1;
  152. }
  153.  
  154. //===============================================================================================//
  155.  
  156. public OnPlayerConnect(playerid)
  157. {
  158. c1 = SetTimer("camera1",1000,0);
  159. c2 = SetTimer("camera2",2000,0);
  160. c3 = SetTimer("camera3",3000,0);
  161. c4 = SetTimer("camera4",4000,0);
  162. c5 = SetTimer("camera5",5000,0);
  163. c6 = SetTimer("camera6",6000,0);
  164. EscogioAuto[playerid]= 0;
  165. TLogo1[playerid] = TextDrawCreate(558.000000, 413.000000, "gSpeed");
  166. TextDrawBackgroundColor(TLogo1[playerid], 255); TextDrawFont(TLogo1[playerid], 3);
  167. TextDrawLetterSize(TLogo1[playerid], 0.769999, 2.399999); TextDrawColor(TLogo1[playerid], -1375785046);
  168. TextDrawSetOutline(TLogo1[playerid], 1); TextDrawSetProportional(TLogo1[playerid], 1);
  169. TLogo2[playerid] = TextDrawCreate(529.000000, 400.000000, "]");
  170. TextDrawBackgroundColor(TLogo2[playerid], 255); TextDrawFont(TLogo2[playerid], 3);
  171. TextDrawLetterSize(TLogo2[playerid], 0.500000, 2.099999); TextDrawColor(TLogo2[playerid], -6160129);
  172. TextDrawSetOutline(TLogo2[playerid], 1); TextDrawSetProportional(TLogo2[playerid], 1);
  173. TLogo3[playerid] = TextDrawCreate(577.000000, 387.000000, "]");
  174. TextDrawBackgroundColor(TLogo3[playerid], 255); TextDrawFont(TLogo3[playerid], 0);
  175. TextDrawLetterSize(TLogo3[playerid], 0.460000, 1.599999); TextDrawColor(TLogo3[playerid], -1);
  176. TextDrawSetOutline(TLogo3[playerid], 1); TextDrawSetProportional(TLogo3[playerid], 1);
  177. TLogo4[playerid] = TextDrawCreate(546.000000, 379.000000, "]");
  178. TextDrawBackgroundColor(TLogo4[playerid], 255); TextDrawFont(TLogo4[playerid], 0);
  179. TextDrawLetterSize(TLogo4[playerid], 0.660000, 2.199999); TextDrawColor(TLogo4[playerid], -1);
  180. TextDrawSetOutline(TLogo4[playerid], 1); TextDrawSetProportional(TLogo4[playerid], 1);
  181. TLogo5[playerid] = TextDrawCreate(600.000000, 398.000000, "]");
  182. TextDrawBackgroundColor(TLogo5[playerid], 255); TextDrawFont(TLogo5[playerid], 0);
  183. TextDrawLetterSize(TLogo5[playerid], 0.400000, 1.199999); TextDrawColor(TLogo5[playerid], -1);
  184. TextDrawSetOutline(TLogo5[playerid], 1); TextDrawSetProportional(TLogo5[playerid], 1);
  185. TLogo6[playerid] = TextDrawCreate(532.000000, 397.000000, "War");
  186. TextDrawBackgroundColor(TLogo6[playerid], 255); TextDrawFont(TLogo6[playerid], 0);
  187. TextDrawLetterSize(TLogo6[playerid], 0.769999, 2.399999); TextDrawColor(TLogo6[playerid], -1029514582);
  188. TextDrawSetOutline(TLogo6[playerid], 1); TextDrawSetProportional(TLogo6[playerid], 1);
  189. //===============================================================================================//
  190. bar[playerid]= TextDrawCreate(502.000000,105.000000," ");
  191. TextDrawUseBox( bar[playerid],1);
  192. TextDrawBoxColor( bar[playerid],0x00ff0033);
  193. TextDrawTextSize( bar[playerid],605.000000,36.000000);
  194. TextDrawAlignment( bar[playerid],0);
  195. TextDrawBackgroundColor( bar[playerid],0x000000ff);
  196. TextDrawFont( bar[playerid],3);
  197. TextDrawLetterSize( bar[playerid],0.299999,0.599999);
  198. TextDrawColor( bar[playerid],0xffffffff);
  199. TextDrawSetOutline( bar[playerid],1);
  200. TextDrawSetShadow( bar[playerid],1);
  201. //===============================================================================================//
  202. boxbar[playerid] = TextDrawCreate(498.000000,102.000000,"healbar");
  203. TextDrawUseBox(boxbar[playerid] ,1);
  204. TextDrawBoxColor(boxbar[playerid] ,0x00000033);
  205. TextDrawTextSize(boxbar[playerid] ,612.000000,13.000000);
  206. TextDrawAlignment(boxbar[playerid] ,0);
  207. TextDrawBackgroundColor(boxbar[playerid] ,0x00000000);
  208. TextDrawFont(boxbar[playerid] ,3);
  209. TextDrawLetterSize(boxbar[playerid] ,1.200000,1.500000);
  210. TextDrawColor(boxbar[playerid] ,0x00000000);
  211. TextDrawSetOutline(boxbar[playerid] ,1);
  212. TextDrawSetProportional(boxbar[playerid] ,1);
  213. TextDrawSetShadow(boxbar[playerid] ,1);
  214. //===============================================================================================//
  215. new pName[MAX_PLAYER_NAME];
  216. new string[48];
  217. GetPlayerName(playerid, pName, sizeof(pName));
  218. format(string, sizeof(string), "%s A intrat pe TEST (connected)", pName);
  219. SendClientMessageToAll(0x33AA33AA, string);
  220. EnAuto[playerid]=0;
  221. SendClientMessage(playerid, 0xFF0000AA, "Bine ai venit pe TEST War");
  222. SendClientMessage(playerid, 0xFF0000AA, "Pentru informati scrieti /info");
  223. return 1;
  224. }
  225.  
  226. //===============================================================================================//
  227.  
  228. public OnPlayerDisconnect(playerid, reason)
  229. {
  230. new pName[MAX_PLAYER_NAME];
  231. new string[56];
  232. GetPlayerName(playerid, pName, sizeof(pName));
  233. switch(reason)
  234. {
  235. case 0: format(string, sizeof(string), "%s Keep It is a mistake. (Timeout)", pName);
  236. case 1: format(string, sizeof(string), "%s It is aldehyde Server. (Leaving)", pName);
  237. case 2: format(string, sizeof(string), "%s Has been expelled from the server. (Kicked/Baned)", pName);
  238. }
  239. SendClientMessageToAll(0x33AA33AA, string);
  240. EscogioAuto[playerid]= 0;
  241. EnAuto[playerid]=0;
  242. return 1;
  243. }
  244.  
  245. //===============================================================================================//
  246.  
  247. public OnPlayerSelectedMenuRow(playerid, row)
  248. {
  249. EscogioAuto[playerid]= 0;
  250. new Menu:CurrentMenu = GetPlayerMenu(playerid);
  251. if(CurrentMenu == MenuRC)
  252. {
  253. switch(row)
  254. {
  255. case 0:
  256. {
  257. EscogioAuto[playerid]= 1;
  258. new Float:x,Float:y,Float:z,Float:angulo;
  259. TogglePlayerControllable(playerid,1);
  260. GetPlayerPos(playerid,x,y,z);
  261. LinkVehicleToInterior(Bandito,10);
  262. Bandito = CreateVehicle(441,x,y,z,angulo,-1,-1,0);
  263. PutPlayerInVehicle(playerid,Bandito,0);
  264. SetVehicleVirtualWorld(Bandito, GetPlayerVirtualWorld(playerid));
  265. LinkVehicleToInterior(Bandito, GetPlayerInterior(playerid));
  266. SetTimer("BanditPos",500,0);
  267. SetCameraBehindPlayer(playerid);
  268. HideMenuForPlayer(MenuRC,playerid);
  269. }
  270. case 1:
  271. {
  272. EscogioAuto[playerid]= 1;
  273. new Float:x,Float:y,Float:z,Float:angulo;
  274. GetPlayerPos(playerid,x,y,z);
  275. TogglePlayerControllable(playerid,1);
  276. LinkVehicleToInterior(Tanke,10);
  277. SetCameraBehindPlayer(playerid);
  278. Tanke = CreateVehicle(564,x,y,z,angulo,-1,-1,0);
  279. PutPlayerInVehicle(playerid,Tanke,0);
  280. SetVehicleVirtualWorld(Tanke, GetPlayerVirtualWorld(playerid));
  281. LinkVehicleToInterior(Tanke, GetPlayerInterior(playerid));
  282. SetTimer("TankPos",500,0);
  283. HideMenuForPlayer(MenuRC,playerid);
  284. }
  285. case 2:
  286. {
  287. EscogioAuto[playerid]= 1;
  288. new Float:x,Float:y,Float:z,Float:angulo;
  289. GetPlayerPos(playerid,x,y,z);
  290. SetCameraBehindPlayer(playerid);
  291. TogglePlayerControllable(playerid,1);
  292. LinkVehicleToInterior(Heli,10);
  293. Heli = CreateVehicle(501,x,y,z,angulo,-1,-1,0);
  294. PutPlayerInVehicle(playerid,Heli,0);
  295. SetVehicleVirtualWorld(Heli, GetPlayerVirtualWorld(playerid));
  296. LinkVehicleToInterior(Heli, GetPlayerInterior(playerid));
  297. SetTimer("HeliPos",500,0);
  298. HideMenuForPlayer(MenuRC,playerid);
  299. }
  300. case 3:
  301. {
  302. EscogioAuto[playerid]= 1;
  303. new Float:x,Float:y,Float:z,Float:angulo;
  304. GetPlayerPos(playerid,x,y,z);
  305. SetCameraBehindPlayer(playerid);
  306. LinkVehicleToInterior(Baron,10);
  307. Baron = CreateVehicle(464,x,y,z,angulo,-1,-1,0);
  308. PutPlayerInVehicle(playerid,Baron,0);
  309. TogglePlayerControllable(playerid,1);
  310. SetVehicleVirtualWorld(Baron, GetPlayerVirtualWorld(playerid));
  311. LinkVehicleToInterior(Baron, GetPlayerInterior(playerid));
  312. SetTimer("BaronPos",500,0);
  313. HideMenuForPlayer(MenuRC,playerid);
  314. }
  315. case 4:
  316. {
  317. EscogioAuto[playerid]= 1;
  318. new Float:x,Float:y,Float:z,Float:angulo;
  319. GetPlayerPos(playerid,x,y,z);
  320. LinkVehicleToInterior(Cam,10);
  321. SetCameraBehindPlayer(playerid);
  322. Cam = CreateVehicle(594,x,y,z,angulo,-1,-1,0);
  323. PutPlayerInVehicle(playerid,Cam,0);
  324. TogglePlayerControllable(playerid,1);
  325. SetVehicleVirtualWorld(Cam, GetPlayerVirtualWorld(playerid));
  326. LinkVehicleToInterior(Cam, GetPlayerInterior(playerid));
  327. SetTimer("CamPos",500,0);
  328. HideMenuForPlayer(MenuRC,playerid);
  329. }
  330. }
  331. }
  332. }
  333.  
  334. //===============================================================================================//
  335.  
  336. public OnPlayerExitedMenu(playerid)
  337. {
  338. if(EscogioAuto[playerid] == 0)
  339. {
  340. SetPlayerHealth(playerid,0);
  341. SendClientMessage(playerid, 0xFF0000AA, "You have to choose a vehicle");
  342. }
  343. return 1;
  344. }
  345.  
  346. //===============================================================================================//
  347.  
  348. public OnPlayerSpawn(playerid)
  349. {
  350. KillTimer(c1);
  351. KillTimer(c2);
  352. KillTimer(c3);
  353. KillTimer(c4);
  354. KillTimer(c5);
  355. KillTimer(c6);
  356. TogglePlayerControllable(playerid,0);
  357. SetPlayerInterior(playerid,10);
  358. SetPlayerPos(playerid,-1079.99, 1061.58, 1359.04);
  359. SetTimerEx("menu", 100, 0, "i", playerid);
  360. return 1;
  361. }
  362.  
  363. public OnPlayerRequestClass(playerid, classid)
  364. {
  365. SetPlayerInterior(playerid,10);
  366. SetPlayerCameraPos( playerid, -988.2770, 1042.0469, 1376.8139 );
  367. SetPlayerCameraLookAt( playerid, -997.8896, 1044.8033, 1372.4302 );
  368. return 1;
  369. }
  370.  
  371. //===============================================================================================//
  372.  
  373. public OnPlayerDeath(playerid, killerid, reason)
  374. {
  375. new Float:x,Float:y,Float:z;
  376. EscogioAuto[playerid] = 0;
  377. TextDrawHideForPlayer(playerid,boxbar[playerid]);
  378. TextDrawHideForPlayer(playerid,bar[playerid]);
  379. SetPlayerInterior(playerid,10);
  380. new veh = GetPlayerVehicleID(playerid);
  381. DestroyVehicle(veh);
  382. ForceClassSelection(playerid);
  383. SendDeathMessage(killerid, playerid, reason);
  384. GetPlayerPos(playerid,x,y,z);
  385. SetPlayerCameraPos( playerid,x,y+10,z+5);
  386. SetPlayerCameraLookAt( playerid,x,y,z);
  387. GameTextForPlayer(playerid,"~g~d~r~e~w~a~b~t~p~h",2000,1);
  388. return 1;
  389. }
  390.  
  391. //===============================================================================================//
  392.  
  393. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  394. {
  395. new keys, updown, leftright;
  396. GetPlayerKeys(playerid, keys, updown, leftright);
  397. if(estado==nolanzado){
  398. if(GetVehicleModel(GetPlayerVehicleID(playerid))== 501) {
  399. if( ((keys & KEY_FIRE) == KEY_FIRE) || ((keys & KEY_ACTION) == KEY_ACTION) ) {
  400. new Float:x,Float:y,Float:z;
  401. GetPlayerPos(playerid,x,y,z);
  402. misil = CreateObject(1636,x,y,z-0.5,-90,0,0);
  403. MoveObject(misil,x,y,z-11,10);
  404. SetTimer("explode", 1000, 0);
  405. SetTimer("barraoff", 4000, 0);
  406. SetTimer("timeractivar", 1500, 0);
  407. estado = lanzado;
  408. }
  409. }
  410. }
  411.  
  412. if(estado==nolanzado){
  413. if(GetVehicleModel(GetPlayerVehicleID(playerid))== 564) {
  414. if( ((keys & KEY_FIRE) == KEY_FIRE) || ((keys & KEY_ACTION) == KEY_ACTION) ) {
  415. new Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:az;
  416. GetPlayerPos(playerid,x,y,z);
  417. GetVehicleZAngle(GetPlayerVehicleID(playerid), az);
  418. x2 = x + (8.5 * floatsin(-az+5, degrees));
  419. y2 = y + (16 * floatcos(-az+5, degrees));
  420. CreateExplosion(x2,y2,z,3,4.0);
  421. SetTimer("timeractivar", 2000, 0);
  422. estado = lanzado;
  423. }
  424. }
  425. }
  426.  
  427. if(estado==nolanzado){
  428. if(GetVehicleModel(GetPlayerVehicleID(playerid))== 441) {
  429. if( ((keys & KEY_FIRE) == KEY_FIRE) || ((keys & KEY_ACTION) == KEY_ACTION) ) {
  430. new Float:x,Float:y,Float:z;
  431. GetPlayerPos(playerid,x,y,z);
  432. dinamita = CreateObject(1654,x,y,z+0.5,90,0,0);
  433. SetTimer("explotardinamita", 2000, 0);
  434. SetTimer("timeractivar", 3000, 0);
  435. estado = lanzado;
  436. }
  437. }
  438. }
  439.  
  440. if(estado==nolanzado){
  441. if(GetVehicleModel(GetPlayerVehicleID(playerid))== 594) {
  442. if( ((keys & KEY_FIRE) == KEY_FIRE) || ((keys & KEY_ACTION) == KEY_ACTION) ) {
  443. new Float:x,Float:y,Float:z;
  444. GetPlayerPos(playerid,x,y,z);
  445. SetTimer("explotarcam", 5500, 0);
  446. SetTimer("barraoff", 4000, 0);
  447. SetTimer("timeractivar", 7000, 0);
  448. SetTimerEx("boom1", 1000, 0, "i", playerid);
  449. estado = lanzado;
  450. }
  451. }
  452. }
  453. }
  454.  
  455. //===============================================================================================//
  456.  
  457. public timeractivar()
  458. {
  459. for(new playerid;playerid<MAX_PLAYERS;playerid++){
  460. if(IsPlayerInVehicle(playerid, Heli)) {
  461. new Float:x,Float:y,Float:z;
  462. GetPlayerPos(playerid,x,y,z);
  463. }
  464. }
  465. estado = nolanzado;
  466. return estado;
  467. }
  468.  
  469. //===============================================================================================//
  470.  
  471. public OnPlayerText(playerid, text[])
  472. {
  473. new senderName[MAX_PLAYER_NAME];
  474. new string[256];
  475. GetPlayerName(playerid, senderName, sizeof(senderName));
  476. format(string, sizeof(string),"[ID:%d]:%s", playerid, text);
  477. SendPlayerMessageToAll(playerid, string);
  478. return 0;
  479. }
  480.  
  481. //===============================================================================================//
  482. //---Comanda: /info---//
  483. //===============================================================================================//
  484. public OnPlayerCommandText(playerid, cmdtext[])
  485. {
  486. if (strcmp("/info", cmdtext, true, 10) == 0)
  487. {
  488. SendClientMessage(playerid,0x33AA33AA,"» -------------[Server Info]-------------<");
  489. SendClientMessage(playerid,0x33AA33AA,"» 1.Name:*TEST*[0.3d]");
  490. SendClientMessage(playerid,0x33AA33AA,"» 2.Ip: 93.114.82.66:7777");
  491. SendClientMessage(playerid,0x33AA33AA,"» 3.Date Of Inauguration: xx.xx.xx");
  492. SendClientMessage(playerid,0x33AA33AA,"» 4.Slots: 50");
  493. SendClientMessage(playerid,0xFF0000AA,"» 5.Version: War gS v1.1");
  494. SendClientMessage(playerid,0x33AA33AA,"» 6.Owners: rodricaz");
  495. SendClientMessage(playerid,0x33AA33AA,"» 7.Scripter: RuSke");
  496. SendClientMessage(playerid,0x33AA33AA,"» 8.Forum: .com");
  497. SendClientMessage(playerid,0x33AA33AA,"» 9.Map: San Andreas");
  498. SendClientMessage(playerid,0x33AA33AA,"» 10.Map: Distractie placuta pe server test War!!");
  499. return 1;
  500. }
  501. return 0;
  502. }
  503. //===============================================================================================//
  504.  
  505. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  506. {
  507. return 1;
  508. }
  509.  
  510. //===============================================================================================//
  511.  
  512. public OnPlayerExitVehicle(playerid, vehicleid)
  513. {
  514. SendClientMessage(playerid, 0xFF0000AA, "You can not leave your car if you can not pass this");
  515. SetPlayerHealth(playerid,0);
  516. return 1;
  517. }
  518.  
  519. //===============================================================================================//
  520.  
  521. public OnPlayerStateChange(playerid, newstate, oldstate)
  522. {
  523. if (newstate == PLAYER_STATE_DRIVER)
  524. {
  525. SetTimerEx("ActualizarTextdrawHP",100,1,"i",playerid);
  526. SetTimerEx("ActualizarTextdrawBAR",100,1,"i",playerid);
  527. TextDrawShowForPlayer(playerid,boxbar[playerid]);
  528. EnAuto[playerid]=1;
  529. }
  530. else if (newstate == PLAYER_STATE_ONFOOT)
  531. {
  532. TextDrawHideForPlayer(playerid,boxbar[playerid]);
  533. EnAuto[playerid]=0;
  534. }
  535. return 1;
  536. }
  537.  
  538. //===============================================================================================//
  539.  
  540. public menu(playerid)
  541. {
  542. TogglePlayerControllable(playerid,0);
  543. ShowMenuForPlayer(MenuRC, playerid);
  544. }
  545.  
  546. //===============================================================================================//
  547.  
  548. public explotardinamita()
  549. {
  550. new Float:x,Float:y,Float:z;
  551. GetObjectPos(dinamita,x,y,z);
  552. CreateExplosion(x,y,z,11,20);
  553. DestroyObject(dinamita);
  554. }
  555.  
  556. //===============================================================================================//
  557.  
  558. public explotarcam()
  559. {
  560. for(new playerid=0;playerid<MAX_PLAYERS;playerid++) {
  561. new Float:x,Float:y,Float:z;
  562. GetVehiclePos(playerid,x,y,z);
  563. CreateExplosion(x,y,z,11,50);
  564. }
  565. }
  566.  
  567. //===============================================================================================//
  568.  
  569. public cuenta1(playerid)
  570. {
  571. PlayerPlaySound(playerid,1057 ,0.0,0.0,0.0);
  572. GameTextForPlayer(playerid, "~r~5", 500, 4);
  573. SetTimerEx("cuenta2",1000,0,"i",playerid);
  574. }
  575.  
  576. //===============================================================================================//
  577.  
  578. public cuenta2(playerid)
  579. {
  580. PlayerPlaySound(playerid,1057 ,0.0,0.0,0.0);
  581. GameTextForPlayer(playerid, "~r~4", 500, 4);
  582. SetTimerEx("cuenta3",1000,0,"i",playerid);
  583. }
  584.  
  585. //===============================================================================================//
  586.  
  587. public cuenta3(playerid)
  588. {
  589. PlayerPlaySound(playerid,1057 ,0.0,0.0,0.0);
  590. GameTextForPlayer(playerid, "~r~3", 500, 4);
  591. SetTimerEx("cuenta4",1000,0,"i",playerid);
  592. }
  593.  
  594. //===============================================================================================//
  595.  
  596. public cuenta4(playerid)
  597. {
  598. PlayerPlaySound(playerid,1057 ,0.0,0.0,0.0);
  599. GameTextForPlayer(playerid, "~r~2", 500, 4);
  600. SetTimerEx("cuenta5",1000,0,"i",playerid);
  601. }
  602.  
  603. //===============================================================================================//
  604.  
  605. public cuenta5(playerid)
  606. {
  607. PlayerPlaySound(playerid,1057 ,0.0,0.0,0.0);
  608. GameTextForPlayer(playerid, "~r~1", 500, 4);
  609. SetTimerEx("cuenta6",1000,0,"i",playerid);
  610. }
  611.  
  612. //===============================================================================================//
  613.  
  614. public cuenta6(playerid)
  615. {
  616. PlayerPlaySound(playerid,1057 ,0.0,0.0,0.0);
  617. GameTextForPlayer(playerid, "~r~boooooom", 2000, 6);
  618. }
  619.  
  620. //===============================================================================================//
  621.  
  622. public CamPos(vehicleid)
  623. {
  624. AddVehicleComponent(Cam,1074);
  625. new rand = random(sizeof(gRandomCamSpawn));
  626. SetVehiclePos(Cam,gRandomCamSpawn[rand][0],gRandomCamSpawn[rand][1],gRandomCamSpawn[rand][2]);
  627. }
  628.  
  629. //===============================================================================================//
  630.  
  631. public BaronPos(vehicleid)
  632. {
  633. new rand = random(sizeof(gRandomBaronSpawn));
  634. SetVehiclePos(Baron,gRandomBaronSpawn[rand][0],gRandomBaronSpawn[rand][1],gRandomBaronSpawn[rand][2]);
  635. }
  636.  
  637. //===============================================================================================//
  638.  
  639. public HeliPos(vehicleid)
  640. {
  641. new rand = random(sizeof(gRandomHeliSpawn));
  642. SetVehiclePos(Heli,gRandomHeliSpawn[rand][0],gRandomHeliSpawn[rand][1],gRandomHeliSpawn[rand][2]);
  643. }
  644.  
  645. //===============================================================================================//
  646.  
  647. public TankPos(vehicleid)
  648. {
  649. AddVehicleComponent(Tanke,1075);
  650. new rand = random(sizeof(gRandomTankSpawn));
  651. SetVehiclePos(Tanke,gRandomTankSpawn[rand][0],gRandomTankSpawn[rand][1],gRandomTankSpawn[rand][2]);
  652. }
  653.  
  654. //===============================================================================================//
  655.  
  656. public BanditPos(vehicleid)
  657. {
  658. AddVehicleComponent(Bandito,1074);
  659. new rand = random(sizeof(gRandomBanditSpawn));
  660. SetVehiclePos(Bandito,gRandomBanditSpawn[rand][0],gRandomBanditSpawn[rand][1],gRandomBanditSpawn[rand][2]);
  661. }
  662.  
  663. //===============================================================================================//
  664.  
  665. public camera1()
  666. {
  667. for(new playerid=0;playerid<MAX_PLAYERS;playerid++) {
  668. SetPlayerInterior(playerid,10);
  669. SetPlayerCameraPos( playerid, -1141.4744, 1093.4582, 1376.8139 );
  670. SetPlayerCameraLookAt( playerid, -1132.7282, 1088.6101, 1372.4302 );
  671. }
  672. }
  673.  
  674. //===============================================================================================//
  675.  
  676. public camera2()
  677. {
  678. for(new playerid=0;playerid<MAX_PLAYERS;playerid++) {
  679. SetPlayerInterior(playerid,10);
  680. SetPlayerCameraPos( playerid, -1074.2387, 1022.4376, 1376.8139 );
  681. SetPlayerCameraLookAt( playerid, -1066.3586, 1028.5922, 1372.4302 );
  682. }
  683. }
  684.  
  685. //===============================================================================================//
  686.  
  687. public camera3()
  688. {
  689. for(new playerid=0;playerid<MAX_PLAYERS;playerid++) {
  690. SetPlayerInterior(playerid,10);
  691. SetPlayerCameraPos( playerid, -988.2770, 1042.0469, 1376.8139 );
  692. SetPlayerCameraLookAt( playerid, -997.8896, 1044.8033, 1372.4302 );
  693. }
  694. }
  695.  
  696. //===============================================================================================//
  697.  
  698. public camera4()
  699. {
  700. for(new playerid=0;playerid<MAX_PLAYERS;playerid++) {
  701. SetPlayerInterior(playerid,10);
  702. SetPlayerCameraPos( playerid, -969.4564, 1054.3924, 1358.3138 );
  703. SetPlayerCameraLookAt( playerid, -979.2670, 1055.2507, 1356.5773 );
  704. }
  705. }
  706.  
  707. //===============================================================================================//
  708.  
  709. public camera5()
  710. {
  711. for(new playerid=0;playerid<MAX_PLAYERS;playerid++) {
  712. SetPlayerInterior(playerid,10);
  713. SetPlayerCameraPos( playerid, -965.9264, 1094.7391, 1358.3138 );
  714. SetPlayerCameraLookAt( playerid, -974.6726, 1089.8909, 1356.5773 );
  715. }
  716. }
  717.  
  718. //===============================================================================================//
  719.  
  720. public camera6()
  721. {
  722. for(new playerid=0;playerid<MAX_PLAYERS;playerid++) {
  723. SetPlayerInterior(playerid,10);
  724. SetPlayerCameraPos( playerid, -1132.4779, 1066.8322, 1358.3138 );
  725. SetPlayerCameraLookAt( playerid, -1122.5751, 1065.4405, 1356.9221 );
  726. }
  727. }
  728.  
  729. //===============================================================================================//
  730.  
  731. public explode()
  732. {
  733. new Float:x,Float:y,Float:z;
  734. GetObjectPos(misil,x,y,z);
  735. DestroyObject(misil);
  736. CreateExplosion(x,y,z,11,20);
  737. }
  738.  
  739. //===============================================================================================//
  740.  
  741. public ActualizarTextdrawBAR(playerid)
  742. {
  743. if(IsPlayerInAnyVehicle(playerid))
  744. {
  745. if(EnAuto[playerid]==1)
  746. {
  747. GetVehicleHealth(GetPlayerVehicleID(playerid), healthcar);
  748. TextDrawHideForPlayer(playerid,bar[playerid]);
  749. TextDrawShowForPlayer(playerid,bar[playerid]);
  750.  
  751. if(healthcar >= 1000 )
  752. {
  753. TextDrawTextSize( bar[playerid],600.000000,38.000000);
  754. TextDrawBoxColor( bar[playerid],0x00ff0033);
  755. }
  756. else if(healthcar >= 950 && healthcar <= 999 )
  757. {
  758. TextDrawTextSize( bar[playerid],595.000000,38.000000);
  759. TextDrawBoxColor( bar[playerid],0x00ff0033);
  760. }
  761. else if(healthcar >= 900 && healthcar <= 949)
  762. {
  763. TextDrawTextSize(bar[playerid],590.000000,38.000000);
  764. TextDrawBoxColor( bar[playerid],0x00ff0033);
  765. }
  766. else if(healthcar >= 850 && healthcar <= 899)
  767. {
  768. TextDrawTextSize(bar[playerid],585.000000,38.000000);
  769. TextDrawBoxColor( bar[playerid],0x00ff0033);
  770. }
  771. else if(healthcar >= 800 && healthcar <= 849)
  772. {
  773. TextDrawTextSize(bar[playerid],580.000000,38.000000);
  774. TextDrawBoxColor( bar[playerid],0x00ff0033);
  775. }
  776. else if(healthcar >= 750 && healthcar <= 799)
  777. {
  778. TextDrawTextSize(bar[playerid],575.000000,38.000000);
  779. TextDrawBoxColor( bar[playerid],0x00ff0033);
  780. }
  781. else if(healthcar >= 700 && healthcar <= 749)
  782. {
  783. TextDrawTextSize(bar[playerid],570.000000,38.000000);
  784. TextDrawBoxColor( bar[playerid],0x00ff0033);
  785. }
  786. else if(healthcar >= 650 && healthcar <= 699)
  787. {
  788. TextDrawTextSize(bar[playerid],565.000000,38.000000);
  789. TextDrawBoxColor( bar[playerid],0x00ff0033);
  790. }
  791. else if(healthcar >= 600 && healthcar <= 649)
  792. {
  793. TextDrawTextSize(bar[playerid],560.000000,38.000000);
  794. TextDrawBoxColor( bar[playerid],0x00ff0033);
  795. }
  796. else if(healthcar >= 550 && healthcar <= 599)
  797. {
  798. TextDrawTextSize(bar[playerid],555.000000,38.000000);
  799. TextDrawBoxColor(bar[playerid],0xffff0099);
  800. }
  801. else if(healthcar >= 500 && healthcar <= 549)
  802. {
  803. TextDrawTextSize(bar[playerid],550.000000,38.000000);
  804. TextDrawBoxColor(bar[playerid],0xffff0099);
  805. }
  806. else if(healthcar >= 450 && healthcar <= 499)
  807. {
  808. TextDrawTextSize(bar[playerid],545.000000,38.000000);
  809. TextDrawBoxColor(bar[playerid],0xffff0099);
  810. }
  811. else if(healthcar >= 400 && healthcar <= 449)
  812. {
  813. TextDrawTextSize(bar[playerid],540.000000,38.000000);
  814. TextDrawBoxColor(bar[playerid],0xffff0099);
  815. }
  816. else if(healthcar >= 350 && healthcar <= 399)
  817. {
  818. TextDrawTextSize(bar[playerid],535.000000,38.000000);
  819. TextDrawBoxColor(bar[playerid],0xff000099);
  820. }
  821. else if(healthcar >= 300 && healthcar <= 349)
  822. {
  823. TextDrawTextSize(bar[playerid],530.000000,38.000000);
  824. TextDrawBoxColor(bar[playerid],0xff000099);
  825. }
  826. else if(healthcar >= 250 && healthcar <= 299)
  827. {
  828. TextDrawTextSize(bar[playerid],525.000000,38.000000);
  829. TextDrawBoxColor(bar[playerid],0xff000099);
  830. }
  831. else if(healthcar >= 200 && healthcar <= 249)
  832. {
  833. TextDrawTextSize(bar[playerid],520.000000,38.000000);
  834. TextDrawBoxColor(bar[playerid],0xff000099);
  835. }
  836. else if(healthcar >= 150 && healthcar <= 199)
  837. {
  838. TextDrawTextSize(bar[playerid],515.000000,38.000000);
  839. TextDrawBoxColor(bar[playerid],0xff000099);
  840. }
  841. else if(healthcar >= 100 && healthcar <= 149)
  842. {
  843. TextDrawTextSize(bar[playerid],510.000000,38.000000);
  844. TextDrawBoxColor(bar[playerid],0xff000099);
  845. }
  846. }
  847. }
  848. else TextDrawHideForPlayer(playerid,bar[playerid]);
  849. }
  850. //=============================================================================================//
  851. public OnGameModeExit()
  852. {
  853. for(new i; i < MAX_PLAYERS; i ++)
  854. {
  855. TextDrawHideForAll(TLogo1[i]); TextDrawDestroy(TLogo1[i]);
  856. TextDrawHideForAll(TLogo2[i]); TextDrawDestroy(TLogo2[i]);
  857. TextDrawHideForAll(TLogo3[i]); TextDrawDestroy(TLogo3[i]);
  858. TextDrawHideForAll(TLogo4[i]); TextDrawDestroy(TLogo4[i]);
  859. TextDrawHideForAll(TLogo5[i]); TextDrawDestroy(TLogo5[i]);
  860. TextDrawHideForAll(TLogo6[i]); TextDrawDestroy(TLogo6[i]);
  861. }
  862. return 1;
  863. }
  864. //===============================================================================================//
  865.  
  866. public ActualizarTextdrawHP(playerid)
  867. {
  868. new string[120];
  869. GetVehicleHealth(GetPlayerVehicleID(playerid), healthcar);
  870. format(string,10,"%.0f",healthcar);
  871. TextDrawSetString(bar[playerid],string);
  872. return 1;
  873. }
  874. //=====================================[Final]==================================//
Add Comment
Please, Sign In to add comment