Advertisement
Guest User

BATTLEFIELD 3 SAMP - Lucas Emmanuel

a guest
Oct 29th, 2012
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.99 KB | None | 0 0
  1. /*
  2.  
  3. BATTLEFIELD 3 SAMP 100% POR LUCAS EMMANUEL
  4.  
  5. LUCAS-FC - SAMP FORUM.
  6.  
  7. SÓ CONSEGUI GRAÇAS A VOCÊS !
  8.  
  9. */
  10.  
  11. /* includes */
  12. #include <a_samp>
  13. #include <zcmd>
  14. #include DOF2
  15. /* Defines */
  16. #define Fuzileiros (1)
  17. #define Israelita (2)
  18. #define Farc (3)
  19.  
  20. #define BOMBATEMPO 15
  21. #define ARMARTEMPO 5
  22.  
  23. #define Azul_Claro 0x00C2ECFF
  24. #define Verde_Claro 0x38FF06FF
  25. #define Cinza_Escuro 0x626262FF
  26. #define Cinza 0xCECECEFF
  27. #define Branco 0xFFFFFFFF
  28.  
  29. #define M4-AK 1
  30. #define PUMP 2
  31.  
  32. #define JSF 1
  33. /* New's */
  34. new Text:Textdraw0;
  35.  
  36. new GuerraB[MAX_PLAYERS];
  37. new guerra;
  38. new TemGuerra;
  39.  
  40. new GzFarC;
  41. new GzFuz;
  42. new GzGi;
  43.  
  44. new Posto;
  45. new EstMi;
  46. new EquiMi;
  47. new EquiTer;
  48. new EquiFar;
  49.  
  50. new ExercitoC [19];
  51. new TerroristasC [16];
  52. new FarcC [16];
  53.  
  54. new BombaRelogio[MAX_PLAYERS];
  55. new MS[MAX_PLAYERS];
  56. new Segundos[MAX_PLAYERS];
  57. new Minutos[MAX_PLAYERS];
  58. new Float:BombX, Float:BombY, Float:BombZ;
  59. new bombplanttime;
  60. new bombtime;
  61. new PlantouBomba[MAX_PLAYERS];
  62. new Text:BombCount;
  63. /* forward's */
  64. forward salario(playerid);
  65. forward guerrat(playerid);
  66. forward BombTime(playerid);
  67. forward BombPlantTime(playerid);
  68. /* -------- */
  69. main()
  70. {
  71. print(" Gamemode Feito Por Lucas Emmanuel ");
  72. }
  73. /* -------- */
  74. public OnGameModeInit()
  75. {
  76. // SetWorldTime(24);
  77. Posto = CreatePickup(1242,1,-375.8249,2260.4480,43.0619);
  78.  
  79. EquiTer = CreatePickup(335,1,-693.1985,959.3026,12.2316);
  80. EquiMi = CreatePickup(334,1,189.3186,1923.1282,17.6406);
  81. EstMi = CreatePickup(1239,1,283.5517,1972.5457,17.6406);
  82. EquiFar = CreatePickup(335,1,-318.2394,2658.2397,63.8692);
  83.  
  84. Create3DTextLabel("Posto Avançado\n {09D6E1}Aperte F",Branco,-375.8249,2260.4480,43.0619,40.0,0,0);
  85.  
  86. Create3DTextLabel("Aperte {09D6E1}F {FFFFFF}Para Equipar",Branco,-318.2394,2658.2397,63.8692,40.0,0,0);
  87. Create3DTextLabel("Aperte {09D6E1}F {FFFFFF}Para Equipar",Branco,-693.1985,959.3026,12.2316,40.0,0,0);
  88. Create3DTextLabel("Estacionamento {09D6E1}Militar",Branco,283.5517,1972.5457,17.6406,40.0,0,0);
  89. Create3DTextLabel("Para Se Equipar\n {09D6E1}Aperte F",Branco,189.3186,1923.1282,17.6406,40.0,0,0);
  90.  
  91. UsePlayerPedAnims();
  92. DisableInteriorEnterExits();
  93. SetGameModeText("BATTLEFIELD 3");
  94.  
  95. AddPlayerClass(287,156.8867,1903.3468,18.6473,269.5479,0,0,0,0,0,0);
  96. AddPlayerClass(210,-253.2915,2604.2185,62.8582,329.9537,0,0,0,0,0,0);
  97. AddPlayerClass(217,-253.2915,2604.2185,62.8582,329.9537,0,0,0,0,0,0);
  98.  
  99. ExercitoC[0] = AddStaticVehicleEx(470,284.29998779,1963.09997559,17.79999924,270.08984375,95,10,45);
  100. ExercitoC[1] = AddStaticVehicleEx(470,284.20001221,1956.19995117,17.79999924,270.08789062,95,10,45);
  101. ExercitoC[2] = AddStaticVehicleEx(470,284.10000610,1948.90002441,17.79999924,270.08789062,95,10,45);
  102. ExercitoC[3] = AddStaticVehicleEx(433,281.89999390,1989.90002441,18.20000076,270.45312500,95,10,45);
  103. ExercitoC[4] = AddStaticVehicleEx(433,281.60000610,1984.59997559,18.20000076,270.45043945,95,10,45);
  104. ExercitoC[5] = AddStaticVehicleEx(433,281.89999390,1995.59997559,18.20000076,270.45043945,95,10,45);
  105. ExercitoC[6] = AddStaticVehicleEx(520,281.20001221,2023.80004883,18.60000038,269.58374023,-1,-1,45);
  106. ExercitoC[7] = AddStaticVehicleEx(425,358.10000610,2065.19995117,18.50000000,89.54687500,95,10,45);
  107. ExercitoC[8] = AddStaticVehicleEx(425,375.39999390,1899.50000000,18.50000000,89.54406738,95,10,45);
  108. ExercitoC[9] = AddStaticVehicleEx(425,375.79998779,1951.59997559,18.50000000,89.54406738,95,10,45);
  109. ExercitoC[10] = AddStaticVehicleEx(520,378.10000610,1997.69995117,18.60000038,89.54687500,-1,-1,45);
  110. ExercitoC[11] = AddStaticVehicleEx(432,300.00000000,2057.80004883,17.70000076,270.45312500,95,10,45);
  111. ExercitoC[12] = AddStaticVehicleEx(432,317.39999390,2057.60009766,17.70000076,270.45043945,95,10,45);
  112. ExercitoC[13] = AddStaticVehicleEx(433,297.70001221,1797.80004883,18.20000076,0.00000000,95,10,45);
  113. ExercitoC[14] = AddStaticVehicleEx(433,319.79998779,1797.90002441,18.20000076,0.00000000,95,10,45);
  114. ExercitoC[15] = AddStaticVehicleEx(433,-372.7287,2255.2021,42.8311,95.9297,95,10,45);
  115. ExercitoC[16] = AddStaticVehicleEx(470,-394.3503,2241.1802,42.4220,285.6273,95,10,45);
  116. ExercitoC[17] = AddStaticVehicleEx(470,-374.4364,2234.3169,42.4765,104.3475,95,10,45);
  117. ExercitoC[18] = AddStaticVehicleEx(433,-363.5634,2210.8430,42.8149,103.7164,95,10,45);
  118.  
  119. TerroristasC[0] = AddStaticVehicleEx(425,-705.79998779,966.59997559,13.30000019,0.00000000,44,1,45);
  120. TerroristasC[1] = AddStaticVehicleEx(560,-668.79998779,945.50000000,11.89999962,359.13061523,44,1,45);
  121. TerroristasC[2] = AddStaticVehicleEx(560,-675.70001221,945.50000000,11.89999962,359.12658691,44,1,45);
  122. TerroristasC[3] = AddStaticVehicleEx(433,-719.79998779,938.20001221,12.69999981,359.13061523,44,1,45);
  123. TerroristasC[4] = AddStaticVehicleEx(470,-696.70001221,932.00000000,12.39999962,0.00000000,44,1,45);
  124. TerroristasC[5] = AddStaticVehicleEx(520,-654.09997559,956.59997559,13.00000000,0.00000000,-1,-1,15);
  125. TerroristasC[6] = AddStaticVehicleEx(473,-638.40002441,862.90002441,0.00000000,317.40002441,44,1,45);
  126. TerroristasC[7] = AddStaticVehicleEx(473,-661.59997559,876.29998779,0.00000000,225.24505615,44,1,45);
  127. TerroristasC[8] = AddStaticVehicleEx(522,-676.59997559,935.09997559,11.80000019,0.00000000,44,1,45);
  128. TerroristasC[9] = AddStaticVehicleEx(522,-672.20001221,935.09997559,11.80000019,0.00000000,44,1,45);
  129. TerroristasC[10] = AddStaticVehicleEx(522,-668.00000000,935.20001221,11.80000019,0.00000000,44,1,45);
  130. TerroristasC[11] = AddStaticVehicleEx(520,-698.20001221,899.50000000,13.39999962,0.00000000,-1,-1,15);
  131. TerroristasC[12] = AddStaticVehicleEx(433,-718.29998779,981.00000000,12.69999981,359.12658691,44,1,45);
  132. TerroristasC[13] = AddStaticVehicleEx(560,-675.50000000,918.59997559,11.89999962,0.00000000,44,1,45);
  133. TerroristasC[14] = AddStaticVehicleEx(560,-681.40002441,918.59997559,11.89999962,0.00000000,44,1,45);
  134.  
  135. FarcC[0] = AddStaticVehicleEx(433,-294.70001221,2667.69995117,63.20000076,89.54687500,1,1,45);
  136. FarcC[1] = AddStaticVehicleEx(433,-272.39999390,2655.89990234,63.20000076,89.54406738,1,1,45);
  137. FarcC[2] = AddStaticVehicleEx(470,-284.50000000,2667.00000000,62.70000076,0.00000000,1,1,45);
  138. FarcC[3] = AddStaticVehicleEx(520,-312.29998779,2679.89990234,63.50000000,0.00000000,1,1,45);
  139. FarcC[4] = AddStaticVehicleEx(470,-295.50000000,2689.00000000,62.79999924,0.00000000,1,1,45);
  140. FarcC[5] = AddStaticVehicleEx(425,-339.89999390,2677.60009766,64.19999695,0.00000000,1,1,45);
  141. FarcC[6] = AddStaticVehicleEx(433,-201.39999390,2608.30004883,63.29999924,0.00000000,1,1,45);
  142. FarcC[7] = AddStaticVehicleEx(433,-213.30000305,2608.60009766,63.29999924,0.00000000,1,1,45);
  143. FarcC[8] = AddStaticVehicleEx(520,-231.39999390,2606.80004883,63.59999847,0.00000000,1,1,45);
  144. FarcC[9] = AddStaticVehicleEx(470,-269.20001221,2674.89990234,62.79999924,269.58374023,1,1,45);
  145. FarcC[10] = AddStaticVehicleEx(433,-327.79998779,2656.10009766,64.30000305,89.54406738,1,1,45);
  146. FarcC[11] = AddStaticVehicleEx(560,-278.79998779,2609.30004883,62.70000076,0.00000000,1,1,45);
  147. FarcC[12] = AddStaticVehicleEx(560,-273.00000000,2609.30004883,62.70000076,0.00000000,1,1,45);
  148. FarcC[13] = AddStaticVehicleEx(560,-267.29998779,2609.19995117,62.70000076,0.00000000,1,1,45);
  149. FarcC[14] = AddStaticVehicleEx(433,-262.29998779,2648.80004883,63.20000076,0.00000000,1,1,45);
  150.  
  151. CreateObject(3279,-280.20001221,2688.10009766,61.70000076,0.00000000,0.00000000,0.00000000); /* Torre HQ Farc */
  152.  
  153. BombCount = TextDrawCreate(270.000000, 397.000000, "00:00:00");
  154. TextDrawBackgroundColor(BombCount, 255);
  155. TextDrawFont(BombCount, 2);
  156. TextDrawLetterSize(BombCount, 0.500000, 2.199999);
  157. TextDrawColor(BombCount, -1);
  158. TextDrawSetOutline(BombCount, 1);
  159. TextDrawSetProportional(BombCount, 1);
  160.  
  161. Textdraw0 = TextDrawCreate(477.000000, 99.000000, "Battlefield 3 SAMP");
  162. TextDrawBackgroundColor(Textdraw0, 255);
  163. TextDrawFont(Textdraw0, 1);
  164. TextDrawLetterSize(Textdraw0, 0.500000, 1.299999);
  165. TextDrawColor(Textdraw0, 0x00C2ECFF);
  166. TextDrawSetOutline(Textdraw0, 1);
  167. TextDrawSetProportional(Textdraw0, 1);
  168.  
  169. GzFarC = GangZoneCreate(-467.115, 2510.743, 35.03363, 2826.046);
  170. GzFuz = GangZoneCreate(-81.74512, 1658.258, 502.1487, 2183.763);
  171. GzGi = GangZoneCreate(-899.1964, 770.7397, -455.4371, 1132.754);
  172. return 1;
  173. }
  174. /* -------- */
  175. public OnGameModeExit()
  176. {
  177. DOF2_Exit();
  178. return 1;
  179. }
  180. /* -------- */
  181. public OnPlayerRequestClass(playerid, classid)
  182. {
  183. switch(classid)
  184. {
  185. case 0:
  186. {
  187. SetPlayerTeam(playerid,Fuzileiros);
  188. GameTextForPlayer(playerid, "~g~ Fuzileiros", 2500, 3);
  189. SetPlayerColor(playerid,Verde_Claro);
  190. SetSpawnInfo(playerid,Fuzileiros,287,156.8867,1903.3468,18.6473,269.5479,0,0,0,0,0,0);
  191.  
  192. }
  193. case 1:
  194. {
  195. SetPlayerTeam(playerid,Israelita);
  196. GameTextForPlayer(playerid, "~b~ Guerrilheiros Israelitas", 2500, 3);
  197. SetPlayerColor(playerid,Azul_Claro);
  198. SetSpawnInfo(playerid,Israelita,210,-688.7601,938.9449,13.6328,176.8548,0,0,0,0,0,0);
  199. }
  200. case 2:
  201. {
  202. SetPlayerTeam(playerid,Farc);
  203. GameTextForPlayer(playerid, "~w~ As Farc", 2500, 3);
  204. SetPlayerColor(playerid,Cinza);
  205. SetSpawnInfo(playerid,Farc,217,-322.4511,2675.4148,63.6797,356.0116,0,0,0,0,0,0);
  206. }
  207. }
  208. SetPlayerPos(playerid,1025.5751,-2140.7637,39.2032);
  209. SetPlayerCameraPos(playerid,1019.7552,-2141.0266,37.7274);
  210. SetPlayerCameraLookAt(playerid,1021.9974,-2140.9907,38.3012);
  211. SetPlayerFacingAngle(playerid, 82.6125);
  212. return 1;
  213. }
  214. /* -------- */
  215. public OnPlayerConnect(playerid)
  216. {
  217. new nome[25], s[100];
  218. GetPlayerName(playerid, nome, 25);
  219. format(s, sizeof(s), "O Jogador {09D6E1}%s {FFFFFF}Entrou no Servidor.", nome);
  220. SendClientMessageToAll(Branco, s);
  221.  
  222. RemoveBuildingForPlayer(playerid, 16776, -237.0234, 2662.8359, 62.6094, 0.25); // Galinha Gigante Deletada. [ HQ Farc ]
  223.  
  224. SetTimer("salario",3600000,1); // Tempo salário 1hr
  225. TextDrawShowForPlayer(playerid,Textdraw0);
  226.  
  227. Load(playerid);
  228.  
  229. new pRpnames[MAX_PLAYER_NAME];
  230. GetPlayerName(playerid, pRpnames, sizeof(pRpnames));
  231. new RpNames = strfind(pRpnames, "_", true);
  232. if(RpNames == -1)
  233. {
  234. SendClientMessage(playerid, Branco, "[x] Você Foi Kikado Por não usar o Formato de Nome Adequado: {09D6E1}Nome_Sobrenome");
  235. Kick(playerid);
  236. return 1;
  237. }
  238. return 1;
  239. }
  240. /* -------- */
  241. public OnPlayerDisconnect(playerid, reason)
  242. {
  243. new nome[25], s[100];
  244. GetPlayerName(playerid, nome, 25);
  245. format(s, sizeof(s), "O Jogador {09D6E1}%s {FFFFFF}Desconectou do Servidor.", nome);
  246. SendClientMessageToAll(Branco, s);
  247.  
  248. Salvar(playerid);
  249. return 1;
  250. }
  251. /* -------- */
  252. public OnPlayerSpawn(playerid)
  253. {
  254. SendClientMessage(playerid,Cinza_Escuro,"[x] Digite {09D6E1}/CMDS {FFFFFF}Para Abrir a Lista De {09D6E1}Comandos do {FFFFFF}BATTLEFIELD 3.");
  255.  
  256. ShowPlayerDialog(playerid,JSF,DIALOG_STYLE_MSGBOX, "Mensagem de Boas Vindas", "{09D6E1}Seja Bem Vindo ao {FFFFFF}Battlefield 3 {09D6E1}SAMP", "Okay", "");
  257.  
  258. GangZoneShowForPlayer(playerid, GzFarC, 0x3E3E4496);
  259. GangZoneShowForPlayer(playerid, GzFuz, 0x00400096);
  260. GangZoneShowForPlayer(playerid, GzGi, 0x00717196);
  261. return 1;
  262. }
  263. /* -------- */
  264. public OnPlayerDeath(playerid, killerid, reason)
  265. {
  266. if(killerid != INVALID_PLAYER_ID)
  267. {
  268. SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
  269. GivePlayerMoney(killerid, 250);
  270.  
  271. new NomePlayer[25], s[150];
  272. GetPlayerName(playerid, NomePlayer, 25);
  273. format(s, sizeof(s), "[x] Você Ganhou R$: 250 + 1 Score Por Matar {09D6E1}%s !", NomePlayer);
  274. SendClientMessage(killerid,-1, s);
  275. }
  276. return 1;
  277. }
  278. /* -------- */
  279. public OnVehicleSpawn(vehicleid)
  280. {
  281. return 1;
  282. }
  283. /* -------- */
  284. public OnVehicleDeath(vehicleid, killerid)
  285. {
  286. return 1;
  287. }
  288. /* -------- */
  289. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  290. {
  291. if(!success)
  292. {
  293. SendClientMessage(playerid,Cinza_Escuro, "[x] O Comando Não {09D6E1}Existe.");
  294. return 1;
  295. }
  296. return 1;
  297. }
  298. /* Comandos */
  299. CMD:cmds(playerid)
  300. {
  301. if(GetPlayerTeam(playerid) == 1)
  302. {
  303. ShowPlayerDialog(playerid,JSF,DIALOG_STYLE_MSGBOX, "{09D6E1}COMANDOS BATTLEFIELD 3", "{19ED0D} /Colete \n /Capacete \n /Estac \n /Posto \n /Kill \n /Sniper \n /Creditos", "OK", "");
  304. }
  305. else if(GetPlayerTeam(playerid) == 2)
  306. {
  307. ShowPlayerDialog(playerid,JSF,DIALOG_STYLE_MSGBOX, "{09D6E1}COMANDOS BATTLEFIELD 3", "{19ED0D} /Colete \n /Capacete \n /Kill \n /Sniper \n /Creditos \n /Guerra \n /Atentado", "OK", "");
  308. }
  309. else if(GetPlayerTeam(playerid) == 3)
  310. {
  311. ShowPlayerDialog(playerid,JSF,DIALOG_STYLE_MSGBOX, "{09D6E1}COMANDOS BATTLEFIELD 3", "{19ED0D} /Colete \n /Capacete \n /Kill \n /Sniper \n /Creditos \n /Guerra \n /Atentado", "OK", "");
  312. }
  313. return 1;
  314. }
  315. /* -------- */
  316. CMD:grana(playerid)
  317. {
  318. GivePlayerMoney(playerid,99999);
  319. SendClientMessage(playerid,-1,"Chupa jô");
  320. return 1;
  321. }
  322. /* -------- */
  323. CMD:colete(playerid)
  324. {
  325. if(GetPlayerTeam(playerid) == 1)
  326. {
  327. if(GetPlayerMoney(playerid) < 1000)
  328. return SendClientMessage(playerid,Cinza_Escuro,"[x] Você Não Tem {09D6E1}R$: 1000 {FFFFFF}Consigo.");
  329. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Comprou um Colete Por {09D6E1}R$: 1000");
  330.  
  331. SetPlayerAttachedObject( playerid, 0, 19142, 1, 0.117633, 0.028060, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  332. GivePlayerMoney(playerid,-1000);
  333.  
  334. new Float:ColeteP;
  335. GetPlayerArmour(playerid, ColeteP);
  336. SetPlayerArmour(playerid, ColeteP + 35);
  337. }
  338. else if(GetPlayerTeam(playerid) == 2)
  339. {
  340. if(GetPlayerMoney(playerid) < 1000)
  341. return SendClientMessage(playerid,Cinza_Escuro,"[x] Você Não Tem {09D6E1}R$: 1000 {FFFFFF}Consigo.");
  342. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Comprou um Colete Por {09D6E1}R$: 1000");
  343.  
  344. SetPlayerAttachedObject( playerid, 0, 19142, 1, 0.036378, 0.048509, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  345. GivePlayerMoney(playerid,-1000);
  346.  
  347. new Float:ColeteP;
  348. GetPlayerArmour(playerid, ColeteP);
  349. SetPlayerArmour(playerid, ColeteP + 35);
  350. }
  351. else if(GetPlayerTeam(playerid) == 3)
  352. {
  353. if(GetPlayerMoney(playerid) < 1000)
  354. return SendClientMessage(playerid,Cinza_Escuro,"[x] Você Não Tem {09D6E1}R$: 1000 {FFFFFF}Consigo.");
  355. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Comprou um Colete Por {09D6E1}R$: 1000");
  356.  
  357. SetPlayerAttachedObject( playerid, 0, 19142, 1, 0.083493, 0.041181, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  358. GivePlayerMoney(playerid,-1000);
  359.  
  360. new Float:ColeteP;
  361. GetPlayerArmour(playerid, ColeteP);
  362. SetPlayerArmour(playerid, ColeteP + 35);
  363. }
  364. return 1;
  365. }
  366. /* -------- */
  367. CMD:capacete(playerid)
  368. {
  369. if(GetPlayerTeam(playerid) == 1)
  370. {
  371. if(GetPlayerMoney(playerid) < 600)
  372. return SendClientMessage(playerid,Cinza_Escuro,"[x] Você Não Tem {09D6E1}R$: 600 {FFFFFF}Consigo.");
  373. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Comprou um Capacete Por {09D6E1}R$: 600");
  374.  
  375. SetPlayerAttachedObject( playerid, 3, 19104, 2, 0.133160, 0.019420, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  376. GivePlayerMoney(playerid,-600);
  377.  
  378. new Float:CapaceteP;
  379. GetPlayerArmour(playerid, CapaceteP);
  380. SetPlayerArmour(playerid, CapaceteP + 25);
  381. }
  382. else if(GetPlayerTeam(playerid) == 2)
  383. {
  384. if(GetPlayerMoney(playerid) < 600)
  385. return SendClientMessage(playerid,Cinza_Escuro,"[x] Você Não Tem {09D6E1}R$: 600 {FFFFFF}Consigo.");
  386. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Comprou um Capacete Por {09D6E1}R$: 600");
  387.  
  388. SetPlayerAttachedObject( playerid, 3, 19102, 2, 0.128419, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  389. GivePlayerMoney(playerid,-600);
  390.  
  391. new Float:CapaceteP;
  392. GetPlayerArmour(playerid, CapaceteP);
  393. SetPlayerArmour(playerid, CapaceteP + 25);
  394. }
  395. else if(GetPlayerTeam(playerid) == 3)
  396. {
  397. if(GetPlayerMoney(playerid) < 600)
  398. return SendClientMessage(playerid,Cinza_Escuro,"[x] Você Não Tem {09D6E1}R$: 600 {FFFFFF}Consigo.");
  399. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Comprou um Capacete Por {09D6E1}R$: 600");
  400.  
  401. SetPlayerAttachedObject( playerid, 3, 19103, 2, 0.161174, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  402. GivePlayerMoney(playerid,-600);
  403.  
  404. new Float:CapaceteP;
  405. GetPlayerArmour(playerid, CapaceteP);
  406. SetPlayerArmour(playerid, CapaceteP + 25);
  407. }
  408. return 1;
  409. }
  410. /* -------- */
  411. CMD:guerra(playerid,params[])
  412. {
  413. if(GetPlayerTeam(playerid) != 2) if(GetPlayerTeam(playerid) != 3)
  414. return SendClientMessage(playerid,Cinza_Escuro,"[x] Comando Indisponível Para sua {09D6E1}Organização");
  415.  
  416. if(TemGuerra == 1)
  417. return SendClientMessage(playerid,Cinza_Escuro, "[x] Uma Guerra Já Foi {09D6E1}Iniciada.");
  418.  
  419. new Float:X,Float:Y,Float:Z;
  420. GetPlayerPos(playerid, X,Y,Z);
  421. guerra = GangZoneCreate(X-100,Y-100,X+100,Y+100);
  422. GangZoneShowForAll(guerra,-1);
  423. SetTimer("guerrat",120000,0); // Tempo Guerra 2 min
  424. GuerraB[playerid] = 1;
  425.  
  426. PlayAudioStreamForPlayer(playerid,"https://dl.dropbox.com/u/107605026/Musicas/NA.mp3");
  427.  
  428. new pname[25], s[150];
  429. GetPlayerName(playerid, pname, 25);
  430. format(s, sizeof(s), "{19ED0D}[GUERRA] {FFFFFF}O {09D6E1}Terrorista {FFFFFF}%s Acaba De Iniciar uma {09D6E1}Guerra.", pname);
  431. SendClientMessageToAll(Branco, s);
  432. TemGuerra = 1;
  433. return 1;
  434. }
  435. /* -------- */
  436. CMD:atentado(playerid)
  437. {
  438. if(GetPlayerTeam(playerid) != 2) if(GetPlayerTeam(playerid) != 3)
  439. return SendClientMessage(playerid,Cinza_Escuro,"[x] Comando Indisponível Para sua {09D6E1}Organização");
  440.  
  441. if(PlantouBomba[playerid] == 1)
  442. return SendClientMessage(playerid,Cinza_Escuro, "[x] Uma Bomba Já Foi {09D6E1}Plantada. ");
  443.  
  444. new pname[25], s[150];
  445. GetPlayerName(playerid, pname, 25);
  446. format(s, sizeof(s), "{19ED0D}[ATENTADO] {FFFFFF}O {09D6E1}Terrorista {FFFFFF}%s Acaba De Plantar uma {09D6E1}Bomba.", pname);
  447. SendClientMessageToAll(Branco, s);
  448.  
  449. bombplanttime = SetTimerEx("BombPlantTime", ARMARTEMPO*1000, 0, "d", playerid);
  450. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0);
  451. PlantouBomba[playerid] = 1;
  452. return 1;
  453. }
  454. /* -------- */
  455. CMD:kill(playerid)
  456. {
  457. new pname[25], s[150];
  458. GetPlayerName(playerid, pname, 25);
  459. format(s, sizeof(s), "{19ED0D}[ATENÇÃO] {FFFFFF}O {09D6E1}Jogador {FFFFFF}%s Acaba De Se {09D6E1}Matar.", pname);
  460. SendClientMessageToAll(Branco, s);
  461.  
  462. SetPlayerHealth(playerid,0);
  463. return 1;
  464. }
  465. /* -------- */
  466. CMD:posto(playerid)
  467. {
  468. if(GetPlayerTeam(playerid) != 1)
  469. return SendClientMessage(playerid,Cinza_Escuro,"[x] Comando Indisponível Para sua {09D6E1}Organização");
  470. SendClientMessage(playerid,Cinza_Escuro,"[x] O Satélite Marcou o Posto Avançado no seu {09D6E1}GPS");
  471. SetPlayerCheckpoint(playerid,-375.8249,2260.4480, -0.2432, 3.0);
  472. return 1;
  473. }
  474. /* -------- */
  475. CMD:sniper(playerid)
  476. {
  477. if(GetPlayerMoney(playerid) < 1500)
  478. return SendClientMessage(playerid,Cinza_Escuro,"[x] Você Não Tem {09D6E1}R$: 1500 {FFFFFF}Consigo.");
  479. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Comprou uma Sniper Por {09D6E1}R$: 1500");
  480. GivePlayerWeapon(playerid,34,250);
  481. GivePlayerMoney(playerid,-1500);
  482. return 1;
  483. }
  484. /* -------- */
  485. CMD:creditos(playerid)
  486. {
  487. ShowPlayerDialog(playerid,JSF,DIALOG_STYLE_MSGBOX, "{0ECFE0}Lista de Créditos", "{0EE015}GameMode : {FFFFFF}Lucas Emmanuel \n{E0890E}Mapper : {FFFFFF}Lucas Emmanuel", "Okay", "");
  488. return 1;
  489. }
  490. /* -------- */
  491. CMD:estac(playerid)
  492. {
  493. if(GetPlayerTeam(playerid) != 1)
  494. return SendClientMessage(playerid,Cinza_Escuro, "[x] Comando Indisponível Para sua {09D6E1}Organização");
  495. SetPlayerPos(playerid,283.5517,1972.5457,17.6406);
  496. return 1;
  497. }
  498. /* -------- */
  499. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  500. {
  501. return 1;
  502. }
  503. /* -------- */
  504. public OnPlayerExitVehicle(playerid, vehicleid)
  505. {
  506. return 1;
  507. }
  508. /* -------- */
  509. public OnPlayerStateChange(playerid, newstate, oldstate)
  510. {
  511. if(newstate == PLAYER_STATE_DRIVER)
  512. {
  513. new vehicleid;
  514. vehicleid = GetPlayerVehicleID(playerid);
  515.  
  516. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && GetPlayerScore(playerid) < 250)
  517. {
  518. if(GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 520)
  519. {
  520. SendClientMessage(playerid,Cinza_Escuro, "[x] Você Precisa ter no Mínimo {09D6E1}250 Scores {FFFFFF}Para Pilotar Essa Beleza. ");
  521. RemovePlayerFromVehicle(playerid);
  522. }
  523. }
  524. }
  525. /* -------- */
  526. new VehID = GetPlayerVehicleID(playerid);
  527. if(newstate == PLAYER_STATE_DRIVER)
  528. {
  529. for(new vP = 0; vP < sizeof(ExercitoC); vP++)
  530. {
  531. if(VehID == ExercitoC[vP] && GetPlayerTeam(playerid) != 1)
  532. {
  533. SendClientMessage(playerid,Cinza_Escuro, "[x] Este Carro Não Pertence a Sua {09D6E1}Organização.");
  534. RemovePlayerFromVehicle(playerid);
  535. }
  536. }
  537. for(new vP = 0; vP < sizeof(TerroristasC); vP++)
  538. {
  539. if(VehID == TerroristasC[vP] && GetPlayerTeam(playerid) != 2)
  540. {
  541. SendClientMessage(playerid,Cinza_Escuro, "[x] Este Carro Não Pertence a Sua {09D6E1}Organização.");
  542. RemovePlayerFromVehicle(playerid);
  543. }
  544. }
  545.  
  546. for(new vP = 0; vP < sizeof(FarcC); vP++)
  547. {
  548. if(VehID == FarcC[vP] && GetPlayerTeam(playerid) != 3)
  549. {
  550. SendClientMessage(playerid,Cinza_Escuro, "[x] Este Carro Não Pertence a Sua {09D6E1}Organização.");
  551. RemovePlayerFromVehicle(playerid);
  552. }
  553. }
  554. }
  555. return 1;
  556. }
  557. /* -------- */
  558. public OnPlayerEnterCheckpoint(playerid)
  559. {
  560. return 1;
  561. }
  562. /* -------- */
  563. public OnPlayerLeaveCheckpoint(playerid)
  564. {
  565. return 1;
  566. }
  567. /* -------- */
  568. public OnPlayerEnterRaceCheckpoint(playerid)
  569. {
  570. return 1;
  571. }
  572. /* -------- */
  573. public OnPlayerLeaveRaceCheckpoint(playerid)
  574. {
  575. return 1;
  576. }
  577. /* -------- */
  578. public OnRconCommand(cmd[])
  579. {
  580. return 1;
  581. }
  582. /* -------- */
  583. public OnPlayerRequestSpawn(playerid)
  584. {
  585. return 1;
  586. }
  587. /* -------- */
  588. public OnObjectMoved(objectid)
  589. {
  590. return 1;
  591. }
  592. /* -------- */
  593. public OnPlayerObjectMoved(playerid, objectid)
  594. {
  595. return 1;
  596. }
  597. /* -------- */
  598. public OnPlayerPickUpPickup(playerid, pickupid) {
  599. if(pickupid == EstMi){
  600. }
  601. if(pickupid == EquiMi){
  602. }
  603. if(pickupid == EquiTer){
  604. }
  605. if(pickupid == Posto){
  606. DisablePlayerCheckpoint(playerid);
  607. }
  608. if(pickupid == EquiFar){
  609. }
  610. return 1;
  611. }
  612. /* -------- */
  613. public OnVehicleMod(playerid, vehicleid, componentid)
  614. {
  615. return 1;
  616. }
  617. /* -------- */
  618. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  619. {
  620. return 1;
  621. }
  622. /* -------- */
  623. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  624. {
  625. return 1;
  626. }
  627. /* -------- */
  628. public OnPlayerSelectedMenuRow(playerid, row)
  629. {
  630. return 1;
  631. }
  632. /* -------- */
  633. public OnPlayerExitedMenu(playerid)
  634. {
  635. return 1;
  636. }
  637. /* -------- */
  638. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  639. {
  640. return 1;
  641. }
  642. /* -------- */
  643. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  644. {
  645. if(newkeys== 16)
  646. {
  647. if(IsPlayerInRangeOfPoint(playerid,1.0,189.3186,1923.1282,17.6406))
  648. {
  649. if(GetPlayerTeam(playerid) != 1) return SendClientMessage(playerid,Cinza_Escuro, "[x] Você Não Tem {09D6E1}Autorização.");
  650. {
  651. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Recebeu Armamentos do Governo Para a {09D6E1}Guerra.");
  652. ResetPlayerWeapons(playerid);
  653. GivePlayerWeapon(playerid,24,250);
  654. GivePlayerWeapon(playerid,25,250);
  655. GivePlayerWeapon(playerid,31,250);
  656. GivePlayerWeapon(playerid,3,1);
  657. }
  658. }
  659. }
  660. if(newkeys== 16)
  661. {
  662. if(IsPlayerInRangeOfPoint(playerid,1.0,-693.1985,959.3026,12.2316))
  663. {
  664. if(GetPlayerTeam(playerid) != 2) return SendClientMessage(playerid,Cinza_Escuro, "[x] Você Não Tem {09D6E1}Autorização.");
  665. {
  666. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Recebeu Armamentos da Sua {09D6E1}Organização.");
  667. ResetPlayerWeapons(playerid);
  668. GivePlayerWeapon(playerid,24,250);
  669. GivePlayerWeapon(playerid,25,250);
  670. GivePlayerWeapon(playerid,30,250);
  671. GivePlayerWeapon(playerid,4,1);
  672. }
  673. }
  674. }
  675. if(newkeys== 16)
  676. {
  677. if(IsPlayerInRangeOfPoint(playerid,1.0,-375.8249,2260.4480,43.0619))
  678. {
  679. if(GetPlayerTeam(playerid) != 1) return SendClientMessage(playerid,Cinza_Escuro, "[x] Você Não Tem {09D6E1}Autorização.");
  680. {
  681. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Recebeu Remédios e Munição No {09D6E1}Posto Avançado");
  682.  
  683. new pname[25], s[150];
  684. GetPlayerName(playerid, pname, 25);
  685. format(s, sizeof(s), "{09D6E1}[Atenção] {FFFFFF}O Fuzileiro {09D6E1}%s {FFFFFF}Chegou No {09D6E1}Posto Avançado", pname);
  686. SendClientMessageToAll(Branco, s);
  687.  
  688. ResetPlayerWeapons(playerid);
  689. GivePlayerWeapon(playerid,24,750);
  690. GivePlayerWeapon(playerid,25,750);
  691. GivePlayerWeapon(playerid,31,750);
  692. GivePlayerWeapon(playerid,29,750);
  693. GivePlayerWeapon(playerid,3,1);
  694. SetPlayerArmour(playerid,75);
  695. }
  696. }
  697. }
  698. if(newkeys== 16)
  699. {
  700. if(IsPlayerInRangeOfPoint(playerid,1.0,-318.2394,2658.2397,63.8692))
  701. {
  702. if(GetPlayerTeam(playerid) != 3) return SendClientMessage(playerid,Cinza_Escuro, "[x] Você Não Tem {09D6E1}Autorização.");
  703. {
  704. SendClientMessage(playerid,Cinza_Escuro,"[x] Você Recebeu Armamentos da Sua {09D6E1}Organização.");
  705. ResetPlayerWeapons(playerid);
  706. GivePlayerWeapon(playerid,24,250);
  707. GivePlayerWeapon(playerid,25,250);
  708. GivePlayerWeapon(playerid,30,250);
  709. GivePlayerWeapon(playerid,4,1);
  710. }
  711. }
  712. }
  713. return 1;
  714. }
  715. /* -------- */
  716. public OnRconLoginAttempt(ip[], password[], success)
  717. {
  718. return 1;
  719. }
  720. /* Armas nas Costas do Player */
  721. public OnPlayerUpdate(playerid)
  722. {
  723. if(!IsPlayerInAnyVehicle(playerid))
  724. {
  725. new Armas[MAX_PLAYERS],Balas[MAX_PLAYERS];
  726. GetPlayerWeaponData(playerid, 5, Armas[playerid], Balas[playerid]);
  727. if(Armas[playerid] == 30 && Balas[playerid] >= 1)
  728. {
  729. if(GetPlayerWeapon(playerid) == 30) RemovePlayerAttachedObject(playerid,M4-AK);
  730. else SetPlayerAttachedObject(playerid, M4-AK, 355, 1, -0.060921, -0.141673, 0.000000, 0.000000, 35.362735, 0.000000);
  731. }
  732. else if(Armas[playerid] == 31 && Balas[playerid] >= 1)
  733. {
  734. if(GetPlayerWeapon(playerid) == 31) RemovePlayerAttachedObject(playerid,M4-AK);
  735. else SetPlayerAttachedObject(playerid, M4-AK, 356, 1, -0.099681, -0.133408, 0.000000, 1.027592, 19.667785, 0.000000);
  736. }
  737. else
  738. {
  739. RemovePlayerAttachedObject(playerid,M4-AK);
  740. }
  741. GetPlayerWeaponData(playerid, 3, Armas[playerid], Balas[playerid]);
  742. if(Armas[playerid] == 25 && Balas[playerid] >= 1)
  743. {
  744. if(GetPlayerWeapon(playerid) == 25) RemovePlayerAttachedObject(playerid,PUMP);
  745. else SetPlayerAttachedObject(playerid, PUMP, 349, 1, -0.109260, -0.059651, -0.066210, 186.310729, 42.375362, 6.716565);
  746. }
  747. else if(Armas[playerid] == 27 && Balas[playerid] >= 1)
  748. {
  749. if(GetPlayerWeapon(playerid) == 27) RemovePlayerAttachedObject(playerid,PUMP);
  750. else SetPlayerAttachedObject(playerid, PUMP, 351, 1, -0.181073, -0.056285, -0.081242, 181.269729, 39.399085, 12.246994);
  751. }
  752. else
  753. {
  754. RemovePlayerAttachedObject(playerid,PUMP);
  755. }
  756. }
  757. /* Anime Armas */
  758. static ArmaNaMao[MAX_PLAYERS];
  759. new ArmaID = GetPlayerWeapon(playerid);
  760. if(ArmaID > 0 && ArmaNaMao[playerid] != ArmaID)
  761. {
  762. CallLocalFunction("OnPlayerReloading", "lol", 5.0, 0, 0, 0, 0, 500);
  763. }
  764. ArmaNaMao[playerid] = ArmaID;
  765. return 1;
  766. }
  767. /* -------- */
  768. public OnPlayerStreamIn(playerid, forplayerid)
  769. {
  770. return 1;
  771. }
  772. /* -------- */
  773. public OnPlayerStreamOut(playerid, forplayerid)
  774. {
  775. return 1;
  776. }
  777. /* -------- */
  778. public OnVehicleStreamIn(vehicleid, forplayerid)
  779. {
  780. return 1;
  781. }
  782. /* -------- */
  783. public OnVehicleStreamOut(vehicleid, forplayerid)
  784. {
  785. return 1;
  786. }
  787. /* -------- */
  788. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  789. {
  790. return 1;
  791. }
  792. /* -------- */
  793. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  794. {
  795. return 1;
  796. }
  797. /* -------- */
  798. public salario(playerid)
  799. {
  800. SendClientMessage(playerid,-1,"{19ED0D}[Parabéns] {FFFFFF}Você acaba de Ganhar 10 Scores e R$:1000 {09D6E1}Por Mais uma Hora Jogada.");
  801. SetPlayerScore(playerid, GetPlayerScore(playerid)+10);
  802. GivePlayerMoney(playerid, 1000);
  803. return 1;
  804. }
  805. /* -------- */
  806. public guerrat(playerid)
  807. {
  808. GangZoneDestroy(guerra);
  809. GangZoneHideForAll(guerra);
  810. SendClientMessageToAll(Branco, "{19ED0D}[GUERRA] {FFFFFF}A Guerra Foi {09D6E1}Finalizada {FFFFFF}Pelo Governo {09D6E1}Federal");
  811. GuerraB[playerid] = 0;
  812. TemGuerra = 0;
  813.  
  814. return 1;
  815. }
  816. /* -------- */
  817. public BombPlantTime(playerid)
  818. {
  819. GetPlayerPos(playerid, BombX, BombY, BombZ);
  820. BombaRelogio[playerid] = CreateObject(1252, BombX, BombY, BombZ-0.80, 270, 0, 0);
  821. TogglePlayerControllable(playerid, 1);
  822. ClearAnimations(playerid);
  823. bombtime = SetTimerEx("BombTime", 9, 1, "d", playerid);
  824. MS[playerid] = 99;
  825. Segundos[playerid] = BOMBATEMPO;
  826. TextDrawShowForAll(Text:BombCount);
  827. KillTimer(bombplanttime);
  828. return 1;
  829. }
  830. /* -------- */
  831. public BombTime(playerid)
  832. {
  833. MS[playerid]--;
  834. if(MS[playerid] == 0)
  835. {
  836. MS[playerid] = 99;
  837. Segundos[playerid]--;
  838. }
  839.  
  840. if(Segundos[playerid] > 60)
  841. {
  842. new Segundos2 = Segundos[playerid] - 60;
  843. Segundos[playerid] = Segundos2;
  844. Minutos[playerid]++;
  845. }
  846.  
  847. if(Segundos[playerid] == 0 && Minutos[playerid] > 0)
  848. {
  849. Segundos[playerid] = 59;
  850. Minutos[playerid]--;
  851. }
  852.  
  853. if(Segundos[playerid] == 0 && MS[playerid] == 1)
  854. {
  855. PlantouBomba[playerid] = 0;
  856. TextDrawHideForAll(Text:BombCount);
  857. DestroyObject(BombaRelogio[playerid]);
  858.  
  859. CreateExplosion(BombX, BombY + random(8), BombZ + random(5), 6, 10.0);
  860. CreateExplosion(BombX + random(8), BombY, BombZ + random(5), 6, 10.0);
  861. CreateExplosion(BombX, BombY, BombZ, 6, 10.0);
  862. CreateExplosion(BombX, BombY - random(8), BombZ + random(5), 6, 10.0);
  863. CreateExplosion(BombX - random(8), BombY, BombZ + random(5), 6, 10.0);
  864.  
  865. KillTimer(bombtime);
  866. }
  867.  
  868. if(Segundos[playerid] < 10)
  869. {
  870. new count[10];
  871. format(count, sizeof(count), "00:0%i:%i", Segundos[playerid], MS[playerid]);
  872. TextDrawSetString(BombCount, count);
  873. }
  874.  
  875. if(Segundos[playerid] >= 10)
  876. {
  877. new count[10];
  878. format(count, sizeof(count), "00:%i:%i", Segundos[playerid], MS[playerid]);
  879. TextDrawSetString(BombCount, count);
  880. }
  881.  
  882. if(Minutos[playerid] < 10 && Segundos[playerid] < 10)
  883. {
  884. new count[10];
  885. format(count, sizeof(count), "0%i:0%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
  886. TextDrawSetString(BombCount, count);
  887. }
  888.  
  889. if(Minutos[playerid] < 10 && Segundos[playerid] > 9)
  890. {
  891. new count[10];
  892. format(count, sizeof(count), "0%i:%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
  893. TextDrawSetString(BombCount, count);
  894. }
  895.  
  896. if(Minutos[playerid] >= 10 && Segundos[playerid] > 9)
  897. {
  898. new count[10];
  899. format(count, sizeof(count), "%i:%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
  900. TextDrawSetString(BombCount, count);
  901. }
  902.  
  903. if(Minutos[playerid] >= 10 && Segundos[playerid] < 10)
  904. {
  905. new count[10];
  906. format(count, sizeof(count), "%i:0%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
  907. TextDrawSetString(BombCount, count);
  908. }
  909.  
  910. return 1;
  911. }
  912. /* Salvar Score do Player */
  913. stock Salvar(playerid)
  914. {
  915. new arquivo_conta[50], nome_player[MAX_PLAYER_NAME];
  916. GetPlayerName(playerid, nome_player, sizeof(nome_player));
  917. format(arquivo_conta, sizeof(arquivo_conta),"Scores/%s.ini", nome_player);
  918. if(!DOF2_FileExists(arquivo_conta))
  919. {
  920. DOF2_CreateFile(arquivo_conta);
  921. Salvar(playerid);
  922. return 1;
  923. }
  924. DOF2_SetInt(arquivo_conta,"Score", GetPlayerScore(playerid));
  925. DOF2_SaveFile();
  926. return 1;
  927. }
  928. /* -------- */
  929. stock Load(playerid)
  930. {
  931. new arquivo_conta[50], nome_player[MAX_PLAYER_NAME];
  932. GetPlayerName(playerid, nome_player, sizeof(nome_player));
  933. format(arquivo_conta, sizeof(arquivo_conta),"Scores/%s.ini", nome_player);
  934. SetPlayerScore(playerid, DOF2_GetInt(arquivo_conta,"Score"));
  935. return 1;
  936. }
  937. /* Fim :) */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement