Advertisement
Guest User

Untitled

a guest
Sep 25th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 163.97 KB | None | 0 0
  1. #define Oficina1 IsPlayerInRangeOfPoint(playerid, 2.5, -47.7836, 270.6917, 2.2500)
  2. #define Oficina2 IsPlayerInRangeOfPoint(playerid, 10.0, 24.6492, 2418.9697, 22.7578)
  3. #define Oficina3 IsPlayerInRangeOfPoint(playerid, 3.0, 1348.4963, 946.5101, 10.5252)
  4. #define Oficina4 IsPlayerInRangeOfPoint(playerid, 4.0, -547.3569,507.0492,2.5933)
  5.  
  6. COMMAND:neon(playerid, params[])
  7. {
  8. new OptionsList[200], DialogTitle[200];
  9. SendAdminText(playerid, "/neon", params);
  10. if (APlayerData[playerid][LoggedIn] == true)
  11. {
  12. if (GetPlayerVehicleSeat(playerid) == 0)
  13. {
  14. if (Oficina1 || Oficina2 || Oficina3 || Oficina4)
  15. {
  16. format(DialogTitle, sizeof(DialogTitle), "Selecione o neon:");
  17.  
  18. format(OptionsList, sizeof(OptionsList), "%sSirene\n", OptionsList);
  19. format(OptionsList, sizeof(OptionsList), "%sNeon vermelho\n", OptionsList);
  20. format(OptionsList, sizeof(OptionsList), "%sNeon azul\n", OptionsList);
  21. format(OptionsList, sizeof(OptionsList), "%sNeon verde\n", OptionsList);
  22. format(OptionsList, sizeof(OptionsList), "%sNeon amarelo\n", OptionsList);
  23. format(OptionsList, sizeof(OptionsList), "%sNeon rosa\n", OptionsList);
  24. format(OptionsList, sizeof(OptionsList), "%sNeon branco\n", OptionsList);
  25. format(OptionsList, sizeof(OptionsList), "%sRemover neon\n", OptionsList);
  26. ShowPlayerDialog(playerid, DialogNeon, DIALOG_STYLE_LIST, DialogTitle, OptionsList, "Selecionar", "Cancelar");
  27. }
  28. else
  29. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não está na oficina.");
  30. }
  31. else
  32. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não está dirigindo um veículo.");
  33. }
  34. else
  35. return 0;
  36. return 1;
  37. }
  38. COMMAND:pintura(playerid, params[])
  39. {
  40. new paintjobid, vid;
  41. SendAdminText(playerid, "/pintura", params);
  42. if (APlayerData[playerid][LoggedIn] == true)
  43. {
  44. if (GetPlayerVehicleSeat(playerid) == 0)
  45. {
  46. if (Oficina1 || Oficina2 || Oficina3 || Oficina4)
  47. {
  48. if (sscanf(params, "i", paintjobid)) SendClientMessage(playerid, 0xFF0000AA, "Use: pintura [paintjob 0-2]");
  49. else
  50. {
  51. if ((paintjobid >= 0) && (paintjobid <= 2))
  52. {
  53. vid = GetPlayerVehicleID(playerid);
  54. if (AVehicleData[vid][Owned] == true)
  55. {
  56. ChangeVehiclePaintjob(vid, paintjobid);
  57. AVehicleData[vid][PaintJob] = paintjobid + 1;
  58. ChangeVehicleColor(vid, 1, 1);
  59. AVehicleData[vid][Color1] = 1;
  60. AVehicleData[vid][Color2] = 1;
  61. RewardPlayer(playerid, -500, 0);
  62. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Você repintou seu veiculo por R$500.");
  63. PlayerFile_Save(playerid);
  64. }
  65. else
  66. SendClientMessage(playerid, 0xFFFFFFFF, "[CDM] Você não é proprietário do veículo.");
  67. }
  68. else
  69. SendClientMessage(playerid, 0xFF0000AA, "[CDM] Você precisa digitar um paintjob [0-2].");
  70. }
  71. }
  72. else
  73. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não está na oficina.");
  74. }
  75. else
  76. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você deve estar dentro de um veículo que você possui para aplicar um paintjob.");
  77. }
  78. else
  79. return 0;
  80. return 1;
  81. }
  82. COMMAND:cor1(playerid, params[])
  83. {
  84. new ColorList[1000];
  85. SendAdminText(playerid, "/cor1", params);
  86. if (APlayerData[playerid][LoggedIn] == true)
  87. {
  88. if (GetPlayerVehicleSeat(playerid) == 0)
  89. {
  90. if (Oficina1 || Oficina2 || Oficina3 || Oficina4)
  91. {
  92. if (AVehicleData[GetPlayerVehicleID(playerid)][Owned] == true)
  93. {
  94. format(ColorList, sizeof(ColorList), "%s{FFFFFF}%s\n", ColorList, "Preto");
  95. format(ColorList, sizeof(ColorList), "%s{FFFFFF}%s\n", ColorList, "Branco");
  96.  
  97. for (new i = 2; i < sizeof(AVehicleColors); i++)
  98. format(ColorList, sizeof(ColorList), "%s%s%s\n", ColorList, AVehicleColors[i], "CarColor");
  99. ShowPlayerDialog(playerid, DialogPrimaryCarColor, DIALOG_STYLE_LIST, "Escolha a cor primária:", ColorList, "Selecionar", "Cancelar");
  100. }
  101. else
  102. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não é proprietário desse veículo.");
  103. }
  104. else
  105. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não está na oficina.");
  106. }
  107. else
  108. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você deve estar dentro de um veículo para aplicar uma cor.");
  109. }
  110. else
  111. return 0;
  112. return 1;
  113. }
  114. COMMAND:cor2(playerid, params[])
  115. {
  116. new ColorList[1000];
  117. SendAdminText(playerid, "/cor2", params);
  118. if (APlayerData[playerid][LoggedIn] == true)
  119. {
  120. if (GetPlayerVehicleSeat(playerid) == 0)
  121. {
  122. if (Oficina1 || Oficina2 || Oficina3 || Oficina4)
  123. {
  124. if (AVehicleData[GetPlayerVehicleID(playerid)][Owned] == true)
  125. {
  126. format(ColorList, sizeof(ColorList), "%s{FFFFFF}%s\n", ColorList, "Preto"); // Color 0
  127. format(ColorList, sizeof(ColorList), "%s{FFFFFF}%s\n", ColorList, "Branco"); // Color 1
  128.  
  129. for (new i = 2; i < sizeof(AVehicleColors); i++)
  130. format(ColorList, sizeof(ColorList), "%s%s%s\n", ColorList, AVehicleColors[i], "CarColor");
  131. ShowPlayerDialog(playerid, DialogSedundaryCarColor, DIALOG_STYLE_LIST, "Escolha a cor secundária:", ColorList, "Selecionar", "Cancelar");
  132. }
  133. else
  134. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não é o proprietário desse veículo.");
  135. }
  136. else
  137. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não está na oficina.");
  138. }
  139. else
  140. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Você deve estar dentro de um veículo para aplicar uma cor.");
  141. }
  142. else
  143. return 0;
  144. return 1;
  145. }
  146. COMMAND:novidades(playerid, params[])
  147. {
  148. SendAdminText(playerid, "/novidades", params);
  149. SendClientMessage(playerid, 0xFFFFFFFF, "====| Novidades Caminhoneiros do Mundo |====");
  150. SendClientMessage(playerid, 0xFFFFFFFF, "/Laser.");
  151. SendClientMessage(playerid, 0xFFFFFFFF, "/cor1, na oficina.");
  152. SendClientMessage(playerid, 0xFFFFFFFF, "/cor2, na oficina.");
  153. SendClientMessage(playerid, 0xFFFFFFFF, "/pintura, na oficina.");
  154. SendClientMessage(playerid, 0xFFFFFFFF, "/neon, na oficina.");
  155. SendClientMessage(playerid, 0xFFFFFFFF, "Novos mapas.");
  156. SendClientMessage(playerid, 0xFFFFFFFF, "====================================");
  157. return 1;
  158. }
  159. COMMAND:limparchat(playerid, params[])
  160. {
  161. if (APlayerData[playerid][LoggedIn] == true)
  162. {
  163. if (APlayerData[playerid][PlayerLevel] >= 2)
  164. {
  165. SendClientMessageToAll(0x00FFFFFF, " ");
  166. SendClientMessageToAll(0x00FFFFFF, " ");
  167. SendClientMessageToAll(0x00FFFFFF, " ");
  168. SendClientMessageToAll(0x00FFFFFF, " ");
  169. SendClientMessageToAll(0x00FFFFFF, " ");
  170. SendClientMessageToAll(0x00FFFFFF, " ");
  171. SendClientMessageToAll(0x00FFFFFF, " ");
  172. SendClientMessageToAll(0x00FFFFFF, " ");
  173. SendClientMessageToAll(0x00FFFFFF, " ");
  174. SendClientMessageToAll(0x00FFFFFF, " ");
  175. SendClientMessageToAll(0x00FFFFFF, " ");
  176. SendClientMessageToAll(0x00FFFFFF, " ");
  177. SendClientMessageToAll(0x00FFFFFF, " ");
  178. SendClientMessageToAll(0x00FFFFFF, " ");
  179. SendClientMessageToAll(0x00FFFFFF, " ");
  180. SendClientMessageToAll(0x00FFFFFF, " ");
  181. SendClientMessageToAll(0x00FFFFFF, " ");
  182. SendClientMessageToAll(0x00FFFFFF, " ");
  183. SendClientMessageToAll(0x00FFFFFF, " ");
  184. SendClientMessageToAll(0x00FFFFFF, " ");
  185. SendClientMessageToAll(0x00FFFFFF, " ");
  186. SendClientMessageToAll(0x00FFFFFF, " ");
  187. SendClientMessageToAll(0x00FFFFFF, " ");
  188. SendClientMessageToAll(0x00FFFFFF, " ");
  189. }
  190. else SendClientMessage(playerid, 0xFF0000AA, "[CDM] Você nao tem permissão para usar esse comando.");
  191. }
  192. return 1;
  193. }
  194. COMMAND:tapa(playerid, params[])
  195. {
  196. new Msg[128], Name[24], AdminName[24], OtherPlayer;
  197. SendAdminText(playerid, "/tapa", params);
  198. if (APlayerData[playerid][LoggedIn] == true)
  199. {
  200. if (APlayerData[playerid][PlayerLevel] >= 1)
  201. {
  202. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /tapa [id]");
  203. else
  204. {
  205. if (IsPlayerConnected(OtherPlayer))
  206. {
  207. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  208. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  209. new player1;
  210. player1 = OtherPlayer;
  211. new Float:tapax;
  212. new Float:tapay;
  213. new Float:tapaz;
  214. GetPlayerPos(player1, tapax, tapay, tapaz);
  215. SetPlayerPos(player1, tapax, tapay, tapaz+10);
  216. format(Msg, 128, "{FF0000}-| O Administrador %s deu um tapa em %s |-", AdminName, Name);
  217. SendClientMessageToAll(0xFFFFFFFF, Msg);
  218. PlayerFile_Save(OtherPlayer);
  219. }
  220. else
  221. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não se encontra online!");
  222. }
  223. }
  224. else
  225. return 0;
  226. }
  227. else
  228. return 0;
  229. return 1;
  230. }
  231. COMMAND:tapao(playerid, params[])
  232. {
  233. new Msg[128], Name[24], AdminName[24], OtherPlayer;
  234. SendAdminText(playerid, "/tapao", params);
  235. if (APlayerData[playerid][LoggedIn] == true)
  236. {
  237. if (APlayerData[playerid][PlayerLevel] >= 1)
  238. {
  239. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /tapao [id]");
  240. else
  241. {
  242. if (IsPlayerConnected(OtherPlayer))
  243. {
  244. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  245. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  246. new player1;
  247. player1 = OtherPlayer;
  248. new Float:tapax;
  249. new Float:tapay;
  250. new Float:tapaz;
  251. GetPlayerPos(player1, tapax, tapay, tapaz);
  252. SetPlayerPos(player1, tapax, tapay, tapaz+40);
  253. format(Msg, 128, "{FF0000}-| O Administrador %s deu um tapao em %s |-", AdminName, Name);
  254. SendClientMessageToAll(0xFFFFFFFF, Msg);
  255. PlayerFile_Save(OtherPlayer);
  256. }
  257. else
  258. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não se encontra online!");
  259. }
  260. }
  261. else
  262. return 0;
  263. }
  264. else
  265. return 0;
  266. return 1;
  267. }
  268. COMMAND:fogo(playerid, params[])
  269. {
  270. new Msg[128], Name[24], AdminName[24], OtherPlayer;
  271. SendAdminText(playerid, "/fogo", params);
  272. if (APlayerData[playerid][LoggedIn] == true)
  273. {
  274. if (APlayerData[playerid][PlayerLevel] >= 1)
  275. {
  276. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /fogo [id]");
  277. else
  278. {
  279. if (IsPlayerConnected(OtherPlayer))
  280. {
  281. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  282. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  283. new player1;
  284. player1 = OtherPlayer;
  285. new Float:burnx;
  286. new Float:burny;
  287. new Float:burnz;
  288. GetPlayerPos(player1,burnx, burny, burnz);
  289. CreateExplosion(burnx, burny , burnz + 3, 1, 3);
  290. format(Msg, 128, "{FF0000}-| O Administrador %s colocou fogo em %s |-", AdminName, Name);
  291. SendClientMessageToAll(0xFFFFFFFF, Msg);
  292. PlayerFile_Save(OtherPlayer);
  293. }
  294. else
  295. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Esse jogador não se encontra online!");
  296. }
  297. }
  298. else
  299. return 0;
  300. }
  301. else
  302. return 0;
  303. return 1;
  304. }
  305. COMMAND:pm(playerid, params[])
  306. {
  307. new OtherPlayer, Message[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
  308. SendAdminText(playerid, "/pm", params);
  309. if (APlayerData[playerid][LoggedIn] == true)
  310. {
  311. if (sscanf(params, "us[128]", OtherPlayer, Message)) SendClientMessage(playerid, 0xFF0000AA, "Use: /pm [id] [menssagem]");
  312. else
  313. {
  314. if (IsPlayerConnected(OtherPlayer))
  315. {
  316. if (APlayerData[playerid][Muted] == false)
  317. {
  318. GetPlayerName(playerid, YourName, sizeof(YourName));
  319. GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
  320. format(Msg1, 128, "{808080}PM para %s{FFFFFF}: %s", OtherPlayerName, Message);
  321. format(Msg2, 128, "{A0A0A0}PM de %s{FFFFFF}: %s", YourName, Message);
  322. SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
  323. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
  324. }
  325. else
  326. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você ainda está mudo.");
  327. }
  328. else
  329. SendClientMessage(playerid, 0xFF0000FF, "[CDM] O jogador não está online.");
  330. }
  331. }
  332. else
  333. return 0;
  334. return 1;
  335. }
  336. COMMAND:criarcasa(playerid, params[])
  337. {
  338. new HPrice, MaxLevel, HouseID;
  339. SendAdminText(playerid, "/criarcasa", params);
  340. if (APlayerData[playerid][LoggedIn] == true)
  341. {
  342. if (APlayerData[playerid][PlayerLevel] >= 5)
  343. {
  344. if (GetPlayerVehicleSeat(playerid) == -1)
  345. {
  346. if (sscanf(params, "ii", HPrice, MaxLevel)) SendClientMessage(playerid, 0xFF0000AA, "Use: /criarcasa [preço] [level]");
  347. else
  348. {
  349. if ((MaxLevel >= 1) && (MaxLevel <= 10))
  350. {
  351. if ((HPrice >= 100000) && (MaxLevel <= 5000000))
  352. {
  353. for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  354. if (AHouseData[HouseID][PickupID] == 0)
  355. break;
  356. if (HouseID < MAX_HOUSES)
  357. {
  358. new Float:x, Float:y, Float:z, Msg[128];
  359. GetPlayerPos(playerid, x, y, z);
  360. AHouseData[HouseID][HouseX] = x;
  361. AHouseData[HouseID][HouseY] = y;
  362. AHouseData[HouseID][HouseZ] = z;
  363. AHouseData[HouseID][HouseLevel] = 1;
  364. AHouseData[HouseID][HouseMaxLevel] = MaxLevel;
  365. AHouseData[HouseID][HousePrice] = HPrice;
  366. AHouseData[HouseID][Owned] = false;
  367. House_CreateEntrance(HouseID);
  368. HouseFile_Save(HouseID);
  369. format(Msg, 128, "{00FF00}[CDM] Você criou a casa de ID {FF00FF}%i{00FF00} com sucesso!", HouseID);
  370. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  371. }
  372. else
  373. SendClientMessage(playerid, 0xFF0000FF, "[CDM] A quantidade máxima de casas criadas, foi atingida!");
  374. }
  375. else
  376. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Valor não permitido!");
  377. }
  378. else
  379. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você deve escolher o Level entre 0 e 10.");
  380. }
  381. }
  382. else
  383. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode estar dentro de um veículo para criar uma casa!");
  384. }
  385. }
  386. else
  387. return 0;
  388. return 1;
  389. }
  390. COMMAND:idcasa(playerid, params[])
  391. {
  392. new Msg[128];
  393. SendAdminText(playerid, "/idcasa", params);
  394. if (APlayerData[playerid][LoggedIn] == true)
  395. {
  396. if (APlayerData[playerid][PlayerLevel] >= 1)
  397. {
  398. if (GetPlayerVehicleID(playerid) == 0)
  399. {
  400. for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  401. {
  402. if (AHouseData[HouseID][PickupID] != 0)
  403. {
  404. if (AHouseData[HouseID][Owned] == true)
  405. {
  406. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  407. {
  408. format(Msg, 128, "{00FF00}[CDM] O ID dessa casa é: {FFFF00}%i{00FF00}.", HouseID);
  409. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  410. return 1;
  411. }
  412. }
  413. }
  414. }
  415. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não está na porta de uma casa para ver o id!");
  416. }
  417. else
  418. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode ver o id de uma casa estando dentro de um carro!");
  419. }
  420. else
  421. return 0;
  422. }
  423. else
  424. return 0;
  425. return 1;
  426. }
  427. COMMAND:deletarcasa(playerid, params[])
  428. {
  429. new file[100], Msg[128];
  430. SendAdminText(playerid, "/deletarcasa", params);
  431. if (APlayerData[playerid][LoggedIn] == true)
  432. {
  433. if (APlayerData[playerid][PlayerLevel] >= 6)
  434. {
  435. if (GetPlayerVehicleID(playerid) == 0)
  436. {
  437. for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  438. {
  439. if (AHouseData[HouseID][PickupID] != 0)
  440. {
  441. if (AHouseData[HouseID][Owned] == false)
  442. {
  443. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  444. {
  445. AHouseData[HouseID][HouseName] = 0;
  446. AHouseData[HouseID][Insurance] = 0;
  447. AHouseData[HouseID][HouseX] = 0.0;
  448. AHouseData[HouseID][HouseY] = 0.0;
  449. AHouseData[HouseID][HouseZ] = 0.0;
  450. AHouseData[HouseID][HouseLevel] = 0;
  451. AHouseData[HouseID][HouseMaxLevel] = 0;
  452. AHouseData[HouseID][HousePrice] = 0;
  453. AHouseData[HouseID][Owned] = false;
  454. AHouseData[HouseID][Owner] = 0;
  455. AHouseData[HouseID][HouseName] = 0;
  456. AHouseData[HouseID][HouseName] = 0;
  457. AHouseData[HouseID][HouseName] = 0;
  458. DestroyDynamicPickup(AHouseData[HouseID][PickupID]);
  459. DestroyDynamicMapIcon(AHouseData[HouseID][MapIconID]);
  460. DestroyDynamic3DTextLabel(AHouseData[HouseID][DoorText]);
  461. AHouseData[HouseID][PickupID] = 0;
  462. AHouseData[HouseID][MapIconID] = 0;
  463. format(file, sizeof(file), HouseFile, HouseID);
  464. format(Msg, 128, "{00FF00}[CDM] Você deletou a casa de ID {FFFF00}%i{00FF00} com sucesso!", HouseID);
  465. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  466. return 1;
  467. }
  468. }
  469. }
  470. }
  471. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não está na porta de uma casa para apagá-la!");
  472. }
  473. else
  474. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode deletar uma casa de dentro de um veículo!");
  475. }
  476. else
  477. return 0;
  478. }
  479. else
  480. return 0;
  481. return 1;
  482. }
  483. COMMAND:comprarcasa(playerid, params[])
  484. {
  485. new Msg[128];
  486. SendAdminText(playerid, "/comprarcasa", params);
  487. if (APlayerData[playerid][LoggedIn] == true)
  488. {
  489. if (GetPlayerVehicleID(playerid) == 0)
  490. {
  491. for (new i = 1; i < sizeof(AHouseData); i++)
  492. {
  493. if (AHouseData[i][PickupID] != 0)
  494. {
  495. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[i][HouseX], AHouseData[i][HouseY], AHouseData[i][HouseZ]))
  496. {
  497. if (AHouseData[i][Owned] == false)
  498. {
  499. if (APlayerData[playerid][PlayerMoney] >= AHouseData[i][HousePrice])
  500. House_SetOwner(playerid, i);
  501. else
  502. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode pagar por esta casa.");
  503. }
  504. else
  505. {
  506. format(Msg, 128, "{FF0000}[CDM] Essa casa tem dono! Dono:{00FF00}%s{FFFFFF}", AHouseData[i][Owner]);
  507. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  508. }
  509. return 1;
  510. }
  511. }
  512. }
  513. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Para comprar esteja na porta da casa desejada(pickup).");
  514. }
  515. else
  516. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode comprar uma casa de dentro de um veículo!");
  517. }
  518. else
  519. return 0;
  520. return 1;
  521. }
  522. COMMAND:entrar(playerid, params[])
  523. {
  524. new HouseID, hLevel, BusID, BusType;
  525. SendAdminText(playerid, "/entrar", params);
  526. if (APlayerData[playerid][LoggedIn] == true)
  527. {
  528. if (GetPlayerVehicleID(playerid) == 0)
  529. {
  530. for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  531. {
  532. if (AHouseData[HouseID][PickupID] != 0)
  533. {
  534. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  535. {
  536. if (AHouseData[HouseID][HouseOpened] == false)
  537. {
  538. if (House_PlayerIsOwner(playerid, HouseID) == 0)
  539. {
  540. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esta casa não é aberta ao público, você não pode entrar!");
  541. return 1;
  542. }
  543. }
  544. hLevel = AHouseData[HouseID][HouseLevel];
  545. SetPlayerVirtualWorld(playerid, 5000 + HouseID);
  546. SetPlayerInterior(playerid, AHouseInteriors[hLevel][InteriorID]);
  547. SetPlayerPos(playerid, AHouseInteriors[hLevel][IntX], AHouseInteriors[hLevel][IntY], AHouseInteriors[hLevel][IntZ]);
  548. APlayerData[playerid][CurrentHouse] = HouseID;
  549. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}[CDM] Use {FFFF00}/menucasa{00FF00} para selecionar as opções da casa.");
  550. return 1;
  551. }
  552. }
  553. }
  554. for (new i; i < MAX_BUSINESSPERPLAYER; i++)
  555. {
  556. BusID = APlayerData[playerid][Business][i];
  557. if (BusID != 0)
  558. {
  559. if (IsPlayerInRangeOfPoint(playerid, 2.5, ABusinessData[BusID][BusinessX], ABusinessData[BusID][BusinessY], ABusinessData[BusID][BusinessZ]))
  560. {
  561. BusType = ABusinessData[BusID][BusinessType];
  562. SetPlayerVirtualWorld(playerid, 1000 + playerid);
  563. SetPlayerInterior(playerid, ABusinessInteriors[BusType][InteriorID]);
  564. SetPlayerPos(playerid, ABusinessInteriors[BusType][IntX], ABusinessInteriors[BusType][IntY], ABusinessInteriors[BusType][IntZ]);
  565. APlayerData[playerid][CurrentBusiness] = BusID;
  566. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}[CDM] Use {FFFF00}/menuempresa{00FF00} para selecionar as opções da empresa.");
  567. return 1;
  568. }
  569. }
  570. }
  571. }
  572. }
  573. else
  574. return 0;
  575. return 1;
  576. }
  577. COMMAND:menucasa(playerid, params[])
  578. {
  579. new OptionsList[200], DialogTitle[200];
  580. SendAdminText(playerid, "/menucasa", params);
  581. if (APlayerData[playerid][LoggedIn] == true)
  582. {
  583. if (APlayerData[playerid][CurrentHouse] != 0)
  584. {
  585. format(DialogTitle, sizeof(DialogTitle), "Selecione a opção para: %s", AHouseData[APlayerData[playerid][CurrentHouse]][HouseName]);
  586.  
  587. format(OptionsList, sizeof(OptionsList), "%sMudar nome da casa\n", OptionsList);
  588. format(OptionsList, sizeof(OptionsList), "%sAtualizar casa\n", OptionsList);
  589. format(OptionsList, sizeof(OptionsList), "%sComprar carro da casa\n", OptionsList);
  590. format(OptionsList, sizeof(OptionsList), "%sComprar carro da casa seguro\n", OptionsList);
  591. format(OptionsList, sizeof(OptionsList), "%sVender carro da casa\n", OptionsList);
  592. format(OptionsList, sizeof(OptionsList), "%sVender casa\n", OptionsList);
  593. format(OptionsList, sizeof(OptionsList), "%sAbrir casa para o público\n", OptionsList);
  594. format(OptionsList, sizeof(OptionsList), "%sFechar casa para o público\n", OptionsList);
  595. format(OptionsList, sizeof(OptionsList), "%sSair da casa\n", OptionsList);
  596. ShowPlayerDialog(playerid, DialogHouseMenu, DIALOG_STYLE_LIST, DialogTitle, OptionsList, "Selecionar", "Cancelar");
  597. }
  598. else
  599. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não possui uma casa.");
  600. }
  601. else
  602. return 0;
  603. return 1;
  604. }
  605. COMMAND:usarcarro(playerid, params[])
  606. {
  607. new HouseList[1000];
  608. SendAdminText(playerid, "/usarcarro", params);
  609. if (APlayerData[playerid][LoggedIn] == true)
  610. {
  611. if (APlayerData[playerid][PlayerJailed] == 0)
  612. {
  613. if (GetPlayerVehicleID(playerid) == 0)
  614. {
  615. for (new i; i < MAX_HOUSESPERPLAYER; i++)
  616. {
  617. if (APlayerData[playerid][Houses][i] != 0)
  618. format(HouseList, 1000, "%s{00FF00}%s{FFFFFF}\n", HouseList, AHouseData[APlayerData[playerid][Houses][i]][HouseName]);
  619. else
  620. format(HouseList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", HouseList, "Slot Vazio");
  621. }
  622. ShowPlayerDialog(playerid, DialogGetCarSelectHouse, DIALOG_STYLE_LIST, "Escolha a casa que terá o carro:", HouseList, "Selecionar", "Cancelar");
  623. }
  624. else
  625. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar a pé, à porta de um veículo para a sua localização!");
  626. }
  627. else
  628. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode usar o comando /usarcarro quando está preso!");
  629. }
  630. else
  631. return 0;
  632. return 1;
  633. }
  634. // This command checks if the player is inside a vehicle that he owns and if he's in range of the house where the vehicle is assigned to
  635. COMMAND:estacionar(playerid, params[])
  636. {
  637. // Setup local variables
  638. new Float:x, Float:y, Float:z, Float:rot, vid, HouseID, Msg[128];
  639. new engine,lights,alarm,doors,bonnet,boot,objective;
  640.  
  641. // Send the command to all admins so they can see it
  642. SendAdminText(playerid, "/estacionar", params);
  643.  
  644. // Check if the player has logged in
  645. if (APlayerData[playerid][LoggedIn] == true)
  646. {
  647. // Check if the player is inside a vehicle (he must be the driver)
  648. if (GetPlayerVehicleSeat(playerid) == 0)
  649. {
  650. // Get the vehicle-id
  651. vid = GetPlayerVehicleID(playerid);
  652. // Get the HouseID to which this vehicle belongs
  653. HouseID = AVehicleData[vid][BelongsToHouse];
  654.  
  655. // Check if the vehicle is owned (owner-check is not really required, as another player would get kicked out very fast)
  656. // AND it must belong to a house that the player owns
  657. if ((AVehicleData[vid][Owned] == true) && (HouseID != 0))
  658. {
  659. // Check if the vehicle is in range of the house-entrance (you cannot park a vehicle further away from your house than 150m)
  660. if (IsPlayerInRangeOfPoint(playerid, ParkRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  661. {
  662. // Get the player's position and angle
  663. GetVehiclePos(vid, x, y, z);
  664. GetVehicleZAngle(vid, rot);
  665. // Save those values for the vehicle
  666. AVehicleData[vid][SpawnX] = x;
  667. AVehicleData[vid][SpawnY] = y;
  668. AVehicleData[vid][SpawnZ] = z;
  669. AVehicleData[vid][SpawnRot] = rot;
  670.  
  671. // Find the vehicle in the player's houses
  672. for (new i; i < MAX_HOUSESPERPLAYER; i++)
  673. {
  674. // Get the HouseID of the current house
  675. HouseID = APlayerData[playerid][Houses][i];
  676.  
  677. // Loop through all carslots of this house to find the vehicle-id
  678. for (new CarSlot; CarSlot < 10; CarSlot++)
  679. {
  680. // Check if this carslot holds the same vehicle-id
  681. if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid)
  682. {
  683. House_ReplaceVehicle(HouseID, CarSlot); // Re-create the vehicle at the same spot the player wants to park his vehicle
  684. PutPlayerInVehicle(playerid, AHouseData[HouseID][VehicleIDs][CarSlot], 0);
  685. // Turn on the engine
  686. GetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], engine, lights, alarm, doors, bonnet, boot, objective);
  687. SetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], 1, lights, alarm, doors, bonnet, boot, objective);
  688. break; // Stop the for-loop
  689. }
  690. }
  691. }
  692. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Você estacionou o seu veículo.");
  693. PlayerFile_Save(playerid);
  694. }
  695. else
  696. {
  697. format(Msg, 128, "{FF0000}[CDM] Você precisa estar dentro do veículo da sua casa para estacioná-lo!", ParkRange);
  698. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  699. }
  700. }
  701. else
  702. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode estacionar um veículo que não é da sua propriedade!");
  703. }
  704. else
  705. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você deve estar dentro do veículo para estacioná-lo!");
  706. }
  707. else
  708. return 0;
  709. return 1;
  710. }
  711. COMMAND:alugarcarro(playerid, params[])
  712. {
  713. new VehicleClassList[1000];
  714.  
  715. // Send the command to all admins so they can see it
  716. SendAdminText(playerid, "/alugarcarro", params);
  717.  
  718. // Check if the player has logged in
  719. if (APlayerData[playerid][LoggedIn] == true)
  720. {
  721. // Make sure the player isn't inside a vehicle
  722. if (GetPlayerVehicleID(playerid) == 0)
  723. {
  724. // Check if the player is near a cardealerpickup
  725. for (new i; i < sizeof(ACarDealerPickups); i++)
  726. {
  727. // Check if a valid cardealerpickup is found
  728. if (ACarDealerPickups[i][PickupID] != 0)
  729. {
  730. // Check if the player is in range of the cardealerpickup
  731. if(IsPlayerInRangeOfPoint(playerid, 2.5, ACarDealerPickups[i][pux], ACarDealerPickups[i][puy], ACarDealerPickups[i][puz]))
  732. {
  733. // Let the player choose a vehicle-class
  734. format(VehicleClassList, 1000, "%s{00FF00}%s{FFFFFF}\n", VehicleClassList, "Bicicletas e Motos");
  735. format(VehicleClassList, 1000, "%s{40FF00}%s{FFFFFF}\n", VehicleClassList, "Barcos");
  736. format(VehicleClassList, 1000, "%s{80FF00}%s{FFFFFF}\n", VehicleClassList, "Converssíveis");
  737. format(VehicleClassList, 1000, "%s{B0FF00}%s{FFFFFF}\n", VehicleClassList, "Helicópteros");
  738. format(VehicleClassList, 1000, "%s{FFFF00}%s{FFFFFF}\n", VehicleClassList, "Veículos Industriais");
  739. format(VehicleClassList, 1000, "%s{B0FF40}%s{FFFFFF}\n", VehicleClassList, "Low-riders");
  740. format(VehicleClassList, 1000, "%s{80FF80}%s{FFFFFF}\n", VehicleClassList, "Veículos OFF-Road");
  741. format(VehicleClassList, 1000, "%s{40FFB0}%s{FFFFFF}\n", VehicleClassList, "Aviões");
  742. format(VehicleClassList, 1000, "%s{00FFFF}%s{FFFFFF}\n", VehicleClassList, "Veículos de Serviço Público");
  743. format(VehicleClassList, 1000, "%s{00B0FF}%s{FFFFFF}\n", VehicleClassList, "RC");
  744. format(VehicleClassList, 1000, "%s{0080FF}%s{FFFFFF}\n", VehicleClassList, "Veículos Saloon");
  745. format(VehicleClassList, 1000, "%s{0040FF}%s{FFFFFF}\n", VehicleClassList, "Veículos Sport");
  746. format(VehicleClassList, 1000, "%s{0000FF}%s{FFFFFF}\n", VehicleClassList, "Vagões de Estação");
  747. format(VehicleClassList, 1000, "%s{4000FF}%s{FFFFFF}\n", VehicleClassList, "Reboques");
  748. format(VehicleClassList, 1000, "%s{8000FF}%s{FFFFFF}\n", VehicleClassList, "Veículos Únicos");
  749. // Ask which vehicle class the player wants to see to buy a vehicle
  750. ShowPlayerDialog(playerid, DialogRentCarClass, DIALOG_STYLE_LIST, "Select vehicle class:", VehicleClassList, "Select", "Cancel");
  751. // Exit the function
  752. return 1;
  753. }
  754. }
  755. }
  756. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode alugar um veículo quando não está perto de um comerciante.");
  757. }
  758. else
  759. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode alugar um veículo quando estiver dentro de um veículo");
  760. }
  761. else
  762. return 0;
  763.  
  764. // Let the server know that this was a valid command
  765. return 1;
  766. }
  767. COMMAND:irparacasa(playerid, params[])
  768. {
  769. new HouseList[1000];
  770. SendAdminText(playerid, "/irparacasa", params);
  771.  
  772. // Check if the player has logged in
  773. if (APlayerData[playerid][LoggedIn] == true)
  774. {
  775. // Check if the player has a wanted level of less than 3
  776. if (GetPlayerWantedLevel(playerid) < 3)
  777. {
  778. // Check if the player is not jailed
  779. if (APlayerData[playerid][PlayerJailed] == 0)
  780. {
  781. // Check if the player is not inside a vehicle
  782. if (GetPlayerVehicleID(playerid) == 0)
  783. {
  784. // Ask to which house the player wants to add his vehicle
  785. for (new i; i < MAX_HOUSESPERPLAYER; i++)
  786. {
  787. // Check if this houseindex is occupied
  788. if (APlayerData[playerid][Houses][i] != 0)
  789. format(HouseList, 1000, "%s{00FF00}%s{FFFFFF}\n", HouseList, AHouseData[APlayerData[playerid][Houses][i]][HouseName]);
  790. else
  791. format(HouseList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", HouseList, "Slot Vazio");
  792. }
  793. ShowPlayerDialog(playerid, DialogGoHome, DIALOG_STYLE_LIST, "Selecione a casa que deseja ir:", HouseList, "Selecionar", "Cancelar");
  794. }
  795. else
  796. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar a pé na porta da sua casa.");
  797. }
  798. else
  799. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode usar o comando /irparacasa quando está preso!");
  800. }
  801. else
  802. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /irparacasa quando preso!");
  803. }
  804. else
  805. return 0;
  806. return 1;
  807. }
  808. COMMAND:dinheiro(playerid, params[])
  809. {
  810. new Amount, Msg[128];
  811. SendAdminText(playerid, "/dinheiro", params);
  812. if (APlayerData[playerid][LoggedIn] == true)
  813. {
  814. if (APlayerData[playerid][PlayerLevel] >= 5)
  815. {
  816. if (sscanf(params, "i", Amount)) SendClientMessage(playerid, 0xFF0000AA, "Use: /dinheiro [quantia]");
  817. else
  818. {
  819. RewardPlayer(playerid, Amount, 0);
  820. format(Msg, 128, "[CDM] Você ganhou R$%i", Amount);
  821. SendClientMessage(playerid, 0x00FF00AA, Msg);
  822. }
  823. }
  824. else
  825. return 0;
  826. }
  827. else
  828. return 0;
  829.  
  830. return 1;
  831. }
  832. COMMAND:score(playerid, params[])
  833. {
  834. new Amount, Msg[128];
  835. SendAdminText(playerid, "/score", params);
  836. if (APlayerData[playerid][LoggedIn] == true)
  837. {
  838. if (APlayerData[playerid][PlayerLevel] >= 5)
  839. {
  840. if (sscanf(params, "i", Amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /score [quantia]");
  841. else
  842. {
  843. RewardPlayer(playerid, 0, Amount);
  844. format(Msg, 128, "[CDM] Você ganhou %i pontos de score", Amount);
  845. SendClientMessage(playerid, 0x00FF00AA, Msg);
  846. }
  847. }
  848. else
  849. return 0;
  850. }
  851. else
  852. return 0;
  853.  
  854. return 1;
  855. }
  856. COMMAND:desatrelar(playerid, params[])
  857. {
  858. SendAdminText(playerid, "/desatrelar", params);
  859. if (APlayerData[playerid][LoggedIn] == true)
  860. {
  861. // Detach the trailer from the vehicle
  862. DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
  863. // Send the player a message that the trailer has been detached
  864. SendClientMessage(playerid, 0x0000FFFF, "[CDM] Você desatrelou a carroceria.");
  865. }
  866. else
  867. return 0;
  868. return 1;
  869. }
  870. COMMAND:virar(playerid, params[])
  871. {
  872. SendAdminText(playerid, "/virar", params);
  873. if (APlayerData[playerid][LoggedIn] == true)
  874. {
  875. // Setup some local variables
  876. new Float:x = 0.0, Float:y = 0.0, Float:z = 0.0;
  877. // Check if the player is inside a vehicle
  878. if(IsPlayerInAnyVehicle(playerid))
  879. SetCameraBehindPlayer(playerid);
  880. // Get the player's position
  881. GetPlayerPos(playerid, x, y, z);
  882. // Set the vehicle on the player's coordinates
  883. SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
  884. // Let the vehicle point north
  885. SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
  886. }
  887. else
  888. return 0;
  889.  
  890. // Let the server know that this was a valid command
  891. return 1;
  892. }
  893. COMMAND:reparar(playerid, params[])
  894. {
  895. SendAdminText(playerid, "/reparar", params);
  896. if (APlayerData[playerid][LoggedIn] == true)
  897. {
  898. if (APlayerData[playerid][PlayerLevel] >= 1)
  899. {
  900. if(!IsPlayerInAnyVehicle(playerid))
  901. return SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não está em um veículo!");
  902. RepairVehicle(GetPlayerVehicleID(playerid));
  903. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Veículo reparado!");
  904. }
  905. else
  906. return 0;
  907. }
  908. else
  909. return 0;
  910. return 1;
  911. }
  912. COMMAND:reparartodos(playerid, params[])
  913. {
  914. // Send the command to all admins so they can see it
  915. SendAdminText(playerid, "/reparartodos", params);
  916.  
  917. // Check if the player has logged in
  918. if (APlayerData[playerid][LoggedIn] == true)
  919. {
  920. // Check if the player's admin-level is at least 3
  921. if (APlayerData[playerid][PlayerLevel] >= 3)
  922. {
  923. // Loop through all vehicles
  924. for (new i; i < 2000; i++)
  925. RepairVehicle(i); // Fully repair the vehicle (damage value and bodywork)
  926.  
  927. // Send all players a message to inform them that all vehicles have been repaired
  928. SendClientMessageToAll(0x00FF00FF, "[CDM] Todos os Veículos foram reparados pelo admin!");
  929. }
  930. else
  931. return 0;
  932. }
  933. else
  934. return 0;
  935.  
  936. // Let the server know that this was a valid command
  937. return 1;
  938. }
  939.  
  940. // Heals all players
  941. COMMAND:darvidatodos(playerid, params[])
  942. {
  943. // Send the command to all admins so they can see it
  944. SendAdminText(playerid, "/darvidatodos", params);
  945.  
  946. // Check if the player has logged in
  947. if (APlayerData[playerid][LoggedIn] == true)
  948. {
  949. // Check if the player's admin-level is at least 3
  950. if (APlayerData[playerid][PlayerLevel] >= 3)
  951. {
  952. // Loop through all players
  953. for (new i; i < MAX_PLAYERS; i++)
  954. if (IsPlayerConnected(i)) // Check if the player is connected
  955. if (IsPlayerInAnyVehicle(i) == 0) // Check if the player isn't inside a vehicle
  956. SetPlayerHealth(i, 100.0); // Heal the player
  957.  
  958. // Send all players a message to inform them that all players have been healed
  959. SendClientMessageToAll(0x00FF00FF, "[CDM] Todos os jogadores receberam vida máxima!");
  960. }
  961. else
  962. return 0;
  963. }
  964. else
  965. return 0;
  966.  
  967. // Let the server know that this was a valid command
  968. return 1;
  969. }
  970.  
  971.  
  972.  
  973. // Kills the player
  974. COMMAND:morrer(playerid, params[])
  975. {
  976. // Send the command to all admins so they can see it
  977. SendAdminText(playerid, "/morrer", params);
  978.  
  979. // Check if the player has logged in
  980. if (APlayerData[playerid][LoggedIn] == true)
  981. {
  982. // Check if the player has a wanted level of less than 3
  983. if (GetPlayerWantedLevel(playerid) < 3)
  984. {
  985. // Check if the player isn't in jail
  986. if (APlayerData[playerid][PlayerJailed] == 0)
  987. {
  988. // Force the player back into class-selection
  989. ForceClassSelection(playerid);
  990. // Kill the player (required after ForceClassSelection)
  991. SetPlayerHealth(playerid, 0.0);
  992. }
  993. else
  994. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode usar o comando /morrer quando preso!");
  995. }
  996. else
  997. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /morrer quando procurado!");
  998. }
  999. else
  1000. return 0;
  1001.  
  1002. // Let the server know that this was a valid command
  1003. return 1;
  1004. }
  1005.  
  1006. // Lets the player choose another class
  1007. COMMAND:mudar(playerid, params[])
  1008. {
  1009. // Send the command to all admins so they can see it
  1010. SendAdminText(playerid, "/mudar", params);
  1011.  
  1012. // Check if the player has logged in
  1013. if (APlayerData[playerid][LoggedIn] == true)
  1014. {
  1015. // Check if the player has a wanted level of less than 3
  1016. if (GetPlayerWantedLevel(playerid) < 3)
  1017. {
  1018. // Check if the player isn't in jail
  1019. if (APlayerData[playerid][PlayerJailed] == 0)
  1020. {
  1021. // Force the player back into class-selection
  1022. ForceClassSelection(playerid);
  1023. // Kill the player (required after ForceClassSelection)
  1024. SetPlayerHealth(playerid, 0.0);
  1025. }
  1026. else
  1027. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode usar o comando /reescolher quando preso!");
  1028. }
  1029. else
  1030. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /reescolher quando procurado!");
  1031. }
  1032. else
  1033. return 0;
  1034. return 1;
  1035. }
  1036. COMMAND:trabalhar(playerid, params[])
  1037. {
  1038. // Send the command to all admins so they can see it
  1039. SendAdminText(playerid, "/trabalhar", params);
  1040.  
  1041. // Check if the player has logged in
  1042. if (APlayerData[playerid][LoggedIn] == true)
  1043. {
  1044. // First check if the player already has a job
  1045. if (APlayerData[playerid][JobStarted] == false)
  1046. {
  1047. // Check the player's class
  1048. switch (APlayerData[playerid][PlayerClass])
  1049. {
  1050. case ClassTruckDriver:
  1051. {
  1052. // Get the id of the convoy (if the player is in a convoy)
  1053. new Convoy = APlayerData[playerid][ConvoyID];
  1054.  
  1055. // Check if the player is part of a convoy AND is not the leader
  1056. if ((APlayerData[playerid][InConvoy] == true) && (AConvoys[Convoy][Members][0] != playerid))
  1057. {
  1058. // Let the player know he's not the leader of his convoy and cannot start a job
  1059. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não é o líder do comboio, por tanto não pode iniciar uma missão.");
  1060. // Exit the function
  1061. return 1;
  1062. }
  1063.  
  1064. // A convoy-leader proceeds here, and also a normal player (no convoy-member)
  1065.  
  1066. // Check if the player is the driver of a vehicle
  1067. if (GetPlayerVehicleSeat(playerid) == 0)
  1068. {
  1069. // Check if the player is inside a valid trucking vehicle
  1070. switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
  1071. {
  1072. case VehicleFlatbed, VehicleDFT30, VehicleCementTruck: // Flatbed, DFT-30, CementTruck
  1073. if (APlayerData[playerid][TruckerLicense] == 1) // Check if the player has acquired a truckers license
  1074. ShowPlayerDialog(playerid, DialogTruckerJobMethod, DIALOG_STYLE_LIST, "Selecione o método:", "Configurar sua própria carga e rota\r\nAtribuir auto-carga", "Selecionar", "Cancelar");
  1075. else
  1076. Trucker_StartRandomJob(playerid); // Start a random job
  1077.  
  1078. case VehicleLineRunner, VehicleTanker, VehicleRoadTrain: // Player is driving a truck which needs a trailer
  1079. if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) // Check if there is a trailer attached
  1080. if (APlayerData[playerid][TruckerLicense] == 1) // Check if the player has acquired a truckers license
  1081. ShowPlayerDialog(playerid, DialogTruckerJobMethod, DIALOG_STYLE_LIST, "Selecione o método:", "Configurar sua própria carga e rota\r\nAtribuir auto-carga", "Selecionar", "Cancelar");
  1082. else
  1083. Trucker_StartRandomJob(playerid); // Start a random job
  1084. else
  1085. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa de um trailer para iniciar o trabalho.");
  1086.  
  1087. default: SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um caminhão para iniciar o trabalho.");
  1088. }
  1089. }
  1090. else
  1091. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um caminhão para iniciar o trabalho.");
  1092. }
  1093. case ClassBusDriver:
  1094. {
  1095. // Check if the player is the driver of a vehicle
  1096. if (GetPlayerVehicleSeat(playerid) == 0)
  1097. if (GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleCoach) // Check if the player is inside a valid busdriver vehicle
  1098. if (APlayerData[playerid][BusLicense] == 1) // Check if the player has acquired a busdriver license
  1099. ShowPlayerDialog(playerid, DialogBusJobMethod, DIALOG_STYLE_LIST, "Selecione o método :", "Escolha sua própria rota de ônibus\r\nAtribuir auto-rota", "Selecionar", "Cancelar");
  1100. else
  1101. BusDriver_StartJob(playerid, random(sizeof(ABusRoutes))); // Start a random job
  1102. else
  1103. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar dirigindo um ônibus para iniciar o trabalho!");
  1104. else
  1105. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar dirigindo um ônibus para iniciar o trabalho!");
  1106. }
  1107. case ClassPilot:
  1108. {
  1109. // Check if the player is the driver of a vehicle
  1110. if (GetPlayerVehicleSeat(playerid) == 0)
  1111. {
  1112. // Check if the player is inside a valid piloting vehicle
  1113. switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
  1114. {
  1115. case VehicleShamal, VehicleNevada, VehicleMaverick, VehicleCargobob, VehicleAT400, VehicleAndromada, VehicleDodo: // Plane (Shamal), Plane (Nevada), helicopter (Maverick)
  1116. Pilot_StartRandomJob(playerid); // Start a random piloting job
  1117. default: SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um veículo de voo para iniciar o trabalho.");
  1118. }
  1119. }
  1120. else
  1121. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um veículo de voo para iniciar o trabalho.");
  1122. }
  1123. case ClassMafia:
  1124. {
  1125. // Check if the player is the driver of a vehicle
  1126. if (GetPlayerVehicleSeat(playerid) == 0)
  1127. {
  1128. // Check if the player is inside a valid piloting vehicle
  1129. switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
  1130. {
  1131. case VehicleSandKing, VehicleMoonbeam: // Sangking, Moonbeam
  1132. Mafia_StartRandomJob(playerid); // Start a random mafia job
  1133. default: SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um veículo da máfia para iniciar o trabalho.");
  1134. }
  1135. }
  1136. else
  1137. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um veículo da máfia para iniciar o trabalho.");
  1138. }
  1139. case ClassCourier:
  1140. {
  1141. // Check if the player is the driver of a vehicle
  1142. if (GetPlayerVehicleSeat(playerid) == 0)
  1143. {
  1144. // Check if the player is inside a valid courier vehicle
  1145. switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
  1146. {
  1147. case VehicleBurrito, VehicleFaggio, VehicleBenson: // Van (Burrito), bike (Faggio)
  1148. Courier_StartJob(playerid); // Start a random courier job
  1149. default: SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um veículo dos Correios para iniciar o trabalho.");
  1150. }
  1151. }
  1152. else
  1153. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um veículo dos Correios para iniciar o trabalho.");
  1154. }
  1155. case ClassRoadWorker:
  1156. {
  1157. // Check if the player is the driver of a vehicle
  1158. if (GetPlayerVehicleSeat(playerid) == 0)
  1159. {
  1160. // Check if the player is inside a valid courier vehicle
  1161. switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
  1162. {
  1163. case VehicleUtilityVan, VehicleTowTruck: // Utility Van, Towtruck
  1164. Roadworker_StartRandomJob(playerid); // Start a random roadworker job
  1165. default: SendClientMessage(playerid, 0xFF0000FF, "Você precisa estar conduzindo um veículo do DNIT para iniciar o trabalho.");
  1166. }
  1167. }
  1168. else
  1169. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar conduzindo um veículo do DNIT para iniciar o trabalho.");
  1170. }
  1171. default: SendClientMessage(playerid, 0xFF0000FF, "[CDM] A sua classe não pode fazer todos os trabalhos.");
  1172. }
  1173. }
  1174. else // Send a message to let the player know he already has a job
  1175. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você já está realizando um trabalho!");
  1176. }
  1177. else
  1178. return 0;
  1179.  
  1180. // Let the server know that this was a valid command
  1181. return 1;
  1182. }
  1183.  
  1184. // Stops the current job
  1185. COMMAND:parartrabalho(playerid, params[])
  1186. {
  1187. // Send the command to all admins so they can see it
  1188. SendAdminText(playerid, "/parartrabalho", params);
  1189.  
  1190. // Check if the player has logged in
  1191. if (APlayerData[playerid][LoggedIn] == true)
  1192. {
  1193. // Check if the player has a job started
  1194. if (APlayerData[playerid][JobStarted] == true)
  1195. {
  1196. // Check the class of the player
  1197. switch (APlayerData[playerid][PlayerClass])
  1198. {
  1199. case ClassTruckDriver: Trucker_EndJob(playerid); // Stop any trucker job
  1200. case ClassBusDriver: BusDriver_EndJob(playerid); // Stop any busdriver job
  1201. case ClassPilot: Pilot_EndJob(playerid); // Stop any pilot job
  1202. case ClassMafia: Mafia_EndJob(playerid); // Stop any mafia job
  1203. case ClassCourier: Courier_EndJob(playerid);
  1204. case ClassRoadWorker: Roadworker_EndJob(playerid);
  1205. default: SendClientMessage(playerid, 0xFF0000FF, "[CDM] A sua classe não tem trabalho para terminar.");
  1206. }
  1207.  
  1208. // Inform the player that he failed the mission
  1209. GameTextForPlayer(playerid, "~w~Voce ~r~falhou~w~ com seu trabalho. Você perdeu ~y~R$1000~w~ para cobrir as despesas.", 5000, 4);
  1210. // Reduce the player's cash by 1000
  1211. RewardPlayer(playerid, -1000, 0);
  1212. }
  1213. }
  1214. else
  1215. return 0;
  1216.  
  1217. // Let the server know that this was a valid command
  1218. return 1;
  1219. }
  1220.  
  1221. // Displays the player's coordinates on the map
  1222. COMMAND:local(playerid, params[])
  1223. {
  1224. // Send the command to all admins so they can see it
  1225. SendAdminText(playerid, "/local", params);
  1226.  
  1227. // Check if the player has logged in
  1228. if (APlayerData[playerid][LoggedIn] == true)
  1229. {
  1230. // Check if the player's admin-level is at least 3
  1231. if (APlayerData[playerid][PlayerLevel] >= 3)
  1232. {
  1233. // Setup some local variables
  1234. new Message[200], Float:x, Float:y, Float:z, Float:rot, Interior, World;
  1235. // Get the player's position
  1236. GetPlayerPos(playerid, x, y, z);
  1237. // Check if the player is on foot or in a vehicle
  1238. if (GetPlayerVehicleSeat(playerid) == -1)
  1239. GetPlayerFacingAngle(playerid, rot); // Get the player's angle
  1240. else
  1241. GetVehicleZAngle(GetPlayerVehicleID(playerid), rot);
  1242.  
  1243. // Get the interior where the player is located
  1244. Interior = GetPlayerInterior(playerid);
  1245. // Get the virtual world of the player
  1246. World = GetPlayerVirtualWorld(playerid);
  1247. // combine the position and angle into a proper message
  1248. format(Message, sizeof(Message), "Localizacao: X=%4.2f, Y=%4.2f, Z=%4.2f, rotacao=%4.2f, interior=%i, world=%i", x, y, z, rot, Interior, World);
  1249. // Send the message with the coordinates and the angle of the player
  1250. SendClientMessage(playerid, 0xFF0000AA, Message);
  1251. }
  1252. else
  1253. return 0;
  1254. }
  1255. else
  1256. return 0;
  1257.  
  1258. // Let the server know that this was a valid command
  1259. return 1;
  1260. }
  1261.  
  1262. // Saves the location into a file
  1263. COMMAND:savelocal(playerid, params[])
  1264. {
  1265. new File:LocFile, LineForFile[255], LineMsg[255];
  1266. new Float:x, Float:y, Float:z, LocName[255], ID;
  1267.  
  1268. // Send the command to all admins so they can see it
  1269. SendAdminText(playerid, "/savelocal", params);
  1270.  
  1271. // Check if the player has logged in
  1272. if (APlayerData[playerid][LoggedIn] == true)
  1273. {
  1274. // Check if the player's admin-level is at least 5
  1275. if (APlayerData[playerid][PlayerLevel] >= 5)
  1276. {
  1277. if (sscanf(params, "is[255]", ID, LocName)) SendClientMessage(playerid, 0xFF0000AA, "Use: /savelocal [id] [descrição]");
  1278. else
  1279. {
  1280. if (!fexist("ServerData/Locations.txt"))
  1281. {
  1282. LocFile = fopen("ServerData/Locations.txt", io_write); // Create the file
  1283. fclose(LocFile); // Close the file
  1284. }
  1285.  
  1286. // Get the player's position
  1287. GetPlayerPos(playerid, x, y, z);
  1288. // Combine all the data in a proper structure, so it can be used directly for setting up the ALocations array
  1289. format(LineForFile, sizeof(LineForFile), "\t{\"%s\", %4.2f, %4.2f, %4.2f}, // ID = %i", LocName, x, y, z, ID);
  1290.  
  1291. LocFile = fopen("ServerData/Locations.txt", io_append); // Open the locationfile for appending data to it
  1292. fwrite(LocFile, LineForFile); // Append the data to the end of the file
  1293. fwrite(LocFile, "\r\n"); // Start a new line, or all the data is saved in one line
  1294. fclose(LocFile); // Close the file
  1295.  
  1296. // Let the player know what data has been saved
  1297. format(LineMsg, 255, "[CDM] Localização salva: %s", LineForFile);
  1298. SendClientMessage(playerid, 0x808080FF, LineMsg);
  1299. }
  1300. }
  1301. else
  1302. return 0;
  1303. }
  1304. else
  1305. return 0;
  1306.  
  1307. // Let the server know that this was a valid command
  1308. return 1;
  1309. }
  1310.  
  1311. // Lets the player choose where he wants to respawn (costs $200)
  1312. COMMAND:resgate(playerid, params[])
  1313. {
  1314. // Send the command to all admins so they can see it
  1315. SendAdminText(playerid, "/resgate", params);
  1316.  
  1317. // Check if the player has logged in
  1318. if (APlayerData[playerid][LoggedIn] == true)
  1319. {
  1320. // Check if the player has a wanted level of less than 3
  1321. if (GetPlayerWantedLevel(playerid) < 3)
  1322. {
  1323. // Check if the player isn't in jail
  1324. if (APlayerData[playerid][PlayerJailed] == 0)
  1325. {
  1326. if (APlayerData[playerid][JobStarted] == false)
  1327. {
  1328. // Make sure you can't use "/rescue" when you're inside a vehicle (doesn't respawn you at the requested coords
  1329. // and puts a random item (bottle, sigarette, ...) in the player's hands
  1330. if (GetPlayerVehicleID(playerid) == 0)
  1331. {
  1332. // Create a dialog based on the player's class
  1333. switch (APlayerData[playerid][PlayerClass])
  1334. {
  1335. case ClassTruckDriver: // Ask where the trucker player wants to respawn
  1336. ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Caminhoneiro nascer em:", "Fallen Tree Depot\r\nFlint Trucking Depot\r\nLVA Freight Depot\r\nDoherty Depot\r\nEl Corona Depot\r\nLas Payasdas Depot\r\nQuarry Top\r\nShady Creek Depot", "Spawn", "Cancel");
  1337. case ClassBusDriver: // Ask where the busdriver wants to respawn
  1338. ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Motorista de Ônibus nascer em:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
  1339. case ClassPilot: // Ask where the pilot wants to respawn
  1340. ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Piloto nascer em:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
  1341. case ClassPolice: // Ask where the police player wants to respawn
  1342. ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Policial nascer em:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
  1343. case ClassCourier: // Ask where the courier player wants to respawn
  1344. ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Correios nascer em:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
  1345. }
  1346. }
  1347. else
  1348. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode usar o comando /resgate dentro de um veículo."); // "/rescue" doesn't work inside a vehicle
  1349. }
  1350. else
  1351. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode ser resgatado realizando um trabalho!"); // "/rescue" doesn't work during a job
  1352. }
  1353. else
  1354. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você nao pode usar o comando /resgate quando preso.");
  1355. }
  1356. else
  1357. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /resgate quando procurado.");
  1358. }
  1359. else
  1360. return 0;
  1361.  
  1362. // Let the server know that this was a valid command
  1363. return 1;
  1364. }
  1365.  
  1366. // Increases the player's wanted level by 1
  1367. COMMAND:procurado(playerid, params[])
  1368. {
  1369. new OtherPlayer, Stars;
  1370.  
  1371. // Send the command to all admins so they can see it
  1372. SendAdminText(playerid, "/procurado", params);
  1373.  
  1374. // Check if the player has logged in
  1375. if (APlayerData[playerid][LoggedIn] == true)
  1376. {
  1377. // Check if the player's admin-level is at least 2
  1378. if (APlayerData[playerid][PlayerLevel] >= 2)
  1379. {
  1380. if (sscanf(params, "ui", OtherPlayer, Stars)) SendClientMessage(playerid, 0xFF0000AA, "Use: /procurado [id] [nivel]");
  1381. else
  1382. if (IsPlayerConnected(OtherPlayer)) // If the player is a valid playerid (he's connected)
  1383. SetPlayerWantedLevel(OtherPlayer, Stars);
  1384. else
  1385. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Esse jogador não está online.");
  1386. }
  1387. else
  1388. return 0;
  1389. }
  1390. else
  1391. return 0;
  1392.  
  1393. // Let the server know that this was a valid command
  1394. return 1;
  1395. }
  1396.  
  1397.  
  1398.  
  1399. // Lets the player choose a motorcycle to spawn
  1400. COMMAND:motos(playerid, params[])
  1401. {
  1402. // Send the command to all admins so they can see it
  1403. SendAdminText(playerid, "/motos", params);
  1404.  
  1405. // Check if the player has logged in
  1406. if (APlayerData[playerid][LoggedIn] == true)
  1407. {
  1408. // Check if the player's admin-level is at least 1
  1409. if (APlayerData[playerid][PlayerLevel] >= 1)
  1410. {
  1411. // Make sure the player isn't inside a vehicle
  1412. if (GetPlayerVehicleID(playerid) == 0)
  1413. {
  1414. // Ask which motorcycle the player wants to have
  1415. ShowPlayerDialog(playerid, DialogBike, DIALOG_STYLE_LIST, "Escolha a Bike:", "Bike\r\nBMX\r\nMountain Bike\r\nFaggio\r\nPizzaboy\r\nBF-400\r\nNRG-500\r\nPCJ-600\r\nFCR-900\r\nFreeway\r\nWayfarer\r\nSanchez\r\nQuad", "Criar", "Cancelar");
  1416. // Let the server know that this was a valid command
  1417. return 1;
  1418. }
  1419. }
  1420. else
  1421. return 0;
  1422. }
  1423. else
  1424. return 0;
  1425.  
  1426. // Let the server know that this was a valid command
  1427. return 1;
  1428. }
  1429.  
  1430.  
  1431.  
  1432. // Lets the player choose a car to spawn (in a split list which shows only 10 cars at a time)
  1433. COMMAND:carros(playerid, params[])
  1434. {
  1435. // Send the command to all admins so they can see it
  1436. SendAdminText(playerid, "/carros", params);
  1437.  
  1438. // Check if the player has logged in
  1439. if (APlayerData[playerid][LoggedIn] == true)
  1440. {
  1441. // Check if the player's admin-level is at least 1
  1442. if (APlayerData[playerid][PlayerLevel] >= 2)
  1443. {
  1444. // Make sure the player isn't inside a vehicle
  1445. if (GetPlayerVehicleID(playerid) == 0)
  1446. CarList_Create(playerid); // Create a list of cars (only the first 10 cars) and show the dialog so the player can choose a car
  1447. }
  1448. else
  1449. return 0;
  1450. }
  1451. else
  1452. return 0;
  1453.  
  1454. // Let the server know that this was a valid command
  1455. return 1;
  1456. }
  1457.  
  1458.  
  1459.  
  1460. // Lets the player choose a plane to spawn (in a split list which shows only 10 planes at a time)
  1461. COMMAND:avioes(playerid, params[])
  1462. {
  1463. // Send the command to all admins so they can see it
  1464. SendAdminText(playerid, "/avioes", params);
  1465.  
  1466. // Check if the player has logged in
  1467. if (APlayerData[playerid][LoggedIn] == true)
  1468. {
  1469. // Check if the player's admin-level is at least 1
  1470. if (APlayerData[playerid][PlayerLevel] >= 2)
  1471. {
  1472. // Make sure the player isn't inside a vehicle
  1473. if (GetPlayerVehicleID(playerid) == 0)
  1474. PlaneList_Create(playerid); // Create a list of planes (only the first 10 planes) and show the dialog so the player can choose a plane
  1475. }
  1476. else
  1477. return 0;
  1478. }
  1479. else
  1480. return 0;
  1481.  
  1482. // Let the server know that this was a valid command
  1483. return 1;
  1484. }
  1485.  
  1486.  
  1487.  
  1488. // Lets the player choose a trailer to spawn (in a split list which shows only 10 trailers at a time)
  1489. COMMAND:trailer(playerid, params[])
  1490. {
  1491. // Send the command to all admins so they can see it
  1492. SendAdminText(playerid, "/trailer", params);
  1493.  
  1494. // Check if the player has logged in
  1495. if (APlayerData[playerid][LoggedIn] == true)
  1496. {
  1497. // Check if the player's admin-level is at least 1
  1498. if (APlayerData[playerid][PlayerLevel] >= 1)
  1499. {
  1500. // Make sure the player isn't inside a vehicle
  1501. if (GetPlayerVehicleID(playerid) == 0)
  1502. TrailerList_Create(playerid); // Create a list of trailers (only the first 10 trailers) and show the dialog so the player can choose a trailer
  1503. }
  1504. else
  1505. return 0;
  1506. }
  1507. else
  1508. return 0;
  1509.  
  1510. // Let the server know that this was a valid command
  1511. return 1;
  1512. }
  1513.  
  1514. // Lets the player choose a boat to spawn
  1515. COMMAND:barcos(playerid, params[])
  1516. {
  1517. // Send the command to all admins so they can see it
  1518. SendAdminText(playerid, "/barcos", params);
  1519.  
  1520. // Check if the player has logged in
  1521. if (APlayerData[playerid][LoggedIn] == true)
  1522. {
  1523. // Check if the player's admin-level is at least 1
  1524. if (APlayerData[playerid][PlayerLevel] >= 1)
  1525. {
  1526. // Make sure the player isn't inside a vehicle
  1527. if (GetPlayerVehicleID(playerid) == 0)
  1528. {
  1529. // Ask which motorcycle the player wants to have
  1530. ShowPlayerDialog(playerid, DialogBoat, DIALOG_STYLE_LIST, "Escolha o barco:", "Coastguard\nDinghy\nJetmax\nLaunch\nMarquis\nPredator\nReefer\nSpeeder\nSquallo\nTropic", "Criar", "Cancelar");
  1531. // Let the server know that this was a valid command
  1532. return 1;
  1533. }
  1534. }
  1535. else
  1536. return 0;
  1537. }
  1538. else
  1539. return 0;
  1540.  
  1541. // Let the server know that this was a valid command
  1542. return 1;
  1543. }
  1544.  
  1545.  
  1546.  
  1547. // Jail a player
  1548. COMMAND:prender(playerid, params[])
  1549. {
  1550. new PlayerToJail, JailTime, Reason[128], Msg[128], Name[24], AdminName[24];
  1551.  
  1552. // Send the command to all admins so they can see it
  1553. SendAdminText(playerid, "/prender", params);
  1554.  
  1555. // Check if the player has logged in
  1556. if (APlayerData[playerid][LoggedIn] == true)
  1557. {
  1558. // Check if the player's admin-level is at least 1
  1559. if (APlayerData[playerid][PlayerLevel] >= 1)
  1560. {
  1561. if (sscanf(params, "uis[128]", PlayerToJail, JailTime, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /prender [id] [tempo] [motivo]");
  1562. else
  1563. if (IsPlayerConnected(PlayerToJail)) // If the player is a valid playerid (he's connected)
  1564. {
  1565. // Jail the player
  1566. Police_JailPlayer(PlayerToJail, JailTime);
  1567. // Get the name of the player who jailed the player
  1568. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  1569. // Get the name of the player who's being sent to jail
  1570. GetPlayerName(PlayerToJail, Name, sizeof(Name));
  1571. // Send the jailed player a message who jailed him, why he's been jailed and how long
  1572. format(Msg, 128, "[CDM] Você foi preso por %s %s por %i segundos.", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, JailTime);
  1573. SendClientMessage(PlayerToJail, 0xFF0000FF, Msg);
  1574. format(Msg, 128, "Motivo: %s", Reason);
  1575. SendClientMessage(PlayerToJail, 0xFF0000FF, Msg);
  1576. format(Msg, 128, "{00FF00}Você prendeu {FFFF00}%s{00FF00} por {FFFF00}%i{00FF00} segundos.", Name, JailTime);
  1577. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1578. }
  1579. else
  1580. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Esse jogador não está online.");
  1581. }
  1582. else
  1583. return 0;
  1584. }
  1585. else
  1586. return 0;
  1587.  
  1588. // Let the server know that this was a valid command
  1589. return 1;
  1590. }
  1591.  
  1592. // Warn a player
  1593. COMMAND:aviso(playerid, params[])
  1594. {
  1595. new PlayerToWarn, Reason[128], ReasonMsg[128], Name[24];
  1596. SendAdminText(playerid, "/aviso", params);
  1597. if (APlayerData[playerid][LoggedIn] == true)
  1598. {
  1599. if (APlayerData[playerid][PlayerLevel] >= 1)
  1600. {
  1601. if (sscanf(params, "us[128]", PlayerToWarn, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /aviso [id] [motivo]");
  1602. else
  1603. if (IsPlayerConnected(PlayerToWarn))
  1604. {
  1605. APlayerData[PlayerToWarn][Warnings]++;
  1606. GetPlayerName(playerid, Name, sizeof(Name));
  1607. format(ReasonMsg, 128, "[CDM] Você foi avisado por %s %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
  1608. SendClientMessage(PlayerToWarn, 0xFF0000FF, ReasonMsg);
  1609. format(ReasonMsg, 128, "Motivo: %s", Reason);
  1610. SendClientMessage(PlayerToWarn, 0xFF0000FF, ReasonMsg);
  1611. format(ReasonMsg, 128, "~w~Aviso %i/%i: ~r~%s~w~", APlayerData[PlayerToWarn][Warnings], AutoKickWarnings, Reason);
  1612. GameTextForPlayer(PlayerToWarn, ReasonMsg, 5000, 4);
  1613.  
  1614. GetPlayerName(PlayerToWarn, Name, sizeof(Name));
  1615. format(ReasonMsg, 128, "[CDM] Você avisou %s (avisos: %i/%i)", Name, APlayerData[PlayerToWarn][Warnings], AutoKickWarnings);
  1616. SendClientMessage(playerid, 0x00FF00FF, ReasonMsg);
  1617. format(ReasonMsg, 128, "Motivo: %s", Reason);
  1618. SendClientMessage(playerid, 0xFF0000FF, ReasonMsg);
  1619. if ((APlayerData[PlayerToWarn][Warnings] == AutoKickWarnings) && (AutoKickAfterWarn == 1))
  1620. Kick(PlayerToWarn);
  1621. }
  1622. else
  1623. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Esse jogador não está online.");
  1624. }
  1625. else
  1626. return 0;
  1627. }
  1628. else
  1629. return 0;
  1630.  
  1631. // Let the server know that this was a valid command
  1632. return 1;
  1633. }
  1634. COMMAND:kick(playerid, params[])
  1635. {
  1636. new PlayerToKick, Reason[128], ReasonMsg[128], Name[24], AdminName[24];
  1637. SendAdminText(playerid, "/kick", params);
  1638. if (APlayerData[playerid][LoggedIn] == true)
  1639. {
  1640. if (APlayerData[playerid][PlayerLevel] >= 1)
  1641. {
  1642. if (sscanf(params, "us[128]", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /kick [id] [motivo]");
  1643. else
  1644. if (IsPlayerConnected(PlayerToKick))
  1645. {
  1646. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  1647. GetPlayerName(PlayerToKick, Name, sizeof(Name));
  1648. format(ReasonMsg, 128, "{FF0000}-| %s foi kickado pelo administrador %s. Motivo: %s |-", Name, AdminName, Reason);
  1649. SendClientMessageToAll(0xFF0000FF, ReasonMsg);
  1650. Kick(PlayerToKick);
  1651. }
  1652. else
  1653. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Esse jogador não está online.");
  1654. }
  1655. else
  1656. return 0;
  1657. }
  1658. else
  1659. return 0;
  1660. return 1;
  1661. }
  1662. COMMAND:ban(playerid, params[])
  1663. {
  1664. new PlayerToBan, Days, Hours, Reason[128], TotalBanTime, Msg[128], Name[24], AdminName[24];
  1665. SendAdminText(playerid, "/ban", params);
  1666. if (APlayerData[playerid][LoggedIn] == true)
  1667. {
  1668. if (APlayerData[playerid][PlayerLevel] >= 3)
  1669. {
  1670. if (sscanf(params, "uiis[128]", PlayerToBan, Days, Hours, Reason))
  1671. SendClientMessage(playerid, 0xFF0000AA, "Use: /ban [id] [dias] [horas] [motivo]");
  1672. else
  1673. {
  1674. if (IsPlayerConnected(PlayerToBan))
  1675. {
  1676. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  1677. GetPlayerName(PlayerToBan, Name, sizeof(Name));
  1678. APlayerData[PlayerToBan][Bans]++;
  1679. TotalBanTime = (Days * 86400) + (Hours * 3600) + gettime();
  1680. if (APlayerData[PlayerToBan][Bans] == 5)
  1681. APlayerData[PlayerToBan][BanTime] = 2147483640;
  1682. else
  1683. APlayerData[PlayerToBan][BanTime] = TotalBanTime;
  1684. if (APlayerData[PlayerToBan][Bans] == 5)
  1685. {
  1686. format(Msg, 128, "[CDM] Você foi banido permanentemente por %s, pois ja é o seu 5° banimento.", AdminName);
  1687. SendClientMessage(PlayerToBan, 0x808080FF, Msg);
  1688. }
  1689. else
  1690. {
  1691. format(Msg, 128, "[CDM] Você foi banido por %s por %i dias e %i horas.", AdminName, Days, Hours);
  1692. SendClientMessage(PlayerToBan, 0x808080FF, Msg);
  1693. format(Msg, 128, "Reason: %s", Reason);
  1694. SendClientMessage(PlayerToBan, 0x808080FF, Msg);
  1695. format(Msg, 128, "[CDM] Você já foi banido %i vezes, a 5° será permanente.", APlayerData[PlayerToBan][Bans]);
  1696. SendClientMessage(PlayerToBan, 0x808080FF, Msg);
  1697. }
  1698. Kick(PlayerToBan);
  1699. format(Msg, 128, "{FF0000}-| O administrador %s %s baniu %s por %i dias e %i horas |-", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name, Days, Hours);
  1700. SendClientMessageToAll(0x808080FF, Msg);
  1701. }
  1702. }
  1703. }
  1704. else
  1705. return 0;
  1706. }
  1707. else
  1708. return 0;
  1709.  
  1710. return 1;
  1711. }
  1712. COMMAND:desbanir(playerid, params[])
  1713. {
  1714. new PlayerToUnban[24], Msg[128], Name[24];
  1715. new file[100], File:PFile, LineForFile[100];
  1716.  
  1717. // Send the command to all admins so they can see it
  1718. SendAdminText(playerid, "/desbanir", params);
  1719.  
  1720. // Check if the player has logged in
  1721. if (APlayerData[playerid][LoggedIn] == true)
  1722. {
  1723. // Check if the player's admin-level is at least 3
  1724. if (APlayerData[playerid][PlayerLevel] >= 3)
  1725. {
  1726. if (sscanf(params, "s[128]", PlayerToUnban))
  1727. SendClientMessage(playerid, 0xFF0000AA, "Use: /desbanir [nick]");
  1728. else
  1729. {
  1730. // Get the name of the admin
  1731. GetPlayerName(playerid, Name, sizeof(Name));
  1732.  
  1733. // Construct the complete filename for this player's account
  1734. format(file, sizeof(file), PlayerFile, PlayerToUnban);
  1735.  
  1736. // Check if the file exists
  1737. if (fexist(file))
  1738. {
  1739. PFile = fopen(file, io_append); // Open the playerfile for appending (this command only appends a new line to overwrite the bantime)
  1740.  
  1741. format(LineForFile, 100, "BanTime 0\r\n"); // Construct the line: "BanTime <0>"
  1742. fwrite(PFile, LineForFile); // And save it to the file
  1743.  
  1744. fclose(PFile); // Close the file
  1745.  
  1746. // Inform everybody else which player was unbanned
  1747. format(Msg, 128, "[CDM] %s %s desbaniu %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name, PlayerToUnban);
  1748. SendClientMessageToAll(0x808080FF, Msg);
  1749. }
  1750. else
  1751. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Não existe nenhuma conta com esse nome.");
  1752. }
  1753. }
  1754. else
  1755. return 0;
  1756. }
  1757. else
  1758. return 0;
  1759.  
  1760. return 1;
  1761. }
  1762.  
  1763. // Spawns the object at the location given by the player
  1764. COMMAND:objeto(playerid, params[])
  1765. {
  1766. // Setup local variables
  1767. new ObjectModel, ObjID, Msg[128], Float:x, Float:y, Float:z, Float:Angle;
  1768.  
  1769. // Send the command to all admins so they can see it
  1770. SendAdminText(playerid, "/objeto", params);
  1771.  
  1772. // Check if the player has logged in
  1773. if (APlayerData[playerid][LoggedIn] == true)
  1774. {
  1775. // Check if the player's admin-level is at least 5
  1776. if (APlayerData[playerid][PlayerLevel] >= 5)
  1777. {
  1778. if (sscanf(params, "iffff", ObjectModel, x, y, z, Angle)) SendClientMessage(playerid, 0xFF0000AA, "Use: /objeto [id-obj] [x] [y] [z] [angulo]");
  1779. else
  1780. {
  1781. // Spawn the object 5 units north of the player
  1782. ObjID = CreateObject(ObjectModel, x, y, z, 0.0, 0.0, Angle, 250.0);
  1783. // Inform the player about it
  1784. format(Msg, 128, "[CDM] Você criou o objeto id %i (modelo-id = %i) nas coordenadas: x=%4.2f, y=%4.2f, z=%4.2f", ObjID, ObjectModel, x, y, z);
  1785. SendClientMessage(playerid, 0x00FF00FF, Msg);
  1786. }
  1787. }
  1788. else
  1789. return 0;
  1790. }
  1791. else
  1792. return 0;
  1793.  
  1794. // Let the server know that this was a valid command
  1795. return 1;
  1796. }
  1797.  
  1798. // Spawns the pickup at the location given by the player
  1799. COMMAND:pickup(playerid, params[])
  1800. {
  1801. // Setup local variables
  1802. new PickupModel, PickID, Msg[128], Float:x, Float:y, Float:z, PickupType;
  1803.  
  1804. // Send the command to all admins so they can see it
  1805. SendAdminText(playerid, "/pickup", params);
  1806.  
  1807. // Check if the player has logged in
  1808. if (APlayerData[playerid][LoggedIn] == true)
  1809. {
  1810. // Check if the player's admin-level is at least 5
  1811. if (APlayerData[playerid][PlayerLevel] >= 5)
  1812. {
  1813. if (sscanf(params, "ifffi", PickupModel, x, y, z, PickupType)) SendClientMessage(playerid, 0xFF0000AA, "Use: /pickup [id-pick] [x] [y] [z] [tipo]");
  1814. else
  1815. {
  1816. // Spawn the pickup
  1817. PickID = CreatePickup(PickupModel, PickupType, x, y, z, -1);
  1818. // Inform the player about it
  1819. format(Msg, 128, "[CDM] Você criou o pickup id %i (modelo-id = %i) nas coordenadas: x=%4.2f, y=%4.2f, z=%4.2f", PickID, PickupModel, x, y, z);
  1820. SendClientMessage(playerid, 0x00FF00FF, Msg);
  1821. }
  1822. }
  1823. else
  1824. return 0;
  1825. }
  1826. else
  1827. return 0;
  1828.  
  1829. // Let the server know that this was a valid command
  1830. return 1;
  1831. }
  1832.  
  1833. // Spawns the vehicle at the location given by the player
  1834. COMMAND:setcar(playerid, params[])
  1835. {
  1836. // Setup local variables
  1837. new VehicleModel, vID, Msg[128], Float:x, Float:y, Float:z, Float:Angle, SpawnDelay;
  1838.  
  1839. // Send the command to all admins so they can see it
  1840. SendAdminText(playerid, "/setcar", params);
  1841.  
  1842. // Check if the player has logged in
  1843. if (APlayerData[playerid][LoggedIn] == true)
  1844. {
  1845. // Check if the player's admin-level is at least 5
  1846. if (APlayerData[playerid][PlayerLevel] >= 6)
  1847. {
  1848. if (sscanf(params, "iffffi", VehicleModel, x, y, z, Angle, SpawnDelay)) SendClientMessage(playerid, 0xFF0000AA, "Use:/setcar [id] [x] [y] [z] [angulo] [SpawnDelay]");
  1849. else
  1850. {
  1851. // Spawn the vehicle at the location specified by the player (also set max-fuel and save the model for the vehicle)
  1852. vID = Vehicle_Create(VehicleModel, x, y, z, Angle, random(126), random(126), SpawnDelay);
  1853. // Inform the player about it
  1854. format(Msg, 128, "[CDM] Você criou o veiculo id %i (modelo-id = %i) nas coordenadas: x=%4.2f, y=%4.2f, z=%4.2f", vID, VehicleModel, x, y, z);
  1855. SendClientMessage(playerid, 0x00FF00FF, Msg);
  1856. }
  1857. }
  1858. else
  1859. return 0;
  1860. }
  1861. else
  1862. return 0;
  1863.  
  1864. // Let the server know that this was a valid command
  1865. return 1;
  1866. }
  1867.  
  1868. // Deletes the given vehicle from the game
  1869. COMMAND:delveh(playerid, params[])
  1870. {
  1871. // Setup local variables
  1872. new vID, Msg[128];
  1873.  
  1874. // Send the command to all admins so they can see it
  1875. SendAdminText(playerid, "/delveh", params);
  1876.  
  1877. // Check if the player has logged in
  1878. if (APlayerData[playerid][LoggedIn] == true)
  1879. {
  1880. // Check if the player's admin-level is at least 5
  1881. if (APlayerData[playerid][PlayerLevel] >= 5)
  1882. {
  1883. if (sscanf(params, "i", vID)) SendClientMessage(playerid, 0xFF0000AA, "Use: \"/delveh [id]");
  1884. else
  1885. {
  1886. // Destroy the given vehicle
  1887. DestroyVehicle(vID);
  1888. // Inform the player about it
  1889. format(Msg, 128, "[CDM] Você deletou o veículo id %i", vID);
  1890. SendClientMessage(playerid, 0x00FF00FF, Msg);
  1891. }
  1892. }
  1893. else
  1894. return 0;
  1895. }
  1896. else
  1897. return 0;
  1898.  
  1899. // Let the server know that this was a valid command
  1900. return 1;
  1901. }
  1902.  
  1903. // Deletes the given vehicle from the game
  1904. COMMAND:deletarobjeto(playerid, params[])
  1905. {
  1906. // Setup local variables
  1907. new oID, Msg[128];
  1908.  
  1909. // Send the command to all admins so they can see it
  1910. SendAdminText(playerid, "/deletarobjeto", params);
  1911.  
  1912. // Check if the player has logged in
  1913. if (APlayerData[playerid][LoggedIn] == true)
  1914. {
  1915. // Check if the player's admin-level is at least 5
  1916. if (APlayerData[playerid][PlayerLevel] >= 5)
  1917. {
  1918. if (sscanf(params, "i", oID)) SendClientMessage(playerid, 0xFF0000AA, "Use: /deletarobjeto [id]");
  1919. else
  1920. {
  1921. // Destroy the given vehicle
  1922. DestroyObject(oID);
  1923. // Inform the player about it
  1924. format(Msg, 128, "[CDM] Você deletou o objeto id %i", oID);
  1925. SendClientMessage(playerid, 0x00FF00FF, Msg);
  1926. }
  1927. }
  1928. else
  1929. return 0;
  1930. }
  1931. else
  1932. return 0;
  1933.  
  1934. // Let the server know that this was a valid command
  1935. return 1;
  1936. }
  1937.  
  1938. // Ports the player to the given coordinates
  1939. COMMAND:irpara(playerid, params[])
  1940. {
  1941. // Setup local variables
  1942. new Float:x, Float:y, Float:z, PortMsg[128];
  1943.  
  1944. // Send the command to all admins so they can see it
  1945. SendAdminText(playerid, "/irpara", params);
  1946.  
  1947. // Check if the player has logged in
  1948. if (APlayerData[playerid][LoggedIn] == true)
  1949. {
  1950. // Check if the player's admin-level is at least 1
  1951. if (APlayerData[playerid][PlayerLevel] >= 1)
  1952. {
  1953. // Check if the player has a wanted level of less than 3
  1954. if (GetPlayerWantedLevel(playerid) < 3)
  1955. {
  1956. // Check if the player is not jailed
  1957. if (APlayerData[playerid][PlayerJailed] == 0)
  1958. {
  1959. if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "Use: /irpara [x] [y] [z]");
  1960. else
  1961. {
  1962. // Port the player to the given location
  1963. SetPlayerPos(playerid, x, y, z);
  1964. // Let the player know about it
  1965. format(PortMsg, 128, "[CDM] Você foi teleportado para a posição: %4.2f, %4.2f, %4.2f", x, y, z);
  1966. SendClientMessage(playerid, 0x00FF00FF, PortMsg);
  1967. }
  1968. }
  1969. else
  1970. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /irpara quando preso.");
  1971. }
  1972. else
  1973. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /irpara quando procurado.");
  1974. }
  1975. else
  1976. return 0;
  1977. }
  1978. else
  1979. return 0;
  1980.  
  1981. // Let the server know that this was a valid command
  1982. return 1;
  1983. }
  1984.  
  1985. // Ports the player to the given player
  1986. COMMAND:ir(playerid, params[])
  1987. {
  1988. // Setup local variables
  1989. new OtherPlayer, Float:x, Float:y, Float:z, PortMsg[128], IntID, WorldID;
  1990.  
  1991. // Send the command to all admins so they can see it
  1992. SendAdminText(playerid, "/ir", params);
  1993.  
  1994. // Check if the player has logged in
  1995. if (APlayerData[playerid][LoggedIn] == true)
  1996. {
  1997. // Check if the player's admin-level is at least 1
  1998. if (APlayerData[playerid][PlayerLevel] >= 1)
  1999. {
  2000. // Check if the player has a wanted level of less than 3
  2001. if (GetPlayerWantedLevel(playerid) < 3)
  2002. {
  2003. // Check if the player is not jailed
  2004. if (APlayerData[playerid][PlayerJailed] == 0)
  2005. {
  2006. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /ir [id]");
  2007. else
  2008. {
  2009. // Check if that other player is online
  2010. if (IsPlayerConnected(OtherPlayer))
  2011. {
  2012. // Get the location of the other player
  2013. GetPlayerPos(OtherPlayer, x, y, z);
  2014. IntID = GetPlayerInterior(OtherPlayer);
  2015. WorldID = GetPlayerVirtualWorld(OtherPlayer);
  2016. // Port the player to the given location
  2017. SetPlayerVirtualWorld(playerid, WorldID);
  2018. SetPlayerInterior(playerid, IntID);
  2019. SetPlayerPos(playerid, x, y, z + 3.0);
  2020. // Let the player know about it
  2021. format(PortMsg, 128, "[CDM] A posição do jogador é: %4.2f, %4.2f, %4.2f", x, y, z + 3.0);
  2022. SendClientMessage(playerid, 0x00FF00FF, PortMsg);
  2023. }
  2024. else
  2025. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Esse jogador não está online.");
  2026. }
  2027. }
  2028. else
  2029. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /ir quando preso.");
  2030. }
  2031. else
  2032. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você nao pode usar o comando /ir quando procurado.");
  2033. }
  2034. else
  2035. return 0;
  2036. }
  2037. else
  2038. return 0;
  2039.  
  2040. // Let the server know that this was a valid command
  2041. return 1;
  2042. }
  2043.  
  2044. // Ports one player to another player
  2045. COMMAND:levar(playerid, params[])
  2046. {
  2047. // Setup local variables
  2048. new Player1, Player2, Float:x, Float:y, Float:z, PortMsg[128], IntID, WorldID, Name[24], AdminName[24];
  2049.  
  2050. // Send the command to all admins so they can see it
  2051. SendAdminText(playerid, "/levar", params);
  2052.  
  2053. // Check if the player has logged in
  2054. if (APlayerData[playerid][LoggedIn] == true)
  2055. {
  2056. // Check if the player's admin-level is at least 1
  2057. if (APlayerData[playerid][PlayerLevel] >= 1)
  2058. {
  2059. if (sscanf(params, "uu", Player1, Player2)) SendClientMessage(playerid, 0xFF0000AA, "Use: /levar [para] [id]");
  2060. else
  2061. {
  2062. // Check if player1 is online
  2063. if (APlayerData[Player1][LoggedIn] == true)
  2064. {
  2065. // Check if player2 is online
  2066. if (APlayerData[Player2][LoggedIn] == true)
  2067. {
  2068. // Get the name of the admin and the second player
  2069. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  2070. GetPlayerName(Player2, Name, sizeof(Name));
  2071. // Get the location of the second player
  2072. GetPlayerPos(Player2, x, y, z);
  2073. IntID = GetPlayerInterior(Player2);
  2074. WorldID = GetPlayerVirtualWorld(Player2);
  2075. // Port the first player to player2's location
  2076. SetPlayerVirtualWorld(Player1, WorldID);
  2077. SetPlayerInterior(Player1, IntID);
  2078. SetPlayerPos(Player1, x, y, z + 3.0);
  2079. // Let the first player know he's been ported
  2080. format(PortMsg, 128, "{00FF00}[CDM] Você foi levado até {FFFF00}%s{00FF00} por {FFFF00}%s", Name, AdminName);
  2081. SendClientMessage(Player1, 0xFFFFFFFF, PortMsg);
  2082. }
  2083. else
  2084. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Jogador 2 não está online.");
  2085. }
  2086. else
  2087. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Jogador 1 não está online.");
  2088. }
  2089. }
  2090. else
  2091. return 0;
  2092. }
  2093. else
  2094. return 0;
  2095.  
  2096. // Let the server know that this was a valid command
  2097. return 1;
  2098. }
  2099.  
  2100. // Ports the player to the given vehicle
  2101. COMMAND:ircarro(playerid, params[])
  2102. {
  2103. // Setup local variables
  2104. new Car, Float:x, Float:y, Float:z, PortMsg[128];
  2105.  
  2106. // Send the command to all admins so they can see it
  2107. SendAdminText(playerid, "/ircarro", params);
  2108.  
  2109. // Check if the player has logged in
  2110. if (APlayerData[playerid][LoggedIn] == true)
  2111. {
  2112. // Check if the player's admin-level is at least 1
  2113. if (APlayerData[playerid][PlayerLevel] >= 1)
  2114. {
  2115. // Check if the player has a wanted level of less than 3
  2116. if (GetPlayerWantedLevel(playerid) < 3)
  2117. {
  2118. // Check if the player is not jailed
  2119. if (APlayerData[playerid][PlayerJailed] == 0)
  2120. {
  2121. if (sscanf(params, "i", Car)) SendClientMessage(playerid, 0xFF0000AA, "Use: /ircarro [id]");
  2122. else
  2123. {
  2124. // Get the location of the car
  2125. GetVehiclePos(Car, x, y, z);
  2126. // Port the player to the given location
  2127. SetPlayerPos(playerid, x, y, z + 3.0);
  2128. // Let the player know about it
  2129. format(PortMsg, 128, "A localização do carro é: %4.2f, %4.2f, %4.2f", x, y, z + 3.0);
  2130. SendClientMessage(playerid, 0x00FF00FF, PortMsg);
  2131. }
  2132. }
  2133. else
  2134. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /ircarro quando preso.");
  2135. }
  2136. else
  2137. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /ircarro quando procurado.");
  2138. }
  2139. else
  2140. return 0;
  2141. }
  2142. else
  2143. return 0;
  2144.  
  2145. // Let the server know that this was a valid command
  2146. return 1;
  2147. }
  2148.  
  2149. // Sets the admin-level of another player
  2150. COMMAND:daradmin(playerid, params[])
  2151. {
  2152. new OtherPlayer, Level, Msg[128], Name[24], AdminName[24], OldLevel;
  2153. SendAdminText(playerid, "/daradmin", params);
  2154. if (APlayerData[playerid][LoggedIn] == true)
  2155. {
  2156. if (APlayerData[playerid][PlayerLevel] >= 5)
  2157. {
  2158. if (sscanf(params, "ui", OtherPlayer, Level)) SendClientMessage(playerid, 0xFF0000AA, "Use: /daradmin [id] [nivel]");
  2159. else
  2160. {
  2161. if (IsPlayerConnected(OtherPlayer))
  2162. {
  2163. OldLevel = APlayerData[OtherPlayer][PlayerLevel];
  2164. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  2165. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  2166. APlayerData[OtherPlayer][PlayerLevel] = Level;
  2167. if (OldLevel != Level)
  2168. {
  2169. if (OldLevel < Level)
  2170. format(Msg, 128, "[CDM] O jogador %s foi promovido a %s por %s", Name, AdminLevelName[Level], AdminName);
  2171. if (OldLevel > Level)
  2172. format(Msg, 128, "[CDM] O jogador %s foi rebaixado a %s por %s", Name, AdminLevelName[Level], AdminName);
  2173. SendClientMessageToAll(0x00FF00FF, Msg);
  2174. }
  2175. else
  2176. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Nivel dos outros jogadores não foram alterados,");
  2177. }
  2178. else
  2179. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Esse jogador não está online.");
  2180. }
  2181. }
  2182. else
  2183. return 0;
  2184. }
  2185. else
  2186. return 0;
  2187. return 1;
  2188. }
  2189. COMMAND:abastecer(playerid, params[])
  2190. {
  2191. // Setup local variables
  2192. new vID;
  2193.  
  2194. // Send the command to all admins so they can see it
  2195. SendAdminText(playerid, "/abastecer", params);
  2196.  
  2197. // Check if the player has logged in
  2198. if (APlayerData[playerid][LoggedIn] == true)
  2199. {
  2200. // Check if the player's admin-level is at least 1
  2201. if (APlayerData[playerid][PlayerLevel] >= 1)
  2202. {
  2203. // Check if the player is inside a vehicle
  2204. if (IsPlayerInAnyVehicle(playerid))
  2205. {
  2206. // Get the vehicleid
  2207. vID = GetPlayerVehicleID(playerid);
  2208. // Refuel the vehicle
  2209. AVehicleData[vID][Fuel] = MaxFuel;
  2210. // Let the player know about it
  2211. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Seu veículo foi abastecido.");
  2212. }
  2213. else
  2214. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Você não está dirigindo um veículo");
  2215. }
  2216. else
  2217. return 0;
  2218. }
  2219. else
  2220. return 0;
  2221.  
  2222. // Let the server know that this was a valid command
  2223. return 1;
  2224. }
  2225.  
  2226. // Let the player use a jetpack
  2227. COMMAND:jetpack(playerid, params[])
  2228. {
  2229. // Send the command to all admins so they can see it
  2230. SendAdminText(playerid, "/jetpack", params);
  2231.  
  2232. // Check if the player has logged in
  2233. if (APlayerData[playerid][LoggedIn] == true)
  2234. {
  2235. // Check if the player's admin-level is at least 3
  2236. if (APlayerData[playerid][PlayerLevel] >= 3)
  2237. {
  2238. // Equip the player with a jetpack
  2239. SetPlayerSpecialAction(playerid, 2);
  2240. }
  2241. else
  2242. return 0;
  2243. }
  2244. else
  2245. return 0;
  2246.  
  2247. // Let the server know that this was a valid command
  2248. return 1;
  2249. }
  2250. COMMAND:motor(playerid, params[])
  2251. {
  2252. // Setup local variables
  2253. new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;
  2254.  
  2255. // Send the command to all admins so they can see it
  2256. SendAdminText(playerid, "/motor", params);
  2257.  
  2258. // Check if the player has logged in
  2259. if (APlayerData[playerid][LoggedIn] == true)
  2260. {
  2261. // Check if the player's admin-level is at least 1
  2262. if (APlayerData[playerid][PlayerLevel] >= 1)
  2263. {
  2264. // Get the player's vehicle
  2265. vehicleid = GetPlayerVehicleID(playerid);
  2266.  
  2267. // Get the current status of the vehicle
  2268. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2269.  
  2270. // Check if the player is inside a vehicle
  2271. if (vehicleid != 0)
  2272. {
  2273. if (sscanf(params, "i", engine)) SendClientMessage(playerid, 0xFF0000AA, "Use: /motor [0-1]");
  2274. else
  2275. {
  2276. // Set the engine to the value that was passed by the player and leave all other parameters alone
  2277. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2278. }
  2279. }
  2280. else
  2281. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Você precisa estar dentro de um veículo para desligá-lo/ligá-lo.");
  2282. }
  2283. else
  2284. return 0;
  2285. }
  2286. else
  2287. return 0;
  2288.  
  2289. // Let the server know that this was a valid command
  2290. return 1;
  2291. }
  2292.  
  2293. // Sets your numberplate
  2294. COMMAND:editarplaca(playerid, params[])
  2295. {
  2296. // Setup local variables
  2297. new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective, Plate[32];
  2298.  
  2299. // Send the command to all admins so they can see it
  2300. SendAdminText(playerid, "/editarplaca", params);
  2301.  
  2302. // Check if the player has logged in
  2303. if (APlayerData[playerid][LoggedIn] == true)
  2304. {
  2305. // Check if the player's admin-level is at least 3
  2306. if (APlayerData[playerid][PlayerLevel] >= 3)
  2307. {
  2308. // Get the player's vehicle
  2309. vehicleid = GetPlayerVehicleID(playerid);
  2310.  
  2311. if (vehicleid != 0)
  2312. {
  2313. if (sscanf(params, "s[32]", Plate)) SendClientMessage(playerid, 0xFF0000AA, "Use: /editarplaca [conteúdo]");
  2314. else
  2315. {
  2316. // Set the numberplate
  2317. SetVehicleNumberPlate(vehicleid, Plate);
  2318. // Remove the player from the vehicle
  2319. RemovePlayerFromVehicle(playerid);
  2320. // Respawn the vehicle
  2321. SetVehicleToRespawn(vehicleid);
  2322. // Put the player back in the vehicle
  2323. PutPlayerInVehicle(playerid, vehicleid, 0);
  2324. // Turn on the engine and lights the current status of the vehicle
  2325. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2326. SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
  2327. }
  2328. }
  2329. else
  2330. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Você precisa estar em um veículo para alterar a placa.");
  2331. }
  2332. else
  2333. return 0;
  2334. }
  2335. else
  2336. return 0;
  2337.  
  2338. // Let the server know that this was a valid command
  2339. return 1;
  2340. }
  2341.  
  2342. // Asks which vehicle parameter you wanna toggle
  2343. COMMAND:painel(playerid, params[])
  2344. {
  2345. // Send the command to all admins so they can see it
  2346. SendAdminText(playerid, "/painel", params);
  2347.  
  2348. // Check if the player has logged in
  2349. if (APlayerData[playerid][LoggedIn] == true)
  2350. {
  2351. // Check if the player's admin-level is at least 3
  2352. if (APlayerData[playerid][PlayerLevel] >= 0)
  2353. {
  2354. // Let the player select a weather-type
  2355. ShowPlayerDialog(playerid, DialogCarOption, DIALOG_STYLE_LIST, "Selecione a opção:", "Motor\nFaróis\nAlarme\nPortas\nCapo\nPorta Malas\nObjetivo", "OK", "Cancelar");
  2356. }
  2357. else
  2358. return 0;
  2359. }
  2360. else
  2361. return 0;
  2362.  
  2363. // Let the server know that this was a valid command
  2364. return 1;
  2365. }
  2366.  
  2367. // Sets the global weather
  2368. COMMAND:clima(playerid, params[])
  2369. {
  2370. SendAdminText(playerid, "/clima", params);
  2371. if (APlayerData[playerid][LoggedIn] == true)
  2372. {
  2373. if (APlayerData[playerid][PlayerLevel] >= 3)
  2374. {
  2375. ShowPlayerDialog(playerid, DialogWeather, DIALOG_STYLE_LIST, "Selecione o tipo de água:", "Normal\nTempestade\nFoggy\nEscaldante\nDull, nublado, chuvoso\nSandstorm\nVerde Fog\nEscuro, nublado, marrom\nExtremamente brilhante\nTrevas tóxicos céu nuvens\nPreto e branco", "Selecionar", "Cancelar");
  2376. }
  2377. else
  2378. return 0;
  2379. }
  2380. else
  2381. return 0;
  2382. return 1;
  2383. }
  2384. COMMAND:noite(playerid, params[])
  2385. {
  2386. if (APlayerData[playerid][PlayerLevel] >= 4)
  2387. {
  2388. SetWorldTime(24);
  2389. }
  2390. return 1;
  2391. }
  2392. COMMAND:dia(playerid, params[])
  2393. {
  2394. if (APlayerData[playerid][PlayerLevel] >= 4)
  2395. {
  2396. SetWorldTime(12);
  2397. }
  2398. return 1;
  2399. }
  2400.  
  2401.  
  2402. // This command lists all online admins
  2403. COMMAND:admins(playerid, params[])
  2404. {
  2405. // Setup local variables
  2406. new AdminList[500], Name[24];
  2407.  
  2408. // Send the command to all admins so they can see it
  2409. SendAdminText(playerid, "/admins", params);
  2410.  
  2411. // Check if the player has logged in
  2412. if (APlayerData[playerid][LoggedIn] == true)
  2413. {
  2414. // Scan through all players
  2415. for (new i; i < MAX_PLAYERS; i++)
  2416. {
  2417. // Check if this player is connected
  2418. if (IsPlayerConnected(i))
  2419. {
  2420. // Get the name of the player
  2421. GetPlayerName(i, Name, sizeof(Name));
  2422.  
  2423. // Check if this player is an RCON admin
  2424. if (IsPlayerAdmin(i))
  2425. {
  2426. // Add all admin players to the list
  2427. format(AdminList, 500, "%s%s: %s (id: %i), Level de admin: %i (RCON admin)\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
  2428. // Re-start the for loop (skipping the remaining code for this iteration)
  2429. continue;
  2430. }
  2431.  
  2432. //Check if that player is an admin (using the PlayerLevel)
  2433. if (APlayerData[i][PlayerLevel] > 0)
  2434. {
  2435. // Add all admin players to the list
  2436. format(AdminList, 500, "%s%s: %s (id: %i), Level de admin: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
  2437. }
  2438. }
  2439. }
  2440.  
  2441. // Check if there were admin-names added to the list
  2442. if (strlen(AdminList) > 0)
  2443. ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Admins Online:", AdminList, "OK", "Cancelar");
  2444. else
  2445. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Não tem admins online!"); // No admins are online
  2446. }
  2447. else
  2448. return 0;
  2449.  
  2450. // Let the server know that this was a valid command
  2451. return 1;
  2452. }
  2453.  
  2454. // This command lists all commands for normal players (admin-level 0)
  2455. COMMAND:comandos(playerid, params[])
  2456. {
  2457. // Send the command to all admins so they can see it
  2458. SendAdminText(playerid, "/comandos", params);
  2459.  
  2460. // Check if the player has logged in
  2461. if (APlayerData[playerid][LoggedIn] == true)
  2462. {
  2463. CommandList_Create(playerid); // Create a list of commands (only the first 4 commands) and show the dialog
  2464. }
  2465. else
  2466. return 0;
  2467.  
  2468. // Let the server know that this was a valid command
  2469. return 1;
  2470. }
  2471.  
  2472. COMMAND:comboio(playerid, params[])
  2473. {
  2474. // Setup local variables
  2475. new ConvoyList[750], Name[24], NumMembers, ConvoyStatus[10];
  2476.  
  2477. // Send the command to all admins so they can see it
  2478. SendAdminText(playerid, "/comboio", params);
  2479.  
  2480. // Check if the player has logged in
  2481. if (APlayerData[playerid][LoggedIn] == true)
  2482. {
  2483. // Create the list of convoys with all their data
  2484. for (new i; i < MAX_CONVOYS; i++)
  2485. {
  2486. // Check if this is an empty convoy (not created yet by a player)
  2487. if (AConvoys[i][Status] == CONVOY_EMPTY)
  2488. {
  2489. // Setup data for an empty convoy (one which hasn't been chosen yet)
  2490. NumMembers = 0;
  2491. format(Name, 24, "nenhum");
  2492. format(ConvoyStatus, 10, "vazio");
  2493. }
  2494. else
  2495. {
  2496. // Get the name of the convoy-leader
  2497. GetPlayerName(AConvoys[i][Members][0], Name, sizeof(Name));
  2498. // Calculate the members in the convoy
  2499. NumMembers = Convoy_CountMembers(i);
  2500. // Set the status of the convoy
  2501. switch (AConvoys[i][Status])
  2502. {
  2503. case CONVOY_OPEN: format(ConvoyStatus, 10, "Aberto");
  2504. case CONVOY_FULL: format(ConvoyStatus, 10, "Cheio");
  2505. case CONVOY_CLOSED: format(ConvoyStatus, 10, "Fechado");
  2506. }
  2507. }
  2508.  
  2509. // Put all data together to form the content of the entire dialog
  2510. format(ConvoyList, sizeof(ConvoyList), "%sLíder: {00FF00}%s{FFFFFF}, membros: {FF0000}%i{FFFFFF}, Status: {00FF00}%s{FFFFFF}\n", ConvoyList, Name, NumMembers, ConvoyStatus);
  2511. }
  2512.  
  2513. // Show the dialog
  2514. ShowPlayerDialog(playerid, DialogSelectConvoy, DIALOG_STYLE_LIST, "Selecione o comboio:", ConvoyList, "Selecionar", "Cancelar");
  2515. }
  2516. else
  2517. return 0;
  2518.  
  2519. // Let the server know that this was a valid command
  2520. return 1;
  2521. }
  2522.  
  2523. // Allows the leader to kick a member from the convoy
  2524. COMMAND:comboiokick(playerid, params[])
  2525. {
  2526. // Setup local variables
  2527. new Convoy, LeaderID, OtherPlayer, LeaderName[24], MemberName[24], Msg[128];
  2528.  
  2529. // Send the command to all admins so they can see it
  2530. SendAdminText(playerid, "/comboiokick", params);
  2531.  
  2532. // Check if the player has logged in
  2533. if (APlayerData[playerid][LoggedIn] == true)
  2534. {
  2535. Convoy = APlayerData[playerid][ConvoyID]; // Get the convoy of the player
  2536. LeaderID = AConvoys[Convoy][Members][0]; // Get the leader of his convoy
  2537.  
  2538. // Check if this player is part of a convoy
  2539. if (APlayerData[playerid][InConvoy] == true)
  2540. {
  2541. // Check if this player is the leader of the convoy
  2542. if (LeaderID == playerid)
  2543. {
  2544. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /comboiokick [id]");
  2545. else
  2546. {
  2547. // Check if that other player is part of the convoy
  2548. if ((APlayerData[OtherPlayer][InConvoy] == true) && (APlayerData[OtherPlayer][ConvoyID] == Convoy))
  2549. {
  2550. // Kick the other player from the convoy
  2551. Convoy_Leave(OtherPlayer);
  2552. // Get the names of the leader and member
  2553. GetPlayerName(playerid, LeaderName, sizeof(LeaderName));
  2554. GetPlayerName(OtherPlayer, MemberName, sizeof(MemberName));
  2555. // Inform the leader that he has kicked the other player
  2556. format(Msg, 128, "[CDM] Você kickou {0000FF}%s{00FF00} do comboio.", MemberName);
  2557. SendClientMessage(playerid, 0x00FF00FF, Msg);
  2558. // Inform the leader that he has kicked the other player
  2559. format(Msg, 128, "[CDM] O líder {0000FF}%s{00FF00} te kickou do comboio.", LeaderName);
  2560. SendClientMessage(OtherPlayer, 0x00FF00FF, Msg);
  2561. }
  2562. else
  2563. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode kickar um jogador que não faz parte do seu comboio.");
  2564. }
  2565. }
  2566. else
  2567. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa ser líder para kickar um membro de um comboio.");
  2568. }
  2569. else
  2570. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa ser líder para kickar um membro de um comboio.");
  2571. }
  2572. else
  2573. return 0;
  2574.  
  2575. // Let the server know that this was a valid command
  2576. return 1;
  2577. }
  2578.  
  2579. // Allows a convoy-member to leave the convoy
  2580. COMMAND:comboiosair(playerid, params[])
  2581. {
  2582. // Send the command to all admins so they can see it
  2583. SendAdminText(playerid, "/comboiosair", params);
  2584.  
  2585. // Check if the player has logged in
  2586. if (APlayerData[playerid][LoggedIn] == true)
  2587. {
  2588. // Check if this player is part of a convoy
  2589. if (APlayerData[playerid][InConvoy] == true)
  2590. {
  2591. // Kick the other player from the convoy
  2592. Convoy_Leave(playerid);
  2593. // Inform the player that he left the convoy
  2594. SendClientMessage(playerid, 0x00FF00FF, "[CDM] Você saiu do comboio.");
  2595. }
  2596. }
  2597. else
  2598. return 0;
  2599.  
  2600. // Let the server know that this was a valid command
  2601. return 1;
  2602. }
  2603.  
  2604. // Allows the leader to cancel a convoy
  2605. COMMAND:comboiocancelar(playerid, params[])
  2606. {
  2607. // Setup local variables
  2608. new Convoy, LeaderID;
  2609.  
  2610. // Send the command to all admins so they can see it
  2611. SendAdminText(playerid, "/comboiocancelar", params);
  2612.  
  2613. // Check if the player has logged in
  2614. if (APlayerData[playerid][LoggedIn] == true)
  2615. {
  2616. Convoy = APlayerData[playerid][ConvoyID]; // Get the convoy of the player
  2617. LeaderID = AConvoys[Convoy][Members][0]; // Get the leader of his convoy
  2618.  
  2619. // Check if this player is part of a convoy
  2620. if (APlayerData[playerid][InConvoy] == true)
  2621. {
  2622. // Check if this player is the leader of the convoy
  2623. if (LeaderID == playerid)
  2624. Convoy_Cancel(Convoy); // Cancel the convoy, kicking every other member from it
  2625. else
  2626. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa ser líder do comboio para cancelá-lo.");
  2627. }
  2628. else
  2629. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa ser líder do comboio para cancelá-lo.");
  2630. }
  2631. else
  2632. return 0;
  2633.  
  2634. // Let the server know that this was a valid command
  2635. return 1;
  2636. }
  2637.  
  2638. // Displays all members in the convoy
  2639. COMMAND:comboiomembros(playerid, params[])
  2640. {
  2641. // Setup local variables
  2642. new Name[24], MemberList[1000], Convoy;
  2643.  
  2644. // Send the command to all admins so they can see it
  2645. SendAdminText(playerid, "/comboiomembros", params);
  2646.  
  2647. // Check if the player has logged in
  2648. if (APlayerData[playerid][LoggedIn] == true)
  2649. {
  2650. // Check if the member is in a convoy
  2651. if (APlayerData[playerid][InConvoy] == true)
  2652. {
  2653. // Get the convoyID of the member
  2654. Convoy = APlayerData[playerid][ConvoyID];
  2655.  
  2656. // Loop through all members
  2657. for (new i; i < CONVOY_MAX_MEMBERS; i++)
  2658. {
  2659. if (AConvoys[Convoy][Members][i] != -1) // Check if this member-spot is occupied
  2660. {
  2661. // Get the name of the member
  2662. GetPlayerName(AConvoys[Convoy][Members][i], Name, sizeof(Name));
  2663. // Add the membernames to the list
  2664. format(MemberList, 1000, "%s%s\n", MemberList, Name);
  2665. }
  2666. }
  2667.  
  2668. // Show the dialog
  2669. ShowPlayerDialog(playerid, DialogConvoyMembers, DIALOG_STYLE_LIST, "Membros do comboio", MemberList, "OK", "Cancelar");
  2670. }
  2671. else
  2672. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não é um mmembro de um comboio.");
  2673. }
  2674. else
  2675. return 0;
  2676.  
  2677. // Let the server know that this was a valid command
  2678. return 1;
  2679. }
  2680.  
  2681. // Displays the statictics of the player
  2682. COMMAND:status(playerid, params[])
  2683. {
  2684. // Setup local variables
  2685. new StatsMsg[1000], Name[24], TitleMsg[128];
  2686.  
  2687. // Send the command to all admins so they can see it
  2688. SendAdminText(playerid, "/status", params);
  2689.  
  2690. // Check if the player has logged in
  2691. if (APlayerData[playerid][LoggedIn] == true)
  2692. {
  2693. // Construct the stats
  2694. format(StatsMsg, 1000, "KM rodados: {00FF00}%f{FFFFFF}\n", (APlayerData[playerid][StatsMetersDriven] / 1000));
  2695. format(StatsMsg, 1000, "%sTrabalhos de Caminhoneiro concluídos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsTruckerJobs]);
  2696. format(StatsMsg, 1000, "%sTrabalhos em Comboio concluídos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsConvoyJobs]);
  2697. format(StatsMsg, 1000, "%sRotas de Ônibus concluídas: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsBusDriverJobs]);
  2698. format(StatsMsg, 1000, "%sTrabalhos de Voo concluídos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsPilotJobs]);
  2699. format(StatsMsg, 1000, "%sTrabalhos nos Correios concluídos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsCourierJobs]);
  2700. format(StatsMsg, 1000, "%sTrabalhos no DNIT concluídos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsRoadworkerJobs]);
  2701. format(StatsMsg, 1000, "%sTrabalhos de Mecânico concluídos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsAssistance]);
  2702. format(StatsMsg, 1000, "%sTrabalhos na Máfia concluídos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsMafiaJobs]);
  2703. format(StatsMsg, 1000, "%sCargas-Máfia roubadas e entregadas: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsMafiaStolen]);
  2704. format(StatsMsg, 1000, "%sJogadores multados: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsPoliceFined]);
  2705. format(StatsMsg, 1000, "%sJogadores presos: {00FF00}%i{FFFFFF}\n", StatsMsg, APlayerData[playerid][StatsPoliceJailed]);
  2706. // Get the player's name
  2707. GetPlayerName(playerid, Name, sizeof(Name));
  2708. // Construct the title for the dialog
  2709. format(TitleMsg, 128, "Estatisticas para %s:", Name);
  2710.  
  2711. // Show the dialog
  2712. ShowPlayerDialog(playerid, DialogStats, DIALOG_STYLE_LIST, TitleMsg, StatsMsg, "OK", "Cancelar");
  2713. }
  2714. else
  2715. return 0;
  2716.  
  2717. // Let the server know that this was a valid command
  2718. return 1;
  2719. }
  2720.  
  2721. // Restarts the server
  2722. COMMAND:gmx(playerid, params[])
  2723. {
  2724. SendAdminText(playerid, "/gmx", params);
  2725. if (APlayerData[playerid][LoggedIn] == true)
  2726. {
  2727. if (APlayerData[playerid][PlayerLevel] >= 6)
  2728. {
  2729. GameTextForAll("Reiniciando servidor em 2 minutos!", 5000, 3);
  2730. SendClientMessageToAll(0xA0A0A0, "GMX em 2 minutos!");
  2731. SetTimer("Timer_Restart_WarnPlayers", 1000 * 60, false);
  2732. }
  2733. else
  2734. return 0;
  2735. }
  2736. else
  2737. return 0;
  2738. return 1;
  2739. }
  2740. forward Timer_Restart_WarnPlayers();
  2741. public Timer_Restart_WarnPlayers()
  2742. {
  2743. GameTextForAll("Reiniciando servidor em 1 minuto!", 5000, 3);
  2744. SendClientMessageToAll(0xA0A0A0, "[CDM] GMX em 1 minuto!");
  2745. SetTimer("Timer_Restart_Kick", 1000 * 60, false);
  2746. SendRconCommand("hostname Pending Restart");
  2747. SendRconCommand("password loafkagakggoagka");
  2748.  
  2749. return 1;
  2750. }
  2751.  
  2752. forward Timer_Restart_Kick();
  2753. public Timer_Restart_Kick()
  2754. {
  2755. GameTextForAll("Servidor reiniciando: Todos os players kickados!", 5000, 3);
  2756. for(new i; i < MAX_PLAYERS; i++)
  2757. Kick(i);
  2758. SetTimer("Timer_Restart_Reboot", 1000 * 5, false);
  2759.  
  2760. return 1;
  2761. }
  2762.  
  2763. forward Timer_Restart_Reboot();
  2764. public Timer_Restart_Reboot()
  2765. {
  2766. new HostCommand[128];
  2767. SendRconCommand("gmx");
  2768. format(HostCommand, 128, "hostname %s", GameModeName);
  2769. SendRconCommand(HostCommand);
  2770. SendRconCommand("password 0");
  2771. return 1;
  2772. }
  2773. COMMAND:gmxagora(playerid, params[])
  2774. {
  2775. if (APlayerData[playerid][PlayerLevel] >= 5)
  2776. {
  2777. new HostCommand[128];
  2778. SendRconCommand("gmx");
  2779. format(HostCommand, 128, "hostname Resetando server...");
  2780. SendRconCommand(HostCommand);
  2781. SendRconCommand("password 0");
  2782. }
  2783. return 1;
  2784. }
  2785. COMMAND:criarradar(playerid, params[])
  2786. {
  2787. // Setup local variables
  2788. new Float:x, Float:y, Float:z, Float:Angle, MaxSpeed, file[100], File:PFile, LineForFile[100], Msg[128];
  2789.  
  2790. SendAdminText(playerid, "/criarradar", params);
  2791. if (APlayerData[playerid][LoggedIn] == true)
  2792. {
  2793. if (APlayerData[playerid][PlayerLevel] >= 5)
  2794. {
  2795. if (sscanf(params, "i", MaxSpeed)) SendClientMessage(playerid, 0xFF0000AA, "Use: /criarradar [Vel.Max]");
  2796. else
  2797. {
  2798. GetPlayerPos(playerid, x, y, z);
  2799. GetPlayerFacingAngle(playerid, Angle);
  2800. z = z - 1.0; // Adjust camera Z-coordinate 1m lower than normal (otherwise the camera floats in the air)
  2801. SetPlayerPos(playerid, x, y + 1.0, z + 1.0);
  2802. for (new CamID; CamID < MAX_CAMERAS; CamID++)
  2803. {
  2804. if (ACameras[CamID][CamSpeed] == 0)
  2805. {
  2806. SetupSpeedCamera(CamID, x, y, z, Angle, MaxSpeed);
  2807. format(file, sizeof(file), CameraFile, CamID);
  2808. PFile = fopen(file, io_write);
  2809. format(LineForFile, 100, "CamX %f\r\n", x);
  2810. fwrite(PFile, LineForFile);
  2811. format(LineForFile, 100, "CamY %f\r\n", y);
  2812. fwrite(PFile, LineForFile);
  2813. format(LineForFile, 100, "CamZ %f\r\n", z);
  2814. fwrite(PFile, LineForFile);
  2815. format(LineForFile, 100, "CamAngle %f\r\n", Angle);
  2816. fwrite(PFile, LineForFile);
  2817. format(LineForFile, 100, "CamSpeed %i\r\n", MaxSpeed);
  2818. fwrite(PFile, LineForFile);
  2819. fclose(PFile);
  2820. format(Msg, 128, "Você criou o radar ID: %i", CamID);
  2821. SendClientMessage(playerid, 0x00FF00FF, Msg);
  2822. return 1;
  2823. }
  2824. }
  2825.  
  2826. // In case all camera-slots are occupied (100 camera's have been created already), let the player know about it
  2827. format(Msg, 128, "{FF0000}[CDM] Você não pode criar mais de %i radares.", MAX_CAMERAS);
  2828. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  2829. }
  2830. }
  2831. else
  2832. return 0;
  2833. }
  2834. else
  2835. return 0;
  2836.  
  2837. // Let the server know that this was a valid command
  2838. return 1;
  2839. }
  2840.  
  2841. // This command allows you to delete a speedcamera
  2842. COMMAND:deletarradar(playerid, params[])
  2843. {
  2844. // Setup local variables
  2845. new file[100], Msg[128];
  2846.  
  2847. // Send the command to all admins so they can see it
  2848. SendAdminText(playerid, "/deletarradar", params);
  2849.  
  2850. // Check if the player has logged in
  2851. if (APlayerData[playerid][LoggedIn] == true)
  2852. {
  2853. // Check if the player's admin-level is at least 5
  2854. if (APlayerData[playerid][PlayerLevel] >= 5)
  2855. {
  2856. // Loop through all camera's
  2857. for (new CamID; CamID < MAX_CAMERAS; CamID++)
  2858. {
  2859. // Check if this index is used
  2860. if (ACameras[CamID][CamSpeed] != 0)
  2861. {
  2862. // Check if the player is in range of the camera
  2863. if (IsPlayerInRangeOfPoint(playerid, 5.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
  2864. {
  2865. // Delete the file
  2866. format(file, sizeof(file), CameraFile, CamID); // Construct the complete filename for this camera-file
  2867. if (fexist(file)) // Make sure the file exists
  2868. fremove(file); // Delete the file
  2869.  
  2870. // Delete both camera objects
  2871. DestroyObject(ACameras[CamID][CamObj1]);
  2872. DestroyObject(ACameras[CamID][CamObj2]);
  2873. // Also clear the data from memory
  2874. ACameras[CamID][CamX] = 0.0;
  2875. ACameras[CamID][CamY] = 0.0;
  2876. ACameras[CamID][CamZ] = 0.0;
  2877. ACameras[CamID][CamAngle] = 0.0;
  2878. ACameras[CamID][CamSpeed] = 0;
  2879. ACameras[CamID][CamObj1] = 0;
  2880. ACameras[CamID][CamObj2] = 0;
  2881.  
  2882. // Let the player know he deleted a camera
  2883. format(Msg, 128, "[CDM] Você deletou o radar %i", CamID);
  2884. SendClientMessage(playerid, 0x00FF00FF, Msg);
  2885.  
  2886. // Exit the function
  2887. return 1;
  2888. }
  2889. }
  2890. }
  2891.  
  2892. // In case the player wasn't near a speedcamera, inform him about it
  2893. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esteja em um radar para deletá-lo");
  2894. }
  2895. else
  2896. return 0;
  2897. }
  2898. else
  2899. return 0;
  2900.  
  2901. // Let the server know that this was a valid command
  2902. return 1;
  2903. }
  2904.  
  2905.  
  2906.  
  2907. // This command ports a player to the player who executed the command
  2908. COMMAND:trazer(playerid, params[])
  2909. {
  2910. // Setup local variables
  2911. new OtherPlayer, Float:x, Float:y, Float:z, PortMsg[128], IntID, WorldID, Name[24];
  2912.  
  2913. // Send the command to all admins so they can see it
  2914. SendAdminText(playerid, "/trazer", params);
  2915.  
  2916. // Check if the player has logged in
  2917. if (APlayerData[playerid][LoggedIn] == true)
  2918. {
  2919. // Check if the player's admin-level is at least 1
  2920. if (APlayerData[playerid][PlayerLevel] >= 1)
  2921. {
  2922. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /trazer [id]");
  2923. else
  2924. {
  2925. // Check if that other player is online
  2926. if (IsPlayerConnected(OtherPlayer))
  2927. {
  2928. // Get the name of the other player
  2929. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  2930. // Get the location of the player
  2931. GetPlayerPos(playerid, x, y, z);
  2932. IntID = GetPlayerInterior(playerid);
  2933. WorldID = GetPlayerVirtualWorld(playerid);
  2934. // Port the other player to this player
  2935. SetPlayerVirtualWorld(OtherPlayer, WorldID);
  2936. SetPlayerInterior(OtherPlayer, IntID);
  2937. SetPlayerPos(OtherPlayer, x, y, z + 3.0);
  2938. // Let the player know about it
  2939. format(PortMsg, 128, "{00FF00}[CDM] Você trouxe {FFFF00}%s{00FF00} até você.", Name);
  2940. SendClientMessage(playerid, 0xFFFFFFFF, PortMsg);
  2941. }
  2942. else
  2943. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não está online.");
  2944. }
  2945. }
  2946. else
  2947. return 0;
  2948. }
  2949. else
  2950. return 0;
  2951.  
  2952. // Let the server know that this was a valid command
  2953. return 1;
  2954. }
  2955.  
  2956. // This command deleted all vehicles that are spawned using /car, /plane, /bike, /trailer
  2957. COMMAND:limparcarros(playerid, params[])
  2958. {
  2959. // Setup local variables
  2960. new CarsDeleted, Msg[128];
  2961.  
  2962. // Send the command to all admins so they can see it
  2963. SendAdminText(playerid, "/limparcarros", params);
  2964.  
  2965. // Check if the player has logged in
  2966. if (APlayerData[playerid][LoggedIn] == true)
  2967. {
  2968. // Check if the player's admin-level is at least 3
  2969. if (APlayerData[playerid][PlayerLevel] >= 4)
  2970. {
  2971. // Loop through all vehicles
  2972. for (new vid; vid < 2000; vid++)
  2973. {
  2974. // Check if this vehicle exists (check the model), otherwise all empty slots are processed as well
  2975. if (AVehicleData[vid][Model] != 0)
  2976. {
  2977. // Check if the vehicle is NOT a static vehicle
  2978. if (AVehicleData[vid][StaticVehicle] == false)
  2979. {
  2980. // Check if the vehicle is NOT owned by anybody (this leaves all vehicles spawned with /car, /trailer, /plane)
  2981. if (AVehicleData[vid][Owned] == false)
  2982. {
  2983. // Count the cars that have been deleted
  2984. CarsDeleted++;
  2985. // Delete the vehicle and clear the data
  2986. DestroyVehicle(vid);
  2987. AVehicleData[vid][Owned] = false;
  2988. AVehicleData[vid][Owner] = 0;
  2989. AVehicleData[vid][Model] = 0;
  2990. AVehicleData[vid][PaintJob] = 0;
  2991. for (new i; i < 14; i++)
  2992. AVehicleData[vid][Components][i] = 0;
  2993. AVehicleData[vid][SpawnX] = 0.0;
  2994. AVehicleData[vid][SpawnY] = 0.0;
  2995. AVehicleData[vid][SpawnZ] = 0.0;
  2996. AVehicleData[vid][SpawnRot] = 0.0;
  2997. AVehicleData[vid][BelongsToHouse] = 0;
  2998. }
  2999. }
  3000. }
  3001. }
  3002.  
  3003. // Let the player know how many vehicles have been cleaned up
  3004. format(Msg, 128, "{00FF00}[CDM] Total de carros limpos da cidade: {FFFF00}%i", CarsDeleted);
  3005. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3006. }
  3007. else
  3008. return 0;
  3009. }
  3010. else
  3011. return 0;
  3012.  
  3013. // Let the server know that this was a valid command
  3014. return 1;
  3015. }
  3016.  
  3017. // This command allows the player to call for assistance
  3018. COMMAND:assistencia(playerid, params[])
  3019. {
  3020. // Setup local variables
  3021. new bool:AssistOnline = false, Msg[128], Name[24];
  3022.  
  3023. // Send the command to all admins so they can see it
  3024. SendAdminText(playerid, "/assistencia", params);
  3025.  
  3026. // Check if the player has logged in
  3027. if (APlayerData[playerid][LoggedIn] == true)
  3028. {
  3029. // Get the player's name
  3030. GetPlayerName(playerid, Name, sizeof(Name));
  3031. // Preset the message that needs to be sent to assistance players
  3032. format(Msg, 128, "{00FF00}O jogador {FFFF00}%s{00FF00} precisa de assistência mecânica.", Name);
  3033.  
  3034. // Check if there is at least one assistance player online
  3035. for (new i; i < MAX_PLAYERS; i++)
  3036. {
  3037. // Check if this player is connected
  3038. if (IsPlayerConnected(i))
  3039. {
  3040. // Check if this player is assistance class
  3041. if (APlayerData[i][PlayerClass] == ClassAssistance)
  3042. {
  3043. // Set the flag to indicate that at least one assistance player is online
  3044. AssistOnline = true;
  3045. // Send the assistance player a message to inform him who needs assistance
  3046. SendClientMessage(i, 0xFFFFFFFF, Msg);
  3047. }
  3048. }
  3049. }
  3050.  
  3051. // Check if there is at least one assistance player online
  3052. if (AssistOnline == true)
  3053. {
  3054. // Set yourself as "AssistanceNeeded"
  3055. APlayerData[playerid][AssistanceNeeded] = true;
  3056. // Let the player know he called for assistance
  3057. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}[CDM] Você ja pediu ajuda.");
  3058. }
  3059. else // No assistance is online
  3060. {
  3061. // Check if the player is the driver of a vehicle
  3062. if (GetPlayerVehicleSeat(playerid) == 0)
  3063. {
  3064. // Fully repair the vehicle (damage value and bodywork)
  3065. RepairVehicle(GetPlayerVehicleID(playerid));
  3066. // Also re-fuel the vehicle
  3067. AVehicleData[GetPlayerVehicleID(playerid)][Fuel] = MaxFuel;
  3068. // Let the player pay for the repairs and refuel (default $2000)
  3069. RewardPlayer(playerid, -2000, 0);
  3070. // Let the player know he spent $2000 for auto-repair because there were no assistance players online
  3071. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Seu veículo foi reparado e abastecido por R$2000.");
  3072. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Não hà mecânico online.");
  3073. }
  3074. }
  3075. }
  3076. else
  3077. return 0;
  3078.  
  3079. // Let the server know that this was a valid command
  3080. return 1;
  3081. }
  3082.  
  3083. // This command adds nitro to the player's vehicle
  3084. COMMAND:nos(playerid, params[])
  3085. {
  3086. // Send the command to all admins so they can see it
  3087. SendAdminText(playerid, "/nos", params);
  3088.  
  3089. // Check if the player has logged in
  3090. if (APlayerData[playerid][LoggedIn] == true)
  3091. {
  3092. // Check if the player's admin-level is at least 1
  3093. if (APlayerData[playerid][PlayerLevel] >= 1)
  3094. {
  3095. // Check if the player is the driver of a vehicle
  3096. if (GetPlayerVehicleSeat(playerid) == 0)
  3097. {
  3098. // Check if the vehicle isn't owned (owned vehicle's need to buy nitro at mod garages)
  3099. if (AVehicleData[GetPlayerVehicleID(playerid)][Owned] == false)
  3100. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); // Add nitro to the player's vehicle
  3101. }
  3102. }
  3103. else
  3104. return 0;
  3105. }
  3106. else
  3107. return 0;
  3108.  
  3109. // Let the server know that this was a valid command
  3110. return 1;
  3111. }
  3112.  
  3113. // This command let's an admin spectate another player
  3114. COMMAND:espiar(playerid, params[])
  3115. {
  3116. // Setup local variables
  3117. new OtherPlayer, Name[24], Msg[128];
  3118.  
  3119. // Check if the player has logged in
  3120. if (APlayerData[playerid][LoggedIn] == true)
  3121. {
  3122. // Check if the player's admin-level is at least 1
  3123. if (APlayerData[playerid][PlayerLevel] >= 1)
  3124. {
  3125. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /espiar [id]");
  3126. else
  3127. {
  3128. // Check if that other player is online
  3129. if (IsPlayerConnected(OtherPlayer))
  3130. {
  3131. // Get the player's name
  3132. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  3133.  
  3134. // Turn spectating on
  3135. TogglePlayerSpectating(playerid, 1);
  3136.  
  3137. // Check if the other player is driving a vehicle
  3138. if (GetPlayerVehicleSeat(OtherPlayer) == -1)
  3139. {
  3140. // The other player is on foot, so spectate him
  3141. PlayerSpectatePlayer(playerid, OtherPlayer);
  3142. SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer));
  3143. APlayerData[playerid][SpectateID] = OtherPlayer;
  3144. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER;
  3145. }
  3146. else
  3147. {
  3148. // The other player is in a vehicle, so spectate the vehicle
  3149. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(OtherPlayer));
  3150. APlayerData[playerid][SpectateID] = OtherPlayer;
  3151. APlayerData[playerid][SpectateVehicle] = GetPlayerVehicleID(OtherPlayer);
  3152. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE;
  3153. }
  3154.  
  3155. format(Msg, 128, "{00FF00}[CDM] Você está espiando {FFFF00}%s.", Name);
  3156. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3157. }
  3158. else
  3159. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não está online.");
  3160. }
  3161. }
  3162. else
  3163. return 0;
  3164. }
  3165. else
  3166. return 0;
  3167.  
  3168. // Let the server know that this was a valid command
  3169. return 1;
  3170. }
  3171.  
  3172. // This command ends the spectate mode
  3173. COMMAND:pararespiar(playerid, params[])
  3174. {
  3175. // Check if the player has logged in
  3176. if (APlayerData[playerid][LoggedIn] == true)
  3177. {
  3178. // Check if the player's admin-level is at least 1
  3179. if (APlayerData[playerid][PlayerLevel] >= 1)
  3180. {
  3181. // Check if the player is spectating
  3182. if (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
  3183. {
  3184. TogglePlayerSpectating(playerid, 0);
  3185. APlayerData[playerid][SpectateID] = -1;
  3186. APlayerData[playerid][SpectateVehicle] = -1;
  3187. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_NONE;
  3188. }
  3189. else
  3190. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não está espiando.");
  3191. }
  3192. else
  3193. return 0;
  3194. }
  3195. else
  3196. return 0;
  3197.  
  3198. // Let the server know that this was a valid command
  3199. return 1;
  3200. }
  3201.  
  3202.  
  3203.  
  3204. // Lets the player add new businesses
  3205. COMMAND:criarempresa(playerid, params[])
  3206. {
  3207. // Setup local variables
  3208. new BusinessList[2000];
  3209.  
  3210. // Send the command to all admins so they can see it
  3211. SendAdminText(playerid, "/criarempresa", params);
  3212.  
  3213. // Check if the player has logged in
  3214. if (APlayerData[playerid][LoggedIn] == true)
  3215. {
  3216. // Check if the player's admin-level is at least 5
  3217. if (APlayerData[playerid][PlayerLevel] >= 5)
  3218. {
  3219. // Check if the player isn't inside a vehicle
  3220. if (GetPlayerVehicleSeat(playerid) == -1)
  3221. {
  3222. // Construct the list of businesses
  3223. for (new BusType = 1; BusType < sizeof(ABusinessInteriors); BusType++)
  3224. {
  3225. format(BusinessList, sizeof(BusinessList), "%s%s\n", BusinessList, ABusinessInteriors[BusType][InteriorName]);
  3226. }
  3227.  
  3228. // Let the player choose a business-type via a dialog
  3229. ShowPlayerDialog(playerid, DialogCreateBusSelType, DIALOG_STYLE_LIST, "Escolha o tipo de empresa:", BusinessList, "Selecionar", "Cancelar");
  3230. }
  3231. else
  3232. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode criar uma empresa e dentro de um veículo.");
  3233. }
  3234. }
  3235. else
  3236. return 0;
  3237.  
  3238. // Let the server know that this was a valid command
  3239. return 1;
  3240. }
  3241.  
  3242. // This command lets the player delete a business
  3243. COMMAND:deletarempresa(playerid, params[])
  3244. {
  3245. // Setup local variables
  3246. new file[100], Msg[128];
  3247.  
  3248. // Send the command to all admins so they can see it
  3249. SendAdminText(playerid, "/deletarempresa", params);
  3250.  
  3251. // Check if the player has logged in
  3252. if (APlayerData[playerid][LoggedIn] == true)
  3253. {
  3254. // Check if the player's admin-level is at least 5
  3255. if (APlayerData[playerid][PlayerLevel] >= 6)
  3256. {
  3257. // Make sure the player isn't inside a vehicle
  3258. if (GetPlayerVehicleID(playerid) == 0)
  3259. {
  3260. // Loop through all player-owned businesses
  3261. for (new BusID = 1; BusID < MAX_BUSINESS; BusID++)
  3262. {
  3263. // Check if the business exists
  3264. if (ABusinessData[BusID][PickupID] != 0)
  3265. {
  3266. // Check if the business has no owner
  3267. if (ABusinessData[BusID][Owned] == false)
  3268. {
  3269. // Check if the player is in range of the business-pickup
  3270. if (IsPlayerInRangeOfPoint(playerid, 2.5, ABusinessData[BusID][BusinessX], ABusinessData[BusID][BusinessY], ABusinessData[BusID][BusinessZ]))
  3271. {
  3272. // Clear all data of the business
  3273. ABusinessData[BusID][BusinessName] = 0;
  3274. ABusinessData[BusID][BusinessX] = 0.0;
  3275. ABusinessData[BusID][BusinessY] = 0.0;
  3276. ABusinessData[BusID][BusinessZ] = 0.0;
  3277. ABusinessData[BusID][BusinessType] = 0;
  3278. ABusinessData[BusID][BusinessLevel] = 0;
  3279. ABusinessData[BusID][LastTransaction] = 0;
  3280. ABusinessData[BusID][Owned] = false;
  3281. ABusinessData[BusID][Owner] = 0;
  3282. // Destroy the mapicon, 3DText and pickup for the house
  3283. DestroyDynamicPickup(ABusinessData[BusID][PickupID]);
  3284. DestroyDynamicMapIcon(ABusinessData[BusID][MapIconID]);
  3285. DestroyDynamic3DTextLabel(ABusinessData[BusID][DoorText]);
  3286. ABusinessData[BusID][PickupID] = 0;
  3287. ABusinessData[BusID][MapIconID] = 0;
  3288.  
  3289. // Delete the business-file
  3290. format(file, sizeof(file), BusinessFile, BusID); // Construct the complete filename for this business-file
  3291. if (fexist(file)) // Make sure the file exists
  3292. fremove(file); // Delete the file
  3293.  
  3294. // Also let the player know he deleted the business
  3295. format(Msg, 128, "{00FF00}[CDM] Você deletou a empresa ID: {FFFF00}%i", BusID);
  3296. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3297.  
  3298. // Exit the function
  3299. return 1;
  3300. }
  3301. }
  3302. }
  3303. }
  3304.  
  3305. // There was no house in range, so let the player know about it
  3306. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esteja na porta da empresa que deseja deletar.");
  3307. }
  3308. else
  3309. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode deletar uma empresa de dentro de um veículo.");
  3310. }
  3311. else
  3312. return 0;
  3313. }
  3314. else
  3315. return 0;
  3316.  
  3317. // Let the server know that this was a valid command
  3318. return 1;
  3319. }
  3320.  
  3321. // This command lets the player buy a business when he's standing in range of a business that isn't owned yet
  3322. COMMAND:comprarempresa(playerid, params[])
  3323. {
  3324. // Setup local variables
  3325. new Msg[128], BusType;
  3326.  
  3327. // Send the command to all admins so they can see it
  3328. SendAdminText(playerid, "/comprarempresa", params);
  3329.  
  3330. // Check if the player has logged in
  3331. if (APlayerData[playerid][LoggedIn] == true)
  3332. {
  3333. // Make sure the player isn't inside a vehicle
  3334. if (GetPlayerVehicleID(playerid) == 0)
  3335. {
  3336. // Check if the player is near a business-pickup
  3337. for (new i = 1; i < sizeof(ABusinessData); i++)
  3338. {
  3339. // Check if this business is created (it would have a valid pickup in front of the door)
  3340. if (ABusinessData[i][PickupID] != 0)
  3341. {
  3342. // Check if the player is in range of the business-pickup
  3343. if (IsPlayerInRangeOfPoint(playerid, 2.5, ABusinessData[i][BusinessX], ABusinessData[i][BusinessY], ABusinessData[i][BusinessZ]))
  3344. {
  3345. // Check if the business isn't owned yet
  3346. if (ABusinessData[i][Owned] == false)
  3347. {
  3348. // Get the type of business
  3349. BusType = ABusinessData[i][BusinessType];
  3350. // Check if the player can afford this type of business business
  3351. if (APlayerData[playerid][PlayerMoney] >= ABusinessInteriors[BusType][BusPrice])
  3352. Business_SetOwner(playerid, i); // Give ownership of the business to the player
  3353. else
  3354. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode pagar pela empresa."); // The player cannot afford this business
  3355. }
  3356. else
  3357. {
  3358. // Let the player know that this business is already owned by a player
  3359. format(Msg, 128, "{FF0000}[CDM] Este negócio ja pertence à {00FF00}%s{FFFFFF}.", ABusinessData[i][Owner]);
  3360. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3361. }
  3362.  
  3363. // The player was in range of a business-pickup, so stop searching for the other business pickups
  3364. return 1;
  3365. }
  3366. }
  3367. else
  3368. return 1; // If there are no more houses (no more pickup-id's found), stop searching
  3369. }
  3370.  
  3371. // All businesses have been processed, but the player wasn't in range of any business-pickup, let him know about it
  3372. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Para comprar uma empresa você precisa estar no pickup da mesma.");
  3373. }
  3374. else
  3375. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode comprar uma empresa de dentro de um veículo.");
  3376. }
  3377. else
  3378. return 0;
  3379.  
  3380. // Let the server know that this was a valid command
  3381. return 1;
  3382. }
  3383.  
  3384. // This command opens a menu when you're inside your business to allow to access the options of your business
  3385. COMMAND:menuempresa(playerid, params[])
  3386. {
  3387. // Setup local variables
  3388. new OptionsList[200], DialogTitle[200];
  3389.  
  3390. // Send the command to all admins so they can see it
  3391. SendAdminText(playerid, "/menuempresa", params);
  3392.  
  3393. // Check if the player has logged in
  3394. if (APlayerData[playerid][LoggedIn] == true)
  3395. {
  3396. // Check if the player is inside a business
  3397. if (APlayerData[playerid][CurrentBusiness] != 0)
  3398. {
  3399. format(DialogTitle, sizeof(DialogTitle), "Selecione a opção para: %s", ABusinessData[APlayerData[playerid][CurrentBusiness]][BusinessName]);
  3400.  
  3401. format(OptionsList, sizeof(OptionsList), "%sMudar nome da empresa\n", OptionsList);
  3402. format(OptionsList, sizeof(OptionsList), "%sAtualizar empresa\n", OptionsList);
  3403. format(OptionsList, sizeof(OptionsList), "%sRetirar ganhos da empresa\n", OptionsList);
  3404. format(OptionsList, sizeof(OptionsList), "%sVender empresa\n", OptionsList);
  3405. format(OptionsList, sizeof(OptionsList), "%sSair da empresa\n", OptionsList);
  3406. // Show the businessmenu
  3407. ShowPlayerDialog(playerid, DialogBusinessMenu, DIALOG_STYLE_LIST, DialogTitle, OptionsList, "Selecionar", "Cancelar");
  3408. }
  3409. else
  3410. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não está na empresa.");
  3411. }
  3412. else
  3413. return 0;
  3414.  
  3415. // Let the server know that this was a valid command
  3416. return 1;
  3417. }
  3418.  
  3419. // This command teleports you to your selected business
  3420. COMMAND:irempresa(playerid, params[])
  3421. {
  3422. // Setup local variables
  3423. new BusinessList[1000], BusID, BusType, Earnings;
  3424.  
  3425. // Send the command to all admins so they can see it
  3426. SendAdminText(playerid, "/irempresa", params);
  3427.  
  3428. // Check if the player has logged in
  3429. if (APlayerData[playerid][LoggedIn] == true)
  3430. {
  3431. // Check if the player is not jailed
  3432. if (APlayerData[playerid][PlayerJailed] == 0)
  3433. {
  3434. // Check if the player has a wanted level of less than 3
  3435. if (GetPlayerWantedLevel(playerid) < 3)
  3436. {
  3437. // Check if the player is not inside a vehicle
  3438. if (GetPlayerVehicleID(playerid) == 0)
  3439. {
  3440. // Ask to which business the player wants to port
  3441. for (new i; i < MAX_BUSINESSPERPLAYER; i++)
  3442. {
  3443. // Get the business-id
  3444. BusID = APlayerData[playerid][Business][i];
  3445.  
  3446. // Check if this businessindex is occupied
  3447. if (BusID != 0)
  3448. {
  3449. // Get the business-type
  3450. BusType = ABusinessData[BusID][BusinessType];
  3451. Earnings = (BusinessTransactionTime - ABusinessData[BusID][LastTransaction]) * ABusinessInteriors[BusType][BusEarnings] * ABusinessData[BusID][BusinessLevel];
  3452. format(BusinessList, 1000, "%s{00FF00}%s{FFFFFF} (ganhos: $%i)\n", BusinessList, ABusinessData[BusID][BusinessName], Earnings);
  3453. }
  3454. else
  3455. format(BusinessList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", BusinessList, "Slot vazio");
  3456. }
  3457. ShowPlayerDialog(playerid, DialogGoBusiness, DIALOG_STYLE_LIST, "Escolha a empresa para ir:", BusinessList, "Selecionar", "Cancelar");
  3458. }
  3459. else
  3460. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você precisa estar a pé na porta da empresa.");
  3461. }
  3462. else
  3463. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não pode usar o comando /irempresa quando procurado");
  3464. }
  3465. else
  3466. SendClientMessage(playerid, 0xFF0000FF, "[CDM] Você não pode usar o comando /irempresa quando preso.");
  3467. }
  3468. else
  3469. return 0;
  3470. return 1;
  3471. }
  3472. COMMAND:calar(playerid, params[])
  3473. {
  3474. new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer;
  3475. SendAdminText(playerid, "/calar", params);
  3476. if (APlayerData[playerid][LoggedIn] == true)
  3477. {
  3478. if (APlayerData[playerid][PlayerLevel] >= 1)
  3479. {
  3480. if (sscanf(params, "us[128]", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /calar [id] [motivo]");
  3481. else
  3482. {
  3483. if (IsPlayerConnected(OtherPlayer))
  3484. {
  3485. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  3486. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  3487. APlayerData[OtherPlayer][Muted] = true;
  3488. format(Msg, 128, "{FF0000}-| %s foi calado por %s. Motivo: %s |-", Name, AdminName, Reason);
  3489. SendClientMessageToAll(0xFFFFFFFF, Msg);
  3490. PlayerFile_Save(OtherPlayer);
  3491. }
  3492. else
  3493. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] O jogador não está online.");
  3494. }
  3495. }
  3496. else
  3497. return 0;
  3498. }
  3499. else
  3500. return 0;
  3501. return 1;
  3502. }
  3503. COMMAND:descalar(playerid, params[])
  3504. {
  3505. new Msg[128], Name[24], AdminName[24], OtherPlayer;
  3506. SendAdminText(playerid, "/descalar", params);
  3507. if (APlayerData[playerid][LoggedIn] == true)
  3508. {
  3509. if (APlayerData[playerid][PlayerLevel] >= 1)
  3510. {
  3511. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /descalar [id]");
  3512. else
  3513. {
  3514. if (IsPlayerConnected(OtherPlayer))
  3515. {
  3516. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  3517. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  3518. APlayerData[OtherPlayer][Muted] = false;
  3519. format(Msg, 128, "{FF0000}-| O administrador %s permitiu que %s volte a falar |-", AdminName, Name);
  3520. SendClientMessageToAll(0xFFFFFFFF, Msg);
  3521. PlayerFile_Save(OtherPlayer);
  3522. }
  3523. else
  3524. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] O jogador não está online.");
  3525. }
  3526. }
  3527. else
  3528. return 0;
  3529. }
  3530. else
  3531. return 0;
  3532. return 1;
  3533. }
  3534. COMMAND:mudos(playerid, params[])
  3535. {
  3536. new PlayerList[1000], Name[24];
  3537. SendAdminText(playerid, "/mudos", params);
  3538. if (APlayerData[playerid][LoggedIn] == true)
  3539. {
  3540. if (APlayerData[playerid][PlayerLevel] >= 1)
  3541. {
  3542. for (new i; i < MAX_PLAYERS; i++)
  3543. {
  3544. if (IsPlayerConnected(i))
  3545. {
  3546. if (APlayerData[i][Muted] == true)
  3547. {
  3548. // Get the player's name
  3549. GetPlayerName(i, Name, sizeof(Name));
  3550. // Add his name and ID to the list
  3551. format(PlayerList, sizeof(PlayerList), "%s%s (ID: %i)\n", PlayerList, Name, i);
  3552. }
  3553. }
  3554. }
  3555.  
  3556. // Show the list of muted players to the admin
  3557. if (strlen(PlayerList) != 0)
  3558. ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Jogadores calados:", PlayerList, "OK", "Cancelar");
  3559. else
  3560. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Não ha jogadores calados.");
  3561. }
  3562. else
  3563. return 0;
  3564. }
  3565. else
  3566. return 0;
  3567.  
  3568. // Let the server know that this was a valid command
  3569. return 1;
  3570. }
  3571.  
  3572. // Freeze a player (he cannot move anymore)
  3573. COMMAND:congelar(playerid, params[])
  3574. {
  3575. // Setup local variables
  3576. new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer, Duration;
  3577.  
  3578. // Send the command to all admins so they can see it
  3579. SendAdminText(playerid, "/congelar", params);
  3580.  
  3581. // Check if the player has logged in
  3582. if (APlayerData[playerid][LoggedIn] == true)
  3583. {
  3584. // Check if the player's admin-level is at least 1
  3585. if (APlayerData[playerid][PlayerLevel] >= 5)
  3586. {
  3587. if (sscanf(params, "uis[128]", OtherPlayer, Duration, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /congelar [id] [tempo] [motivo]");
  3588. else
  3589. {
  3590. // Check if the otherplayer is online
  3591. if (IsPlayerConnected(OtherPlayer))
  3592. {
  3593. // Get the player-names
  3594. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  3595. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  3596. // Store the duration for the freeze, freeze him and start the frozentimer
  3597. APlayerData[OtherPlayer][PlayerFrozen] = Duration;
  3598. TogglePlayerControllable(OtherPlayer, 0);
  3599. SetTimerEx("Player_FreezeTimer", 1000, true, "i", OtherPlayer);
  3600. // Let the other player know that he has been muted
  3601. format(Msg, 128, "{FF0000}[CDM] Você foi congelado por {FFFF00}%s {FF0000}. Motivo: {FFFF00}%s.", AdminName, Reason);
  3602. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  3603. // Let the admin know who he has muted
  3604. format(Msg, 128, "{00FF00}[CDM] Você congelou {FFFF00}%s.", Name);
  3605. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3606. // Save the player-stats
  3607. PlayerFile_Save(OtherPlayer);
  3608. }
  3609. else
  3610. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não está online.");
  3611. }
  3612. }
  3613. else
  3614. return 0;
  3615. }
  3616. else
  3617. return 0;
  3618.  
  3619. // Let the server know that this was a valid command
  3620. return 1;
  3621. }
  3622.  
  3623. COMMAND:dardinheiro(playerid, params[])
  3624. {
  3625. new Msg[128], Name[24], OtherName[24], OtherPlayer, Money;
  3626.  
  3627. // Send the command to all admins so they can see it
  3628. SendAdminText(playerid, "/dardinheiro", params);
  3629.  
  3630. // Check if the player has logged in
  3631. if (APlayerData[playerid][LoggedIn] == true)
  3632. {
  3633. if (sscanf(params, "ui", OtherPlayer, Money)) SendClientMessage(playerid, 0xFF0000AA, "Use: /dardinheiro [id] [quantia]");
  3634. else
  3635. {
  3636. // Check if the otherplayer is online
  3637. if (IsPlayerConnected(OtherPlayer))
  3638. {
  3639. // Get the player-names
  3640. GetPlayerName(playerid, Name, sizeof(Name));
  3641. GetPlayerName(OtherPlayer, OtherName, sizeof(OtherName));
  3642.  
  3643. // Check if the money has a positive value (to prevent stealing money using negative values)
  3644. if (Money > 0)
  3645. {
  3646. // Check if the player has enough money
  3647. if (APlayerData[playerid][PlayerMoney] >= Money)
  3648. {
  3649. // Transfer the money
  3650. RewardPlayer(playerid, -Money, 0);
  3651. RewardPlayer(OtherPlayer, Money, 0);
  3652. // Let the other player know that he has received money
  3653. format(Msg, 128, "{00FF00}[CDM] Você recebeu {FFFF00}R$%i{00FF00} de {FFFF00}%s.", Money, Name);
  3654. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  3655. // Let the player know he gave money to somebody else
  3656. format(Msg, 128, "{00FF00}[CDM] Você deu {FFFF00}R$%i{00FF00} para {FFFF00}%s.", Money, OtherName);
  3657. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3658. // Save the player-stats
  3659. PlayerFile_Save(playerid);
  3660. PlayerFile_Save(OtherPlayer);
  3661. }
  3662. else
  3663. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você não tem dinheiro suficiente.");
  3664. }
  3665. else
  3666. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você deve usar valores maiores que 0.");
  3667. }
  3668. else
  3669. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não está online.");
  3670. }
  3671. }
  3672. else
  3673. return 0;
  3674.  
  3675. // Let the server know that this was a valid command
  3676. return 1;
  3677. }
  3678.  
  3679. COMMAND:respawncarros(playerid, params[])
  3680. {
  3681. // Setup local variables
  3682. new vid, Msg[128];
  3683.  
  3684. // Send the command to all admins so they can see it
  3685. SendAdminText(playerid, "/respawncarros", params);
  3686.  
  3687. // Check if the player has logged in
  3688. if (APlayerData[playerid][LoggedIn] == true)
  3689. {
  3690. // Check if the player's admin-level is at least 1
  3691. if (APlayerData[playerid][PlayerLevel] >= 5)
  3692. {
  3693. if (sscanf(params, "i", vid)) SendClientMessage(playerid, 0xFF0000AA, "Use: /respawncarros");
  3694. else
  3695. {
  3696. // Check if the vehicle-id is valid
  3697. if ((vid > 0) && (vid < 2000))
  3698. {
  3699. // Check if the vehicle exists
  3700. if (AVehicleData[vid][Model] != 0)
  3701. {
  3702. // Force the vehicle to respawn
  3703. SetVehicleToRespawn(vid);
  3704. // Let the player know he respawned the vehicle
  3705. format(Msg, 128, "{00FF00}[CDM] Você respawnou o veiculo {FFFF00}%i", vid);
  3706. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3707. }
  3708. }
  3709. else
  3710. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] O ID do veiculo deve ser entre 1 e 1999.");
  3711. }
  3712. }
  3713. else
  3714. return 0;
  3715. }
  3716. else
  3717. return 0;
  3718.  
  3719. // Let the server know that this was a valid command
  3720. return 1;
  3721. }
  3722.  
  3723. // Creates a spikestrip (can only be used by police players)
  3724. COMMAND:tapete(playerid, params[])
  3725. {
  3726. // Send the command to all admins so they can see it
  3727. SendAdminText(playerid, "/tapete", params);
  3728.  
  3729. // Check if the player has logged in
  3730. if (APlayerData[playerid][LoggedIn] == true)
  3731. {
  3732. // Check if the player if a police player
  3733. if (APlayerData[playerid][PlayerClass] == ClassPolice)
  3734. {
  3735. // Check if the player is on foot
  3736. if (GetPlayerVehicleSeat(playerid) == -1)
  3737. {
  3738. // Try to create a spikestrip
  3739. SpikeStrip_Create(playerid);
  3740. }
  3741. else
  3742. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Você deve estar apé para usar os pregos.");
  3743. }
  3744. else
  3745. return 0;
  3746. }
  3747. else
  3748. return 0;
  3749.  
  3750. // Let the server know that this was a valid command
  3751. return 1;
  3752. }
  3753.  
  3754. // This command ejects a player from his vehicle
  3755. COMMAND:ejetar(playerid, params[])
  3756. {
  3757. // Setup local variables
  3758. new Name[24], AdminName[24], Msg[128], OtherPlayer;
  3759.  
  3760. // Send the command to all admins so they can see it
  3761. SendAdminText(playerid, "/ejetar", params);
  3762.  
  3763. // Check if the player has logged in
  3764. if (APlayerData[playerid][LoggedIn] == true)
  3765. {
  3766. // Check if the player's admin-level is at least 2
  3767. if (APlayerData[playerid][PlayerLevel] >= 2)
  3768. {
  3769. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /ejetar [id]");
  3770. else
  3771. {
  3772. // Check if the player is logged in
  3773. if (APlayerData[OtherPlayer][LoggedIn] == true)
  3774. {
  3775. // Check if the other player is driving a vehicle
  3776. if (GetPlayerVehicleSeat(OtherPlayer) != -1)
  3777. {
  3778. // Get the names of the players
  3779. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  3780. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  3781. // Eject the player from the vehicle
  3782. RemovePlayerFromVehicle(OtherPlayer);
  3783. // Let the player know he's been ejected from his vehicle
  3784. format(Msg, 128, "{FF0000}[CDM] Você foi ejetado do veículo de {FFFF00}%s", AdminName);
  3785. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  3786. // Inform the admin that he ejected the player
  3787. format(Msg, 128, "{00FF00}[CDM] Você ejetou {FFFF00}%s{00FF00} do veículo.", Name);
  3788. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3789. }
  3790. else
  3791. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] O jogador não está dentro de um veículo.");
  3792. }
  3793. else
  3794. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não está conectado.");
  3795. }
  3796. }
  3797. else
  3798. return 0;
  3799. }
  3800. else
  3801. return 0;
  3802.  
  3803. // Let the server know that this was a valid command
  3804. return 1;
  3805. }
  3806.  
  3807. // This command lets you talk only to players of the same class
  3808. COMMAND:cv(playerid, params[])
  3809. {
  3810. new Name[24], Msg[128], Message[128];
  3811. SendAdminText(playerid, "/cv", params);
  3812. if (APlayerData[playerid][PlayerLevel] > 1)
  3813. {
  3814. GetPlayerName(playerid, Name, sizeof(Name));
  3815. if (APlayerData[playerid][LoggedIn] == true)
  3816. {
  3817. if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Use: /cv [texto]");
  3818. else
  3819. {
  3820. for (new i; i < MAX_PLAYERS; i++)
  3821. {
  3822. if (APlayerData[i][LoggedIn] == true)
  3823. {
  3824. if (APlayerData[i][PlayerClass] == APlayerData[playerid][PlayerClass])
  3825. {
  3826. format(Msg, 128, "{008080}%s: {008080}%s", Name, Message);
  3827. SendClientMessage(i, 0xFFFFFFFF, Msg);
  3828. }
  3829. }
  3830. }
  3831. }
  3832. }
  3833. }
  3834. else
  3835. return 0;
  3836. return 1;
  3837. }
  3838. COMMAND:ao(playerid, params[])
  3839. {
  3840. new Name[24], Msg[128], Message[128];
  3841. GetPlayerName(playerid, Name, sizeof(Name));
  3842. if (APlayerData[playerid][LoggedIn] == true)
  3843. {
  3844. if (APlayerData[playerid][PlayerLevel] > 3)
  3845. {
  3846. if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Use: /ao [texto]");
  3847. else
  3848. {
  3849. for (new i; i < MAX_PLAYERS; i++)
  3850. {
  3851. if (APlayerData[i][LoggedIn] == true)
  3852. {
  3853. if (APlayerData[i][PlayerLevel] > 3)
  3854. {
  3855. format(Msg, sizeof(Msg), "~w~%s", Message);
  3856. GameTextForAll(Msg, 5000, 3);
  3857. }
  3858. }
  3859. }
  3860. }
  3861. }
  3862. else
  3863. return 0;
  3864. }
  3865. else
  3866. return 0;
  3867. return 1;
  3868. }
  3869. // This command lets you talk only to admin players
  3870. COMMAND:a(playerid, params[])
  3871. {
  3872. // Setup local variables
  3873. new Name[24], Msg[128], Message[128];
  3874.  
  3875. // Get the player's name
  3876. GetPlayerName(playerid, Name, sizeof(Name));
  3877.  
  3878. // Check if the player has logged in
  3879. if (APlayerData[playerid][LoggedIn] == true)
  3880. {
  3881. // Check if the player is an admin
  3882. if (APlayerData[playerid][PlayerLevel] > 0)
  3883. {
  3884. if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Use: /a [texto]");
  3885. else
  3886. {
  3887. // Loop through all players
  3888. for (new i; i < MAX_PLAYERS; i++)
  3889. {
  3890. // Check if the player is logged in
  3891. if (APlayerData[i][LoggedIn] == true)
  3892. {
  3893. // Check if the other player is also an admin
  3894. if (APlayerData[i][PlayerLevel] > 0)
  3895. {
  3896. format(Msg, 128, "{B0B0B0}%s: {FFFFFF}%s", Name, Message);
  3897. SendClientMessage(i, 0xFFFFFFFF, Msg);
  3898. }
  3899. }
  3900. }
  3901. }
  3902. }
  3903. else
  3904. return 0;
  3905. }
  3906. else
  3907. return 0;
  3908.  
  3909. // Let the server know that this was a valid command
  3910. return 1;
  3911. }
  3912. COMMAND:apreender(playerid, params[])
  3913. {
  3914. // Setup local variables
  3915. new vid, Reason[128], HouseID, HouseOwner, Name[24], AdminName[24], Msg[128];
  3916.  
  3917. // Send the command to all admins so they can see it
  3918. SendAdminText(playerid, "/apreender", params);
  3919.  
  3920. // Check if the player has logged in
  3921. if (APlayerData[playerid][LoggedIn] == true)
  3922. {
  3923. // Check if the player's admin-level is at least 5
  3924. if (APlayerData[playerid][PlayerLevel] >= 5)
  3925. {
  3926. if (sscanf(params, "is[128]", vid, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /apreender [id-car] [motivo]");
  3927. else
  3928. {
  3929. // Get the HouseID to which this vehicle belongs
  3930. HouseID = AVehicleData[vid][BelongsToHouse];
  3931.  
  3932. // Check if the vehicle belongs to a house
  3933. if (HouseID != 0)
  3934. {
  3935. //Also set the new location of the vehicle inside the KACC Military fuels hangar
  3936. AVehicleData[vid][SpawnX] = 2585.0;
  3937. AVehicleData[vid][SpawnY] = 2829.0;
  3938. AVehicleData[vid][SpawnZ] = 10.9;
  3939. AVehicleData[vid][SpawnRot] = 0.0;
  3940.  
  3941. // Search all the players to see who owns the house
  3942. for (new i; i < MAX_PLAYERS; i++)
  3943. {
  3944. // Loop through all the houses this player owns
  3945. for(new j; j < MAX_HOUSESPERPLAYER; j++)
  3946. {
  3947. // Check if the player owns this house
  3948. if (APlayerData[i][Houses][j] == HouseID)
  3949. {
  3950. // Store the houseowner
  3951. HouseOwner = i;
  3952.  
  3953. // Find the CarSlot where this vehicle exists
  3954. for (new CarSlot; CarSlot < 10; CarSlot++)
  3955. {
  3956. // Check if the vehicle is stored in this carslot
  3957. if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid)
  3958. {
  3959. vid = House_ReplaceVehicle(HouseID, CarSlot); // Re-create the vehicle at the KACC Military fuels hangar
  3960. // Set the vehicle as clamped (clamping needs to be done after re-creating the vehice, otherwise the wrong id can be clamped)
  3961. AVehicleData[vid][Clamped] = true;
  3962. }
  3963. }
  3964.  
  3965. break;
  3966. }
  3967. }
  3968. }
  3969.  
  3970. // Get the name of the admin and owner of the house
  3971. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  3972. GetPlayerName(HouseOwner, Name, sizeof(Name));
  3973.  
  3974. // Let the admin know who's vehicle he deleted
  3975. format(Msg, 128, "{00FF00}[CDM] Você apreendeu o veiculo de propriedade: {FFFF00}%s", Name);
  3976. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  3977. // Let the player know who deleted his vehicle
  3978. format(Msg, 128, "{FF0000}[CDM] O veículo de sua propriedade foi apreendido pelo Admin {FFFF00}%s", AdminName);
  3979. SendClientMessage(HouseOwner, 0xFFFFFFFF, Msg);
  3980. format(Msg, 128, "{FF0000}[CDM] Ele pertence a casa: {FFFF00}%s", AHouseData[HouseID][HouseName]);
  3981. SendClientMessage(HouseOwner, 0xFFFFFFFF, Msg);
  3982. format(Msg, 128, "{FF0000}Motivo: {FFFF00}%s", Reason);
  3983. SendClientMessage(HouseOwner, 0xFFFFFFFF, Msg);
  3984. // Save the player's datafile (and his houses/businesses/vehicles)
  3985. PlayerFile_Save(HouseOwner);
  3986. }
  3987. else
  3988. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse veiculo nao pertence a um jogador, você não pode apreende-lo");
  3989. }
  3990. }
  3991. else
  3992. return 0;
  3993. }
  3994. else
  3995. return 0;
  3996.  
  3997. // Let the server know that this was a valid command
  3998. return 1;
  3999. }
  4000.  
  4001. // This command can be used to unclamp all your vehicles at once
  4002. COMMAND:liberar(playerid, params[])
  4003. {
  4004. // Setup local variables
  4005. new HouseID, vid, ClampedVehicles, UnclampPrice, Msg[128];
  4006.  
  4007. // Send the command to all admins so they can see it
  4008. SendAdminText(playerid, "/liberar", params);
  4009.  
  4010. // Check if the player has logged in
  4011. if (APlayerData[playerid][LoggedIn] == true)
  4012. {
  4013. // Loop through all vehicles owned by this player
  4014. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  4015. {
  4016. // Get the HouseID that exists on this index
  4017. HouseID = APlayerData[playerid][Houses][HouseSlot];
  4018.  
  4019. // check if this house-slot is used
  4020. if (HouseID != 0)
  4021. {
  4022. // Loop through all vehicles assigned to this house
  4023. for (new CarSlot; CarSlot < 10; CarSlot++)
  4024. {
  4025. // Get the vehicle-id of the vehicle in this carslot
  4026. vid = AHouseData[HouseID][VehicleIDs][CarSlot];
  4027.  
  4028. // Check if this carslot is used
  4029. if (vid != 0)
  4030. {
  4031. // Check if this vehicle is clamped
  4032. if (AVehicleData[vid][Clamped] == true)
  4033. ClampedVehicles++; // Count the clamped vehicles
  4034. }
  4035. }
  4036. }
  4037. }
  4038.  
  4039. // Check if there were any clamped vehicles
  4040. if (ClampedVehicles > 0)
  4041. {
  4042. // Calculate the price to unclamp all the player's vehicles
  4043. UnclampPrice = ClampedVehicles * UnclampPricePerVehicle;
  4044.  
  4045. // Construct the message to inform the player how many vehicles have been clamped and how much it costs to un-clamp them
  4046. format(Msg, 128, "[CDM] Voce tem %i veículos apreendidos, isso vai te custar R$%i para liberá-los.", ClampedVehicles, UnclampPrice);
  4047. // Show a dialog that informs the player how many vehicles have been clamped and how much it costs to un-clamp them
  4048. ShowPlayerDialog(playerid, DialogUnclampVehicles, DIALOG_STYLE_MSGBOX, TXT_AreYouSure, Msg, "Unclamp", TXT_DialogButtonCancel);
  4049. }
  4050. else
  4051. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}[CDM] Você não possui veiculos apreendidos.");
  4052. }
  4053. else
  4054. return 0;
  4055.  
  4056. // Let the server know that this was a valid command
  4057. return 1;
  4058. }
  4059.  
  4060. // This command displays the rules of the server
  4061. COMMAND:regras(playerid, params[])
  4062. {
  4063. // Setup local variables
  4064. new Msg[2000];
  4065.  
  4066. // Send the command to all admins so they can see it
  4067. SendAdminText(playerid, "/regras", params);
  4068.  
  4069. // Check if the player has logged in
  4070. if (APlayerData[playerid][LoggedIn] == true)
  4071. {
  4072. // Construct the rules
  4073. format(Msg, 2000, "%s1. Sempre dirigir do lado direito nas estradas para evitar acidentes.\n", Msg);
  4074. format(Msg, 2000, "%s2. Não chingar ou desrespeitar os outros jogadores, eles são seus companheiros.\n", Msg);
  4075. format(Msg, 2000, "%s3. Usar a linguagem padrão 'Portugues'.\n", Msg);
  4076. format(Msg, 2000, "%s4. Não usar hackers ou será banido permanentemente.\n", Msg);
  4077. format(Msg, 2000, "%s5. Não floodar no chat, pode ser calado por um admin.\n", Msg);
  4078. format(Msg, 2000, "%s6. Não ficar atrapalhando outros players com Carro, Hydra, Rhino ou outro tipo de veiculo motorizado.\n", Msg);
  4079. // Show a dialog that shows the rules
  4080. ShowPlayerDialog(playerid, DialogRules, DIALOG_STYLE_MSGBOX, "Regras do server:", Msg, "Aceitar", TXT_DialogButtonCancel);
  4081. }
  4082. else
  4083. return 0;
  4084.  
  4085. // Let the server know that this was a valid command
  4086. return 1;
  4087. }
  4088.  
  4089.  
  4090. // Report a player for breaking the rules
  4091. COMMAND:relato(playerid, params[])
  4092. {
  4093. // Setup local variables
  4094. new OtherPlayer, Name[24], Reason[128], Msg[128];
  4095.  
  4096. // Send the command to all admins so they can see it
  4097. SendAdminText(playerid, "/relato", params);
  4098.  
  4099. // Check if the player has logged in
  4100. if (APlayerData[playerid][LoggedIn] == true)
  4101. {
  4102. if (sscanf(params, "us[128]", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/relato [id] [causa]");
  4103. else
  4104. {
  4105. // Check if that other player is logged in
  4106. if (APlayerData[OtherPlayer][LoggedIn] == true)
  4107. {
  4108. // Send the report to all admins and add the report to the report-list so admins can review it
  4109. SendReportToAdmins(OtherPlayer, Reason);
  4110.  
  4111. // Get the name of the offender
  4112. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  4113. // Let the player know he reported the other player
  4114. format(Msg, 128, "{00FF00}[CDM] Você relatou {FFFF00}%s", Name);
  4115. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  4116. }
  4117. else
  4118. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] O jogador nao está conectado.");
  4119. }
  4120. }
  4121. else
  4122. return 0;
  4123.  
  4124. // Let the server know that this was a valid command
  4125. return 1;
  4126. }
  4127.  
  4128. // Lets the admins see the list of reports
  4129. COMMAND:relatorio(playerid, params[])
  4130. {
  4131. // Send the command to all admins so they can see it
  4132. SendAdminText(playerid, "/relatorio", params);
  4133.  
  4134. // Check if the player has logged in
  4135. if (APlayerData[playerid][LoggedIn] == true)
  4136. {
  4137. // Check if the player's admin-level is at least 1
  4138. if (APlayerData[playerid][PlayerLevel] >= 1)
  4139. {
  4140. // Add the first report to the list (if it exists)
  4141. if (AReports[0][ReportUsed] == true)
  4142. format(ReportList, 5000, "%s: %s\n", AReports[0][ReportName], AReports[0][ReportReason]);
  4143.  
  4144. // Construct the report-dialog
  4145. for (new i = 1; i < 50; i++)
  4146. {
  4147. // Check if the ReportID has been used already
  4148. if (AReports[i][ReportUsed] == true)
  4149. {
  4150. format(ReportList, 5000, "%s%s: %s\n", ReportList, AReports[i][ReportName], AReports[i][ReportReason]);
  4151. }
  4152. }
  4153.  
  4154. // Show all the reports
  4155. ShowPlayerDialog(playerid, DialogReports, DIALOG_STYLE_LIST, "Relatório:", ReportList, "OK", "Cancelar");
  4156. }
  4157. else
  4158. return 0;
  4159. }
  4160. else
  4161. return 0;
  4162.  
  4163. // Let the server know that this was a valid command
  4164. return 1;
  4165. }
  4166.  
  4167. // Enables the trucker to overload himself
  4168. COMMAND:sobrecarga(playerid, params[])
  4169. {
  4170. // Setup local variables
  4171. new vModel, bool:ValidOverLoad = false, Float:x, Float:y, Float:z, Name[24], Msg[128];
  4172.  
  4173. // Send the command to all admins so they can see it
  4174. SendAdminText(playerid, "/sobrecarga", params);
  4175.  
  4176. // Check if the player has logged in
  4177. if (APlayerData[playerid][LoggedIn] == true)
  4178. {
  4179. // Check if the playeris a trucker
  4180. if (APlayerData[playerid][PlayerClass] == ClassTruckDriver)
  4181. {
  4182. // Check if he has already started a job
  4183. if (APlayerData[playerid][JobStarted] == true)
  4184. {
  4185. // Check if the player has already loaded his load
  4186. if (APlayerData[playerid][JobStep] == 2)
  4187. {
  4188. // Check if the player isn't overloaded already
  4189. if (APlayerData[playerid][Overloaded] == false)
  4190. {
  4191. // Get the coordinates of the loading point
  4192. x = ALocations[APlayerData[playerid][JobLoc1]][LocX];
  4193. y = ALocations[APlayerData[playerid][JobLoc1]][LocY];
  4194. z = ALocations[APlayerData[playerid][JobLoc1]][LocZ];
  4195.  
  4196. // Check if the player is still near the loading point
  4197. if (IsPlayerInRangeOfPoint(playerid, 25.0, x, y, z))
  4198. {
  4199. // Get the vehicle-model of the player's vehicle
  4200. vModel = GetVehicleModel(APlayerData[playerid][VehicleID]);
  4201.  
  4202. // Check if the trucker is driving a trucking vehicle that can be overloaded
  4203. switch (vModel)
  4204. {
  4205. case VehicleFlatbed, VehicleDFT30: ValidOverLoad = true; // Flatbed and DFT-30 can be overloaded
  4206. case VehicleLineRunner, VehicleTanker, VehicleRoadTrain:
  4207. {
  4208. switch (GetVehicleModel(APlayerData[playerid][TrailerID]))
  4209. {
  4210. case VehicleTrailerCargo, VehicleTrailerCargo2, VehicleTrailerOre: ValidOverLoad = true; // Cargo and ore trailer can be overloaded
  4211. }
  4212. }
  4213. }
  4214.  
  4215. // Check if the vehicle is valid for overloading
  4216. if (ValidOverLoad == true)
  4217. {
  4218. // Set overloaded for this player to True
  4219. APlayerData[playerid][Overloaded] = true;
  4220. // Add 2 to the player's wanted level
  4221. SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 2);
  4222. // Let the player know he has been overloaded now
  4223. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}[CDM] Você sobrecarregou o seu caminhão, fique atento à policia.");
  4224. // Inform the police this trucker is overloaded
  4225. GetPlayerName(playerid, Name, sizeof(Name));
  4226. format(Msg, 128, "{00FF00}[CDM] Caminhão {FFFF00}%s{00FF00} está sobrecarregado. 'perseguir e multar'", Name);
  4227. Police_SendMessage(Msg);
  4228. }
  4229. else
  4230. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Seu veículo nao suporta ser sobrecarregado.");
  4231. }
  4232. else
  4233. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você precisa estar no ponto de carregamento para sobrecarregar seu caminhão.");
  4234. }
  4235. else
  4236. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você já está sobrecarregado.");
  4237. }
  4238. else
  4239. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Você deve carregar o seu caminhao primeiro.");
  4240. }
  4241. else
  4242. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Inicie o trabalho primeiro.");
  4243. }
  4244. else
  4245. return 0;
  4246. }
  4247. else
  4248. return 0;
  4249.  
  4250. // Let the server know that this was a valid command
  4251. return 1;
  4252. }
  4253.  
  4254. // This command resets a player's money, score and stats to 0 (if chosen)
  4255. COMMAND:resetarconta(playerid, params[])
  4256. {
  4257. // Setup local variables
  4258. new Name[24], AdminName[24], Reason[128], Msg[128], OtherPlayer, ClearMoney, ClearScore, ClearStats;
  4259.  
  4260. // Check if the player has logged in
  4261. if (APlayerData[playerid][LoggedIn] == true)
  4262. {
  4263. // Check if the player's admin-level is at least 5
  4264. if (APlayerData[playerid][PlayerLevel] >= 6)
  4265. {
  4266. if (sscanf(params, "uiiis[128]", OtherPlayer, ClearMoney, ClearScore, ClearStats, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /resetarconta [id] [dinheiro(0/1)] [score(0/1)] [Status(0/1)] [Motivo]");
  4267. else
  4268. {
  4269. // Check if the other player is logged in
  4270. if (APlayerData[OtherPlayer][LoggedIn] == true)
  4271. {
  4272. // Check if there is at least one parameter given to be cleared, otherwise exit the command
  4273. if ((ClearMoney + ClearScore + ClearStats) == 0)
  4274. return 1;
  4275.  
  4276. // Get the names of both players
  4277. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  4278. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  4279.  
  4280. // Reset the other player's money to 0
  4281. if (ClearMoney == 1)
  4282. {
  4283. APlayerData[OtherPlayer][PlayerMoney] = 0;
  4284. format(Msg, 128, "{FF0000}[CDM] Seu dinheiro foi resetado por {FFFF00}%s", AdminName);
  4285. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  4286. format(Msg, 128, "{00FF00}[CDM] Você resetou o dinheiro do jogador {FFFF00}%s", Name);
  4287. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  4288. }
  4289.  
  4290. // Reset the other player's score to 0
  4291. if (ClearScore == 1)
  4292. {
  4293. APlayerData[OtherPlayer][PlayerScore] = 0;
  4294. format(Msg, 128, "{FF0000}[CDM] Seu score foi resetado por {FFFF00}%s", AdminName);
  4295. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  4296. format(Msg, 128, "{00FF00}[CDM] Você resetou o score do jogador {FFFF00}%s", Name);
  4297. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  4298. }
  4299.  
  4300. // Reset the other player's stats to 0
  4301. if (ClearStats == 1)
  4302. {
  4303. APlayerData[OtherPlayer][StatsTruckerJobs] = 0;
  4304. APlayerData[OtherPlayer][StatsConvoyJobs] = 0;
  4305. APlayerData[OtherPlayer][StatsBusDriverJobs] = 0;
  4306. APlayerData[OtherPlayer][StatsPilotJobs] = 0;
  4307. APlayerData[OtherPlayer][StatsMafiaJobs] = 0;
  4308. APlayerData[OtherPlayer][StatsMafiaStolen] = 0;
  4309. APlayerData[OtherPlayer][StatsPoliceFined] = 0;
  4310. APlayerData[OtherPlayer][StatsPoliceJailed] = 0;
  4311. APlayerData[OtherPlayer][StatsCourierJobs] = 0;
  4312. APlayerData[OtherPlayer][StatsAssistance] = 0;
  4313. APlayerData[OtherPlayer][StatsRoadworkerJobs] = 0;
  4314. APlayerData[OtherPlayer][StatsMetersDriven] = 0.0;
  4315. format(Msg, 128, "{FF0000}[CDM] Seu status foi resetado por {FFFF00}%s", AdminName);
  4316. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  4317. format(Msg, 128, "{00FF00}[CDM] Você resetou o status do jogador {FFFF00}%s", Name);
  4318. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  4319. }
  4320.  
  4321. // Let the other player know the reason too
  4322. format(Msg, 128, "{FF0000}Motivo: {FFFF00}%s", Reason);
  4323. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  4324.  
  4325. // Save the other player's account
  4326. PlayerFile_Save(OtherPlayer);
  4327. }
  4328. else
  4329. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não está online.");
  4330. }
  4331. }
  4332. else
  4333. return 0;
  4334. }
  4335. else
  4336. return 0;
  4337.  
  4338. // Let the server know that this was a valid command
  4339. return 1;
  4340. }
  4341.  
  4342. // This command searches every house and business that the player owns and restores the data for it in the player's account
  4343. COMMAND:desbugar(playerid, params[])
  4344. {
  4345. // Setup local variables
  4346. new Name[24], AdminName[24], Msg[128], OtherPlayer;
  4347.  
  4348. // Send the command to all admins so they can see it
  4349. SendAdminText(playerid, "/desbugar", params);
  4350.  
  4351. // Check if the player has logged in
  4352. if (APlayerData[playerid][LoggedIn] == true)
  4353. {
  4354. // Check if the player's admin-level is at least 5
  4355. if (APlayerData[playerid][PlayerLevel] >= 5)
  4356. {
  4357. if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /desbugar [id]");
  4358. else
  4359. {
  4360. // Check if the other player is logged in
  4361. if (APlayerData[OtherPlayer][LoggedIn] == true)
  4362. {
  4363. // Get the names of both players
  4364. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  4365. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  4366.  
  4367. // Clear the houses and businesses that the player owns right now
  4368. for (new i; i < MAX_HOUSESPERPLAYER; i++)
  4369. APlayerData[OtherPlayer][Houses][i] = 0;
  4370.  
  4371. for (new i; i < MAX_BUSINESSPERPLAYER; i++)
  4372. APlayerData[OtherPlayer][Business][i] = 0;
  4373.  
  4374. // Now search through all houses and re-add them to the player
  4375. for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  4376. if (AHouseData[HouseID][Owned] == true) // Check if the house is owned by somebody
  4377. if (strcmp(AHouseData[HouseID][Owner], Name, false) == 0) // Check if the player is the owner of the house
  4378. {
  4379. for (new i; i < MAX_HOUSESPERPLAYER; i++) // Loop through all houses the player owns
  4380. if (APlayerData[OtherPlayer][Houses][i] == 0) // Check if the houseslot is free
  4381. {
  4382. APlayerData[OtherPlayer][Houses][i] = HouseID; // Store the HouseID
  4383. break; // Stop searching for more free slots
  4384. }
  4385. }
  4386.  
  4387. // Now search through all businesses and re-add them to the player
  4388. for (new BusID = 1; BusID < MAX_BUSINESS; BusID++)
  4389. if (ABusinessData[BusID][Owned] == true) // Check if the business is owner by someone
  4390. if (strcmp(ABusinessData[BusID][Owner], Name, false) == 0) // Check if the player is the owner of the business
  4391. {
  4392. for (new i; i < MAX_BUSINESSPERPLAYER; i++) // Loop through all businesses the player owns
  4393. if (APlayerData[OtherPlayer][Business][i] == 0) // Check if the businessslot is free
  4394. {
  4395. APlayerData[OtherPlayer][Business][i] = BusID; // Store the BusID
  4396. break; // Stop searching for more free slots
  4397. }
  4398. }
  4399.  
  4400. // Let the other player know his property has been restored
  4401. format(Msg, 128, "{00FF00}[CDM] Sua propriedade foi restaurada por: {FFFF00}%s", AdminName);
  4402. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  4403.  
  4404. // Save the other player's account
  4405. PlayerFile_Save(OtherPlayer);
  4406. }
  4407. else
  4408. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Esse jogador não está online.");
  4409. }
  4410. }
  4411. else
  4412. return 0;
  4413. }
  4414. else
  4415. return 0;
  4416.  
  4417. // Let the server know that this was a valid command
  4418. return 1;
  4419. }
  4420.  
  4421. // This command sets a skin for the player
  4422. COMMAND:setskin(playerid, params[])
  4423. {
  4424. // Setup local variables
  4425. new Msg[128], Skin;
  4426.  
  4427. // Send the command to all admins so they can see it
  4428. SendAdminText(playerid, "/setskin", params);
  4429.  
  4430. // Check if the player has logged in
  4431. if (APlayerData[playerid][LoggedIn] == true)
  4432. {
  4433. // Check if the player's admin-level is at least 4
  4434. if (APlayerData[playerid][PlayerLevel] >= 0)
  4435. {
  4436. if (sscanf(params, "i", Skin)) SendClientMessage(playerid, 0xFF0000AA, "Use: /setskin [id(0-299)]");
  4437. else
  4438. {
  4439. // Check if the player entered a valid skin-id
  4440. if ((Skin >= 0) && (Skin <= 299))
  4441. {
  4442. // Set the skin for the player
  4443. SetPlayerSkin(playerid, Skin);
  4444. // Let the other player know the reason too
  4445. format(Msg, 128, "{00FF00}[CDM] Você mudou o skin: {FFFF00}%i.", Skin);
  4446. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  4447. }
  4448. else
  4449. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] Skin inválido use valores entre 0 e 299.");
  4450. }
  4451. }
  4452. else
  4453. return 0;
  4454. }
  4455. else
  4456. return 0;
  4457.  
  4458. // Let the server know that this was a valid command
  4459. return 1;
  4460. }
  4461.  
  4462. // Bans a player by his ip
  4463. COMMAND:banip(playerid, params[])
  4464. {
  4465. // Setup local variables
  4466. new PlayerToBan, Reason[128], Msg[128], Name[24], AdminName[24];
  4467.  
  4468. // Send the command to all admins so they can see it
  4469. SendAdminText(playerid, "/banip", params);
  4470.  
  4471. // Check if the player has logged in
  4472. if (APlayerData[playerid][LoggedIn] == true)
  4473. {
  4474. // Check if the player's admin-level is at least 3
  4475. if (APlayerData[playerid][PlayerLevel] >= 4)
  4476. {
  4477. if (sscanf(params, "us[128]", PlayerToBan, Reason))
  4478. SendClientMessage(playerid, 0xFF0000AA, "Use: /banip [id] [motivo]");
  4479. else
  4480. {
  4481. if (IsPlayerConnected(PlayerToBan))
  4482. {
  4483. // Get the names of the player and the admin who executed the ban
  4484. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  4485. GetPlayerName(PlayerToBan, Name, sizeof(Name));
  4486.  
  4487. // Inform the player about his ban
  4488. format(Msg, 128, "{FF0000}[CDM] Você teve o IP banido permanentemente por {FFFF00}%s", AdminName);
  4489. SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
  4490. format(Msg, 128, "{FF0000}Motivo: {FFFF00}%s", Reason);
  4491. SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
  4492.  
  4493. // Ban the player with a reason
  4494. BanEx(PlayerToBan, Reason);
  4495.  
  4496. // Inform everybody else which player was ip-banned
  4497. format(Msg, 128, "{808080}[CDM] %s %s Baniu o ip de {FFFF00}%s", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
  4498. SendClientMessageToAll(0xFFFFFFFF, Msg);
  4499. }
  4500. }
  4501. }
  4502. else
  4503. return 0;
  4504. }
  4505. else
  4506. return 0;
  4507.  
  4508. return 1;
  4509. }
  4510.  
  4511. // Bans a player's entire range of IP addresses (the last part of the IP-address will be from 0 to 255)
  4512. COMMAND:banclasse(playerid, params[])
  4513. {
  4514. // Setup local variables
  4515. new PlayerToBan, PlayerIP[16], FirstPartsOfIP[16], BanCmd[24], Reason[128], Msg[128], Name[24], AdminName[24];
  4516.  
  4517. // Send the command to all admins so they can see it
  4518. SendAdminText(playerid, "/banclasse", params);
  4519.  
  4520. // Check if the player has logged in
  4521. if (APlayerData[playerid][LoggedIn] == true)
  4522. {
  4523. // Check if the player's admin-level is at least 3
  4524. if (APlayerData[playerid][PlayerLevel] >= 5)
  4525. {
  4526. if (sscanf(params, "us[128]", PlayerToBan, Reason))
  4527. SendClientMessage(playerid, 0xFF0000AA, "Use: /banclasse [id] [motivo]");
  4528. else
  4529. {
  4530. if (IsPlayerConnected(PlayerToBan))
  4531. {
  4532. // Get the names of the player and the admin who executed the ban
  4533. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  4534. GetPlayerName(PlayerToBan, Name, sizeof(Name));
  4535.  
  4536. // Get the player's IP-address
  4537. GetPlayerIp(PlayerToBan, PlayerIP, 16);
  4538.  
  4539. // Inform the player about his ban
  4540. format(Msg, 128, "{FF0000}[CDM] Você teve a faixa de ip banida permanentemente por {FFFF00}%s", AdminName);
  4541. SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
  4542. format(Msg, 128, "{FF0000}Motivo: {FFFF00}%s", Reason);
  4543. SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
  4544.  
  4545. // Get the first three digits from the player's ip, so the fourth part can be added from 0 to 255
  4546. FirstPartsOfIP = GetFirstThreeDigitsFromIP(PlayerIP);
  4547. // Ban the entire range of IP-addresses of the player
  4548. for (new i; i < 256; i++)
  4549. {
  4550. format(BanCmd, 24, "banip %s%i", FirstPartsOfIP, i); // Construct the RCon command to ban every IP
  4551. SendRconCommand(BanCmd); // Execute the command
  4552. }
  4553. // Finally kick the player (the RCon command doesn't kick you out automatically)
  4554. Kick(PlayerToBan);
  4555.  
  4556. // Inform everybody else which player was ip-range-banned
  4557. format(Msg, 128, "{808080}[CDM] %s %s baniu a faixa de ip permanentemente do {FFFF00}%s", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
  4558. SendClientMessageToAll(0xFFFFFFFF, Msg);
  4559. }
  4560. }
  4561. }
  4562. else
  4563. return 0;
  4564. }
  4565. else
  4566. return 0;
  4567.  
  4568. return 1;
  4569. }
  4570.  
  4571. COMMAND:darscore(playerid, params[])
  4572. {
  4573. // Setup local variables
  4574. new Msg[128], Name[24], OtherName[24], OtherPlayer, pScore;
  4575.  
  4576. // Send the command to all admins so they can see it
  4577. SendAdminText(playerid, "/darscore", params);
  4578.  
  4579. // Check if the player has logged in
  4580. if (APlayerData[playerid][LoggedIn] == true)
  4581. {
  4582. // Check if the player's admin-level is at least 3
  4583. if (APlayerData[playerid][PlayerLevel] >= 4)
  4584. {
  4585. if (sscanf(params, "ui", OtherPlayer, pScore)) SendClientMessage(playerid, 0xFF0000AA, "Use: /darscore [id] [score]");
  4586. else
  4587. {
  4588. // Check if the otherplayer is online
  4589. if (IsPlayerConnected(OtherPlayer))
  4590. {
  4591. // Get the player-names
  4592. GetPlayerName(playerid, Name, sizeof(Name));
  4593. GetPlayerName(OtherPlayer, OtherName, sizeof(OtherName));
  4594.  
  4595. // Set the other player's score
  4596. APlayerData[OtherPlayer][PlayerScore] = pScore;
  4597. // Let the other player know that his score has been changed
  4598. format(Msg, 128, "{00FF00}[CDM] Seu score foi setado para {FFFF00}%i{00FF00} por {FFFF00}%s.", pScore, Name);
  4599. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
  4600. // Let the player know he has set the score of the other player
  4601. format(Msg, 128, "{00FF00}[CDM] Você setou o score de {FFFF00}%s{00FF00} para {FFFF00}%i.", OtherName, pScore);
  4602. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  4603. // Save the other player's account
  4604. PlayerFile_Save(OtherPlayer);
  4605. }
  4606. else
  4607. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CDM] O jogador não está online.");
  4608. }
  4609. }
  4610. else
  4611. return 0;
  4612. }
  4613. else
  4614. return 0;
  4615.  
  4616. // Let the server know that this was a valid command
  4617. return 1;
  4618. }
  4619.  
  4620.  
  4621. COMMAND:banco(playerid, params[])
  4622. {
  4623. // Setup local variables
  4624. new file[100], Name[24];
  4625.  
  4626. // Send the command to all admins so they can see it
  4627. SendAdminText(playerid, "/banco", params);
  4628.  
  4629. // Get the playername
  4630. format(Name, sizeof(Name), APlayerData[playerid][PlayerName]);
  4631. // Construct the complete filename for this player's bank-account
  4632. format(file, sizeof(file), BankFile, Name);
  4633.  
  4634. // Check if the player has logged in
  4635. if (APlayerData[playerid][LoggedIn] == true)
  4636. {
  4637. // Check if the player doesn't have a bank account
  4638. if (!fexist(file))
  4639. {
  4640. ShowPlayerDialog(playerid, DialogBankPasswordRegister, DIALOG_STYLE_INPUT, "Senha", "Insira a senha para registrar sua conta bancária 'não esqueça!':", TXT_DialogButtonSelect, TXT_DialogButtonCancel);
  4641. }
  4642. else // The player has a bank account
  4643. {
  4644. // If the player hasn't logged in to his bank account yet
  4645. if (APlayerData[playerid][BankLoggedIn] == false)
  4646. {
  4647. // Ask for the password to login to his bank account
  4648. ShowPlayerDialog(playerid, DialogBankPasswordLogin, DIALOG_STYLE_INPUT, "Senha", "Insira sua senha para logar na sua conta bancária:", TXT_DialogButtonSelect, TXT_DialogButtonCancel);
  4649. }
  4650. else // The player has logged in to his bank account already
  4651. {
  4652. // Show the main bank menu dialog
  4653. ShowBankMenu(playerid);
  4654. }
  4655. }
  4656. }
  4657. else
  4658. return 0;
  4659.  
  4660. // Let the server know that this was a valid command
  4661. return 1;
  4662. }
  4663.  
  4664. // This command lists all help-items for which the player can get information about it
  4665. COMMAND:ajuda(playerid, params[])
  4666. {
  4667. // Send the command to all admins so they can see it
  4668. SendAdminText(playerid, "/ajuda", params);
  4669.  
  4670. // Check if the player has logged in
  4671. if (APlayerData[playerid][LoggedIn] == true)
  4672. {
  4673. // Create the dialog that lists all help-items
  4674. HelpList_Create(playerid);
  4675. }
  4676. else
  4677. return 0;
  4678.  
  4679. // Let the server know that this was a valid command
  4680. return 1;
  4681. }
  4682.  
  4683. // This command allows you to change your password for logging in
  4684. COMMAND:mudarsenha(playerid, params[])
  4685. {
  4686. // Send the command to all admins so they can see it
  4687. SendAdminText(playerid, "/mudarsenha", params);
  4688.  
  4689. // Check if the player has logged in
  4690. if (APlayerData[playerid][LoggedIn] == true)
  4691. {
  4692. // Show the dialog where the player must enter his old password
  4693. ShowPlayerDialog(playerid, DialogOldPassword, DIALOG_STYLE_INPUT, "Insira a senha atual:", "Insira a senha que está ativada:", "OK", "Cancelar");
  4694. }
  4695. else
  4696. return 0;
  4697.  
  4698. // Let the server know that this was a valid command
  4699. return 1;
  4700. }
  4701.  
  4702. // This command allows you to change your password for logging in
  4703. COMMAND:rc(playerid, params[])
  4704. {
  4705. SendAdminText(playerid, "/rc", params);
  4706. if (APlayerData[playerid][LoggedIn] == true)
  4707. {
  4708. if (APlayerData[playerid][PlayerLevel] >= 5)
  4709. {
  4710. SendClientMessageToAll(0x00FF00FF, "Todos os veículos foram resetados pelo admin");
  4711. for(new i=0; i<MAX_VEHICLES; i++)
  4712. {
  4713. #define VehicleOccupied(i)
  4714. {
  4715. SetVehicleToRespawn(i);
  4716. }
  4717. }
  4718. }
  4719. else
  4720. return 0;
  4721. }
  4722. else
  4723. return 0;
  4724. return 1;
  4725. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement