Guest User

COMANDOS

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