Guest User

Life Virtual Base por Cleyson Stein

a guest
Mar 13th, 2015
2,233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 267.13 KB | None | 0 0
  1. /*
  2. // =========================================//
  3.  
  4. ||||||||||||| ||||||||||||| |||||||||||||
  5. ||||||||||||| ||||||||||||| |||||||||||||
  6. |||| |||| |||| ||||
  7. |||| |||| |||| ||||
  8. |||| ||||||||||||| |||||||||||||
  9. |||| ||||||||||||| |||||||||||||
  10. |||| |||| |||| ||||
  11. |||| |||| |||| ||||
  12. ||||||||||||| |||| |||| |||||||||||||
  13. ||||||||||||| |||| |||| |||||||||||||
  14.  
  15. CLEYSON ALVES STEIN
  16.  
  17. // =========================================//
  18.  
  19. GameMode criado por Cleyson Stein.
  20. Base para o sistema de casas "LHouse" por Lós
  21.  
  22. Log Criação:
  23. * Login / Registro Ok
  24. * Salvamento Dof2 Ok
  25. * Administração + Logs Ok
  26. * ignição de veiculos Ok
  27. * Gasolina c/ galão Ok
  28. * Casa Ok
  29. * Vip por key e leveis Ok
  30. * Radar Dinamico OK
  31. * Banco 90% // falta os locais
  32.  
  33. */ // format(DonoEmp, 50, Nome(playerid));
  34.  
  35. #include <a_samp>
  36. #include <dof2>
  37. #include <sscanf>
  38. #include <streamer>
  39. #include <zcmd>
  40. #include <Losgs>
  41.  
  42.  
  43. // == Dialogs
  44. #define DIALOG_REGISTRO 1
  45. #define DIALOG_LOGIN 2
  46. #define DIALOG_SEXO 3
  47. #define DIALOG_IDADE 4
  48. #define DIALOG_STAFF 5
  49. #define DIALOG_EMAIL 6
  50. #define DIALOG_DADMIN 7
  51. #define DIALOG_HELPER 8
  52. #define DIALOG_FORUM 9
  53. #define DIALOG_CREDITOS 10
  54.  
  55. #define DIALOG_ABASTECER 11
  56. #define DIALOG_GALAOABAST 12
  57.  
  58. #define DIALOG_SALDO 13
  59. #define DIALOG_SACAR 14
  60. #define DIALOG_DEPOSITAR 15
  61. #define DIALOG_TRANSF_ID 16
  62. #define DIALOG_TRANSF_RS 17
  63. #define DIALOG_EMPRESTIMO 18
  64.  
  65. #define DIALOG_CRIAR_RADAR 19
  66.  
  67. #define DIALOG_ATIVAR_KEY 50
  68. #define DIALOG_NOVA_KEY 51
  69. #define DIALOG_NOVAKEY_DIAS 52
  70. #define DIALOG_KEY_CONFIRMAR 53
  71.  
  72. // dialog casas
  73. #define DIALOG_CRIAR_CASA 1335
  74. #define DIALOG_CASA_STATUS 1342
  75. #define DIALOG_VENDER_CASA 1343
  76. #define DIALOG_EDITAR_CASA 1345
  77. #define DIALOG_EDITAR_CASA_PRECO 1346
  78. #define DIALOG_EDITAR_CASA_ALU_PRECO 1347
  79. #define DIALOG_EDITAR_CASA_INT 1348
  80. #define DIALOG_EDITAR_CASA_ID 1349
  81.  
  82. #define DIALOG_HOUSE_TENANT_MENU 1350
  83. #define DIALOG_HOUSE_RENT_MENU 1351
  84. #define DIALOG_HOUSE_OWNER_MENU 1352
  85. #define DIALOG_HOUSE_SELL_MENU 1353
  86. #define DIALOG_RENT 1354
  87. #define DIALOG_RENT_PRICE 1355
  88. #define DIALOG_HOUSE_SELL_PLAYER 1356
  89. #define DIALOG_HOUSE_SELL_PLAYER2 1357
  90. #define DIALOG_HOUSE_SELL_PLAYER3 1358
  91. #define DIALOG_SELLING_CONFIRM 1359
  92. #define DIALOG_CHANGE_PLATE 1360
  93. #define DIALOG_DELETE_HOUSE 1362
  94. #define DIALOG_CHANGE_OWNER 1363
  95. #define DIALOG_CHANGE_OWNER2 1364
  96. #define DIALOG_ADMIN 1365
  97. #define DIALOG_VENDER_CASA_ADMIN 1366
  98. #define DIALOG_GUEST 1367
  99. #define DIALOG_RENT_CONFIRM 1369
  100. #define DIALOG_DUMP_TENANT 1370
  101. #define DIALOG_UNRENT_CONFIRM 1371
  102. #define DIALOG_RENTING_GUEST 1372
  103. #define DIALOG_HOUSE_TITLE 1373
  104. #define DIALOG_HOUSE_TITLE_ADMIN 1374
  105.  
  106.  
  107. // == Cores
  108. #define ROXOCLARO 0xAB82FFFF
  109. #define ROSAB 0xFF69B4FF
  110. #define COR_AVISO 0xBEBEBEFF
  111. #define COR_ADMIN 0x436EEEFF
  112. #define COR_SUCESSO 0xCAE1FFFF
  113. #define VERDE 0x21DD00FF
  114. #define VERMELHO 0xFF030FFF
  115. #define VERMELHO_ESCURO 0xE60000FF
  116. #define VERMELHO_CLARO 0xFB0000FF
  117. #define AMARELO 0xFFFF00FF
  118. #define LARANJA 0xF97804FF
  119. #define AZUL_CLARO 0x00C2ECFF
  120. #define ROXO 0xB360FDFF
  121. #define BRANCO 0xFFFFFFFF
  122. #define PRETO 0x000000FF
  123. #define AZUL 0x1229FAFF
  124. #define VERDE_CLARO 0x38FF06FF
  125. #define ROSA_CHOQUE 0xE100E1FF
  126. #define VERDE_ESCURO 0x008040FF
  127. #define CINZA 0xCECECEFF
  128. #define ROSA 0xD52DFFFF
  129. #define CINZA_ESCURO 0x626262FF
  130. #define VERDE_AGUA 0x03D687FF
  131. #define COR_VIP 0x228B22AA
  132. #define COR_CINZA 0xCECECEFF
  133.  
  134. // == Profissões
  135. #define DESEMPREGADO 0
  136. #define TAXISTA 1
  137.  
  138. // == Cores Profissões
  139. #define C_DESEMPREGADO 0xFFFFFFFF
  140. #define C_TAXISTA 0xFFFF04AA
  141.  
  142. // == Slots
  143. #define MAX_CASAS 151
  144. #define MAX_RADAR 51
  145.  
  146. // == Pastas
  147. #define VIPS "Vips/Contas/%s.ini"
  148. #define VIP_KEYS "Vips/Keys/%s.ini"
  149. #define CONTAS "Contas/%s.ini"
  150. #define BANIDOS "Banidos/%s.ini"
  151. #define IPSBANIDOS "IPSBanidos/%s.ini"
  152. #define RADARES "Radares/Radar %d.ini"
  153.  
  154. // == Logs
  155. #define LOG_ADM "Logs/Administracao.log"
  156. #define LOG_VIP "Logs/Vips.log"
  157. #define LOG_ARMA "Logs/DarArmas.log"
  158. #define LOG_GRANA "Logs/DarGrana.log"
  159. #define LOG_KICK "Logs/Kickados.log"
  160. #define LOG_CHAT "Logs/ChatAdm.log"
  161. #define LOG_BAN "Logs/Banidos.log"
  162. #define LOG_DESBAN "Logs/Desbanidos.log"
  163. #define LOG_HOUSES "Casas/Logs/Casas.log"
  164. #define LOG_ADMIN "Casas/Logs/Administração.log"
  165. #define LOG_SYSTEM "Casas/Logs/Sistema.log"
  166.  
  167.  
  168. // == Macros
  169. #define Msg SendClientMessage
  170. #define MsgAll SendClientMessageToAll
  171. #define TEXT_SELLING_HOUSE "{00FFFF}CASA ID: {FFFFFF}%d\n\n{E0FFFF}Preço: {FFFFFF}$%d"
  172. #define TEXT_HOUSE "{00FFFF}%s\n\n{E0FFFF}Dono: {FFFFFF}%s\n{E0FFFF}Aluguel: {FFFFFF}%s\n{E0FFFF}Status: {FFFFFF}%s\n{E0FFFF}Número: {FFFFFF}%d"
  173. #define TEXT_RENT_HOUSE "{E0FFFF}%s\n\n{E0FFFF}Dono: {FFFFFF}%s\n{E0FFFF}Locador: {FFFFFF}%s\n{E0FFFF}Preço Aluguel: {FFFFFF}$%d\n{E0FFFF}Status: {FFFFFF}%s\n{E0FFFF}Número: {FFFFFF}%d"
  174.  
  175. #define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
  176. #define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0),ResetPlayerMoney(%0)
  177. #define GetPlayerCash(%0) GetPVarInt(%0,"Money")
  178.  
  179.  
  180. new PlayerVehicle[212][] = {
  181. "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana",
  182. "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat",
  183. "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife",
  184. "Trailer 1", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo",
  185. "Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
  186. "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow",
  187. "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito",
  188. "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring",
  189. "Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B",
  190. "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster","Stunt", "Tanker",
  191. "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
  192. "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak",
  193. "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck LA", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit",
  194. "Utility", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
  195. "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway",
  196. "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog",
  197. "Club", "Freight Carriage", "Trailer 4", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)",
  198. "Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A",
  199. "Luggage Trailer B", "Stairs", "Boxville", "Tiller", "Utility Trailer" };
  200.  
  201. // == Velocimetro
  202. new PlayerText:Motor[MAX_PLAYERS];
  203. new PlayerText:Combust[MAX_PLAYERS];
  204. new PlayerText:Velo[MAX_PLAYERS];
  205. new PlayerText:Kmh[MAX_PLAYERS];
  206. new PlayerText:Veiculo[MAX_PLAYERS];
  207.  
  208. new Text:TextPostos[3];
  209. new Text:Relogio[2];
  210. new Text:Barra[5];
  211. new Text:Banco[9];
  212.  
  213. // == Login
  214. new Text:Fundo[7];
  215. new Text:Registro[9];
  216. new Text:Login[MAX_PLAYERS][7];
  217. new DigitouSenha[MAX_PLAYERS], DigitouSexo[MAX_PLAYERS], DigitouIdade[MAX_PLAYERS], DigitouEmail[MAX_PLAYERS];
  218.  
  219.  
  220. // == Sistema de gasolina
  221. new GasolinaVeiculo[MAX_VEHICLES];
  222. new Float:VehSpeed[3];
  223. new ConsumoGas[MAX_PLAYERS];
  224. new AreaPosto[MAX_PLAYERS] = 0;
  225.  
  226. // == Sscanf
  227. new ID, nivel, String[128];
  228.  
  229. // == Admin
  230. new ServerTrancado;
  231. new Pergunta[MAX_PLAYERS][128];
  232. new NomeOriginal[MAX_PLAYERS][30];
  233. new Float:VidaAFK;
  234. new Barris[100];
  235. new tBarris = 0;
  236. new CarrosCriados[100];
  237. new TodosCarros = 0;
  238.  
  239. // Players
  240. new IDTransferir;
  241. enum pInfo
  242. {
  243. pID,
  244. pSenha[129],
  245. pLevel,
  246. pSexo,
  247. pIdade,
  248. pAdmin,
  249. pHelper,
  250. pVip,
  251. TempoVip,
  252. pAfk,
  253. pSkin,
  254. HabAerea,
  255. HabNautica,
  256. HabTerrestre,
  257. ErrouSenha,
  258. pProfissao,
  259. pInvisivel,
  260. pCongelado,
  261. pDisfarcado,
  262. pAssistindo,
  263. TemGalao,
  264. GalaoGasolina,
  265. bool:pLogado,
  266. SaldoBancario,
  267. FezEmprestimo,
  268. Emprestimo,
  269. pInterior,
  270. Float:pPos[3]
  271. };
  272. new PlayerInfo[MAX_PLAYERS][pInfo];
  273. new
  274. vKey[MAX_PLAYERS][25],
  275. vDias[MAX_PLAYERS];
  276.  
  277. // Casas
  278. enum cInfo
  279. {
  280. houseOwner[MAX_PLAYER_NAME],
  281. houseTitle[32],
  282. Float:houseX,
  283. Float:houseY,
  284. Float:houseZ,
  285. Float:houseIntX,
  286. Float:houseIntY,
  287. Float:houseIntZ,
  288. Float:houseIntFA,
  289. housePrice,
  290. houseRentable,
  291. houseRentPrice,
  292. houseTenant[MAX_PLAYER_NAME],
  293. houseInterior,
  294. houseVirtualWorld,
  295. houseOutcoming,
  296. houseIncoming,
  297. houseStatus
  298. };
  299. new CasaInfo[MAX_CASAS][cInfo];
  300. new
  301. housePickupIn[MAX_CASAS],
  302. housePickupOut[MAX_CASAS],
  303. houseMapIcon[MAX_CASAS],
  304. Text3D:houseLabel[MAX_CASAS],
  305. Float:houseInteriorX[MAX_PLAYERS],
  306. Float:houseInteriorY[MAX_PLAYERS],
  307. Float:houseInteriorZ[MAX_PLAYERS],
  308. Float:houseInteriorFA[MAX_PLAYERS],
  309. houseIntPrice[MAX_PLAYERS],
  310. houseInteriorInt[MAX_PLAYERS],
  311. playerReceiveHouse,
  312. priceReceiveHouse,
  313. houseSellingID,
  314. playerIDOffer,
  315. timeHour, timeMinute, timeSecond,
  316. newOwnerID,
  317. playerName[MAX_PLAYER_NAME];
  318.  
  319.  
  320. // Radares
  321. enum rInfo
  322. {
  323. Float:rPosX,
  324. Float:rPosY,
  325. Float:rPosZ,
  326. Float:rAngulo,
  327. rVelocidade
  328. };
  329. new RadarInfo[MAX_RADAR][rInfo];
  330. new
  331. IDRadar[MAX_PLAYERS],
  332. VelocidadeRADAR,
  333. Text3D:TRadar[MAX_RADAR],
  334. IconeRadar[MAX_RADAR],
  335. ObjetoRadar[2][MAX_RADAR],
  336. CriandoRadar,
  337. bool:PassouRadar[MAX_PLAYERS];
  338.  
  339.  
  340. main()
  341. {
  342. print("\n------------------------------------"); // nesse modo imprime reto no cmd
  343. print("|||| |||| ||||");
  344. print("|||| |||| ||||");
  345. print("|||| |||| ||||");
  346. print("|||| |||| ||||");
  347. print("|||| |||| ||||");
  348. print("|||| |||| ||||");
  349. print("|||| |||| ||||");
  350. print("|||| ||| |||");
  351. print("||||||||||||| |||||||||");
  352. print("||||||||||||| |||||");
  353. print(" .");
  354. print(" .");
  355. print(" Gamemode Life Virtual RPG v1.0 ");
  356. print(" Totalmente do new.pwn ");
  357. print(" Por Cleyson Stein");
  358. print("-------------------------------------\n");
  359. }
  360.  
  361. public OnGameModeInit()
  362. {
  363. SetTimer("Att_Relogio", 60000, true);
  364.  
  365. CriarLogs();
  366. CarregarRadares();
  367. UsePlayerPedAnims();
  368. CriarTodasAsCasas();
  369. DisableInteriorEnterExits();
  370. EnableStuntBonusForAll(0);
  371. SetGameModeText("Beta LV RPG V1.0");
  372.  
  373. SetTimer("RentalCharge", 1000, true);
  374. SetTimer("SaveHouses", 60000*10, true);
  375.  
  376. // == Text Banco
  377. Banco[0] = TextDrawCreate(413.000000, 128.000000, "#");
  378. TextDrawBackgroundColor(Banco[0], 255);
  379. TextDrawFont(Banco[0], 2);
  380. TextDrawLetterSize(Banco[0], 0.400000, 26.199996);
  381. TextDrawColor(Banco[0], -1);
  382. TextDrawSetOutline(Banco[0], 0);
  383. TextDrawSetProportional(Banco[0], 1);
  384. TextDrawSetShadow(Banco[0], 1);
  385. TextDrawUseBox(Banco[0], 1);
  386. TextDrawBoxColor(Banco[0], 85);
  387. TextDrawTextSize(Banco[0], 621.000000, 20.000000);
  388. TextDrawSetSelectable(Banco[0], 0);
  389.  
  390. Banco[1] = TextDrawCreate(413.000000, 128.000000, " Banco Central LV");
  391. TextDrawBackgroundColor(Banco[1], 255);
  392. TextDrawFont(Banco[1], 2);
  393. TextDrawLetterSize(Banco[1], 0.300000, 2.099999);
  394. TextDrawColor(Banco[1], -1);
  395. TextDrawSetOutline(Banco[1], 0);
  396. TextDrawSetProportional(Banco[1], 1);
  397. TextDrawSetShadow(Banco[1], 1);
  398. TextDrawUseBox(Banco[1], 1);
  399. TextDrawBoxColor(Banco[1], -16777165);
  400. TextDrawTextSize(Banco[1], 621.000000, 20.000000);
  401. TextDrawSetSelectable(Banco[1], 0);
  402.  
  403. Banco[2] = TextDrawCreate(430.000000, 170.000000, " Sacar");
  404. TextDrawBackgroundColor(Banco[2], 255);
  405. TextDrawFont(Banco[2], 1);
  406. TextDrawLetterSize(Banco[2], 0.460000, 2.800000);
  407. TextDrawColor(Banco[2], -1);
  408. TextDrawSetOutline(Banco[2], 1);
  409. TextDrawSetProportional(Banco[2], 1);
  410. TextDrawUseBox(Banco[2], 1);
  411. TextDrawBoxColor(Banco[2], 102);
  412. TextDrawTextSize(Banco[2], 506.000000, 20.000000);
  413. TextDrawSetSelectable(Banco[2], true);
  414.  
  415. Banco[3] = TextDrawCreate(430.000000, 220.000000, " Depositar");
  416. TextDrawBackgroundColor(Banco[3], 255);
  417. TextDrawFont(Banco[3], 1);
  418. TextDrawLetterSize(Banco[3], 0.460000, 2.800000);
  419. TextDrawColor(Banco[3], -1);
  420. TextDrawSetOutline(Banco[3], 1);
  421. TextDrawSetProportional(Banco[3], 1);
  422. TextDrawUseBox(Banco[3], 1);
  423. TextDrawBoxColor(Banco[3], 102);
  424. TextDrawTextSize(Banco[3], 535.000000, 20.000000);
  425. TextDrawSetSelectable(Banco[3], true);
  426.  
  427. Banco[4] = TextDrawCreate(430.000000, 268.000000, " Emprestimos");
  428. TextDrawBackgroundColor(Banco[4], 255);
  429. TextDrawFont(Banco[4], 1);
  430. TextDrawLetterSize(Banco[4], 0.460000, 2.800000);
  431. TextDrawColor(Banco[4], -1);
  432. TextDrawSetOutline(Banco[4], 1);
  433. TextDrawSetProportional(Banco[4], 1);
  434. TextDrawUseBox(Banco[4], 1);
  435. TextDrawBoxColor(Banco[4], 102);
  436. TextDrawTextSize(Banco[4], 557.000000, 20.000000);
  437. TextDrawSetSelectable(Banco[4], true);
  438.  
  439. Banco[5] = TextDrawCreate(430.000000, 315.000000, " Transferencias");
  440. TextDrawBackgroundColor(Banco[5], 255);
  441. TextDrawFont(Banco[5], 1);
  442. TextDrawLetterSize(Banco[5], 0.460000, 2.799999);
  443. TextDrawColor(Banco[5], -1);
  444. TextDrawSetOutline(Banco[5], 1);
  445. TextDrawSetProportional(Banco[5], 1);
  446. TextDrawUseBox(Banco[5], 1);
  447. TextDrawBoxColor(Banco[5], 102);
  448. TextDrawTextSize(Banco[5], 573.000000, 20.000000);
  449. TextDrawSetSelectable(Banco[5], true);
  450.  
  451. Banco[6] = TextDrawCreate(530.000000, 170.000000, " Saldo");
  452. TextDrawBackgroundColor(Banco[6], 255);
  453. TextDrawFont(Banco[6], 1);
  454. TextDrawLetterSize(Banco[6], 0.460000, 2.800000);
  455. TextDrawColor(Banco[6], -1);
  456. TextDrawSetOutline(Banco[6], 1);
  457. TextDrawSetProportional(Banco[6], 1);
  458. TextDrawUseBox(Banco[6], 1);
  459. TextDrawBoxColor(Banco[6], 102);
  460. TextDrawTextSize(Banco[6], 603.000000, 20.000000);
  461. TextDrawSetSelectable(Banco[6], true);
  462.  
  463. Banco[7] = TextDrawCreate(540.000000, 170.000000, "New Textdraw");
  464. TextDrawBackgroundColor(Banco[7], 0);
  465. TextDrawFont(Banco[7], 5);
  466. TextDrawLetterSize(Banco[7], 0.500000, 1.000000);
  467. TextDrawColor(Banco[7], -1);
  468. TextDrawSetOutline(Banco[7], 0);
  469. TextDrawSetProportional(Banco[7], 1);
  470. TextDrawSetShadow(Banco[7], 1);
  471. TextDrawUseBox(Banco[7], 1);
  472. TextDrawBoxColor(Banco[7], 255);
  473. TextDrawTextSize(Banco[7], 90.000000, 130.000000);
  474. TextDrawSetPreviewModel(Banco[7], 1212);
  475. TextDrawSetPreviewRot(Banco[7], -16.000000, 0.000000, -55.000000, 1.000000);
  476. TextDrawSetSelectable(Banco[7], 0);
  477.  
  478. Banco[8] = TextDrawCreate(600.000000, 128.000000, "X");
  479. TextDrawBackgroundColor(Banco[8], 255);
  480. TextDrawFont(Banco[8], 1);
  481. TextDrawLetterSize(Banco[8], 0.889999, 2.099999);
  482. TextDrawColor(Banco[8], -1);
  483. TextDrawSetOutline(Banco[8], 0);
  484. TextDrawSetProportional(Banco[8], 1);
  485. TextDrawSetShadow(Banco[8], 1);
  486. TextDrawUseBox(Banco[8], 1);
  487. TextDrawBoxColor(Banco[8], 255);
  488. TextDrawTextSize(Banco[8], 621.000000, 15.000000);
  489. TextDrawSetSelectable(Banco[8], true);
  490.  
  491. // == text fundo
  492. Fundo[0] = TextDrawCreate(197.000000, 2.000000, "#"); // box total
  493. TextDrawBackgroundColor(Fundo[0], 255);
  494. TextDrawFont(Fundo[0], 2);
  495. TextDrawLetterSize(Fundo[0], 0.500000, 49.499992);
  496. TextDrawColor(Fundo[0], -1);
  497. TextDrawSetOutline(Fundo[0], 0);
  498. TextDrawSetProportional(Fundo[0], 1);
  499. TextDrawSetShadow(Fundo[0], 1);
  500. TextDrawUseBox(Fundo[0], 1);
  501. TextDrawBoxColor(Fundo[0], 136);
  502. TextDrawTextSize(Fundo[0], 442.000000, -21.000000);
  503. TextDrawSetSelectable(Fundo[0], 0);
  504.  
  505. Fundo[1] = TextDrawCreate(270.000000, 13.000000, "~r~~h~L~w~ife~g~~h~V~w~irtual"); // logo
  506. TextDrawBackgroundColor(Fundo[1], 255);
  507. TextDrawFont(Fundo[1], 1);
  508. TextDrawLetterSize(Fundo[1], 0.600000, 2.900000);
  509. TextDrawColor(Fundo[1], -1);
  510. TextDrawSetOutline(Fundo[1], 0);
  511. TextDrawSetProportional(Fundo[1], 1);
  512. TextDrawSetShadow(Fundo[1], 1);
  513. TextDrawSetSelectable(Fundo[1], 0);
  514.  
  515. Fundo[2] = TextDrawCreate(250.000000, 38.000000, "~w~-"); // linha embaixo do logo
  516. TextDrawBackgroundColor(Fundo[2], 255);
  517. TextDrawFont(Fundo[2], 1);
  518. TextDrawLetterSize(Fundo[2], 9.510000, 1.000000);
  519. TextDrawColor(Fundo[2], -1);
  520. TextDrawSetOutline(Fundo[2], 0);
  521. TextDrawSetProportional(Fundo[2], 1);
  522. TextDrawSetShadow(Fundo[2], 1);
  523. TextDrawSetSelectable(Fundo[2], 0);
  524.  
  525. Fundo[3] = TextDrawCreate(197.000000, 97.000000, "#"); // barra de cima
  526. TextDrawBackgroundColor(Fundo[3], 255);
  527. TextDrawFont(Fundo[3], 2);
  528. TextDrawLetterSize(Fundo[3], 0.610000, 0.199999);
  529. TextDrawColor(Fundo[3], -1);
  530. TextDrawSetOutline(Fundo[3], 0);
  531. TextDrawSetProportional(Fundo[3], 1);
  532. TextDrawSetShadow(Fundo[3], 1);
  533. TextDrawUseBox(Fundo[3], 1);
  534. TextDrawBoxColor(Fundo[3], 255);
  535. TextDrawTextSize(Fundo[3], 442.000000, -20.000000);
  536. TextDrawSetSelectable(Fundo[3], 0);
  537.  
  538. Fundo[4] = TextDrawCreate(250.000000, 370.000000, "Bom jogo ! Equipe LV");
  539. TextDrawBackgroundColor(Fundo[4], 255);
  540. TextDrawFont(Fundo[4], 2);
  541. TextDrawLetterSize(Fundo[4], 0.290000, 1.000000);
  542. TextDrawColor(Fundo[4], -1);
  543. TextDrawSetOutline(Fundo[4], 1);
  544. TextDrawSetProportional(Fundo[4], 1);
  545. TextDrawSetSelectable(Fundo[4], 0);
  546.  
  547. Fundo[5] = TextDrawCreate(193.000000, 2.000000, "#"); // barra esquerda
  548. TextDrawBackgroundColor(Fundo[5], 255);
  549. TextDrawFont(Fundo[5], 2);
  550. TextDrawLetterSize(Fundo[5], 0.610000, 51.099998);
  551. TextDrawColor(Fundo[5], -1);
  552. TextDrawSetOutline(Fundo[5], 0);
  553. TextDrawSetProportional(Fundo[5], 1);
  554. TextDrawSetShadow(Fundo[5], 1);
  555. TextDrawUseBox(Fundo[5], 1);
  556. TextDrawBoxColor(Fundo[5], 255);
  557. TextDrawTextSize(Fundo[5], 194.000000, -20.000000);
  558. TextDrawSetSelectable(Fundo[5], 0);
  559.  
  560. Fundo[6] = TextDrawCreate(446.000000, 2.000000, "#"); // barra direita
  561. TextDrawBackgroundColor(Fundo[6], 255);
  562. TextDrawFont(Fundo[6], 2);
  563. TextDrawLetterSize(Fundo[6], 0.610000, 51.099998);
  564. TextDrawColor(Fundo[6], -1);
  565. TextDrawSetOutline(Fundo[6], 0);
  566. TextDrawSetProportional(Fundo[6], 1);
  567. TextDrawSetShadow(Fundo[6], 1);
  568. TextDrawUseBox(Fundo[6], 1);
  569. TextDrawBoxColor(Fundo[6], 255);
  570. TextDrawTextSize(Fundo[6], 438.000000, -20.000000);
  571. TextDrawSetSelectable(Fundo[6], 0);
  572.  
  573. // == Registro
  574. Registro[0] = TextDrawCreate(197.000000, 80.000000, " Registro");
  575. TextDrawBackgroundColor(Registro[0], 255);
  576. TextDrawFont(Registro[0], 3);
  577. TextDrawLetterSize(Registro[0], 0.540000, 1.699998);
  578. TextDrawColor(Registro[0], -1);
  579. TextDrawSetOutline(Registro[0], 1);
  580. TextDrawSetProportional(Registro[0], 1);
  581. TextDrawUseBox(Registro[0], 1);
  582. TextDrawBoxColor(Registro[0], 255);
  583. TextDrawTextSize(Registro[0], 314.000000, 0.000000);
  584. TextDrawSetSelectable(Registro[0], 0);
  585.  
  586. Registro[1] = TextDrawCreate(197.000000, 332.000000, "#"); // barra de baixo
  587. TextDrawBackgroundColor(Registro[1], 255);
  588. TextDrawFont(Registro[1], 2);
  589. TextDrawLetterSize(Registro[1], 0.610000, 0.199999);
  590. TextDrawColor(Registro[1], -1);
  591. TextDrawSetOutline(Registro[1], 0);
  592. TextDrawSetProportional(Registro[1], 1);
  593. TextDrawSetShadow(Registro[1], 1);
  594. TextDrawUseBox(Registro[1], 1);
  595. TextDrawBoxColor(Registro[1], 255);
  596. TextDrawTextSize(Registro[1], 442.000000, -20.000000);
  597. TextDrawSetSelectable(Registro[1], 0);
  598.  
  599. Registro[2] = TextDrawCreate(235.000000, 139.000000, " SEXO");
  600. TextDrawBackgroundColor(Registro[2], 255);
  601. TextDrawFont(Registro[2], 1);
  602. TextDrawLetterSize(Registro[2], 0.500000, 1.499999);
  603. TextDrawColor(Registro[2], -1);
  604. TextDrawSetOutline(Registro[2], 1);
  605. TextDrawSetProportional(Registro[2], 1);
  606. TextDrawUseBox(Registro[2], 1);
  607. TextDrawBoxColor(Registro[2], 102);
  608. TextDrawTextSize(Registro[2], 403.000000, 10.000000);
  609. TextDrawSetSelectable(Registro[2], true);
  610.  
  611. Registro[3] = TextDrawCreate(235.000000, 184.000000, " SENHA");
  612. TextDrawBackgroundColor(Registro[3], 255);
  613. TextDrawFont(Registro[3], 1);
  614. TextDrawLetterSize(Registro[3], 0.500000, 1.499999);
  615. TextDrawColor(Registro[3], -1);
  616. TextDrawSetOutline(Registro[3], 1);
  617. TextDrawSetProportional(Registro[3], 1);
  618. TextDrawUseBox(Registro[3], 1);
  619. TextDrawBoxColor(Registro[3], 102);
  620. TextDrawTextSize(Registro[3], 403.000000, 10.000000);
  621. TextDrawSetSelectable(Registro[3], true);
  622.  
  623. Registro[4] = TextDrawCreate(235.000000, 230.000000, " IDADE");
  624. TextDrawBackgroundColor(Registro[4], 255);
  625. TextDrawFont(Registro[4], 1);
  626. TextDrawLetterSize(Registro[4], 0.500000, 1.499999);
  627. TextDrawColor(Registro[4], -1);
  628. TextDrawSetOutline(Registro[4], 1);
  629. TextDrawSetProportional(Registro[4], 1);
  630. TextDrawUseBox(Registro[4], 1);
  631. TextDrawBoxColor(Registro[4], 102);
  632. TextDrawTextSize(Registro[4], 403.000000, 10.000000);
  633. TextDrawSetSelectable(Registro[4], true);
  634.  
  635. Registro[5] = TextDrawCreate(235.000000, 276.000000, " EMAIL");
  636. TextDrawBackgroundColor(Registro[5], 255);
  637. TextDrawFont(Registro[5], 1);
  638. TextDrawLetterSize(Registro[5], 0.500000, 1.499999);
  639. TextDrawColor(Registro[5], -1);
  640. TextDrawSetOutline(Registro[5], 1);
  641. TextDrawSetProportional(Registro[5], 1);
  642. TextDrawUseBox(Registro[5], 1);
  643. TextDrawBoxColor(Registro[5], 102);
  644. TextDrawTextSize(Registro[5], 403.000000, 10.000000);
  645. TextDrawSetSelectable(Registro[5], true);
  646.  
  647. Registro[6] = TextDrawCreate(197.000000, 332.000000, " Iniciar");
  648. TextDrawBackgroundColor(Registro[6], 255);
  649. TextDrawFont(Registro[6], 3);
  650. TextDrawLetterSize(Registro[6], 0.540000, 1.699998);
  651. TextDrawColor(Registro[6], -1);
  652. TextDrawSetOutline(Registro[6], 1);
  653. TextDrawSetProportional(Registro[6], 1);
  654. TextDrawUseBox(Registro[6], 1);
  655. TextDrawBoxColor(Registro[6], 255);
  656. TextDrawTextSize(Registro[6], 287.000000, 10.000000);
  657. TextDrawSetSelectable(Registro[6], true);
  658.  
  659. Registro[7] = TextDrawCreate(326.000000, 332.000000, " Cancelar");
  660. TextDrawBackgroundColor(Registro[7], 255);
  661. TextDrawFont(Registro[7], 3);
  662. TextDrawLetterSize(Registro[7], 0.540000, 1.699998);
  663. TextDrawColor(Registro[7], -1);
  664. TextDrawSetOutline(Registro[7], 1);
  665. TextDrawSetProportional(Registro[7], 1);
  666. TextDrawUseBox(Registro[7], 1);
  667. TextDrawBoxColor(Registro[7], 255);
  668. TextDrawTextSize(Registro[7], 442.000000, 10.000000);
  669. TextDrawSetSelectable(Registro[7], true);
  670.  
  671. Registro[8] = TextDrawCreate(210.000000, 309.000000, "Por Favor preencha todos os dados !");
  672. TextDrawBackgroundColor(Registro[8], 255);
  673. TextDrawFont(Registro[8], 2);
  674. TextDrawLetterSize(Registro[8], 0.250000, 1.000000);
  675. TextDrawColor(Registro[8], -16776961);
  676. TextDrawSetOutline(Registro[8], 1);
  677. TextDrawSetProportional(Registro[8], 1);
  678. TextDrawSetSelectable(Registro[8], 0);
  679.  
  680. // == Barra status
  681. Barra[0] = TextDrawCreate(670.000000, 429.000000, "_");
  682. TextDrawBackgroundColor(Barra[0], 255);
  683. TextDrawFont(Barra[0], 1);
  684. TextDrawLetterSize(Barra[0], 0.589999, 2.699999);
  685. TextDrawColor(Barra[0], -1);
  686. TextDrawSetOutline(Barra[0], 0);
  687. TextDrawSetProportional(Barra[0], 1);
  688. TextDrawSetShadow(Barra[0], 1);
  689. TextDrawUseBox(Barra[0], 1);
  690. TextDrawBoxColor(Barra[0], 120);
  691. TextDrawTextSize(Barra[0], -14.000000, 55.000000);
  692.  
  693. Barra[1] = TextDrawCreate(497.000000, 429.000000, "_"); // vermelho baixo
  694. TextDrawBackgroundColor(Barra[1], 90);
  695. TextDrawFont(Barra[1], 1);
  696. TextDrawLetterSize(Barra[1], 1.570000, 2.699999);
  697. TextDrawColor(Barra[1], -1);
  698. TextDrawSetOutline(Barra[1], 0);
  699. TextDrawSetProportional(Barra[1], 1);
  700. TextDrawSetShadow(Barra[1], 1);
  701. TextDrawUseBox(Barra[1], 1);
  702. TextDrawBoxColor(Barra[1], 0xff000033);
  703. TextDrawTextSize(Barra[1], 488.000000, 54.000000);
  704.  
  705. Barra[2] = TextDrawCreate(521.000000, 426.000000, "~r~~h~L~w~ife~g~~h~V~w~irtual ~r~~h~RPG");
  706. TextDrawBackgroundColor(Barra[2], 255);
  707. TextDrawFont(Barra[2], 1);
  708. TextDrawLetterSize(Barra[2], 0.389999, 2.299998);
  709. TextDrawColor(Barra[2], -1);
  710. TextDrawSetOutline(Barra[2], 0);
  711. TextDrawSetProportional(Barra[2], 1);
  712. TextDrawSetShadow(Barra[2], 1);
  713. TextDrawSetSelectable(Barra[2], 0);
  714.  
  715. Barra[3] = TextDrawCreate(291.000000, 429.000000, "www.lifevirtual.forumeiros.com");
  716. TextDrawBackgroundColor(Barra[3], 255);
  717. TextDrawFont(Barra[3], 3);
  718. TextDrawLetterSize(Barra[3], 0.310000, 1.600000);
  719. TextDrawColor(Barra[3], -2139062017);
  720. TextDrawSetOutline(Barra[3], 1);
  721. TextDrawSetProportional(Barra[3], 1);
  722.  
  723. Barra[4] = TextDrawCreate(15.000000, 430.000000, "");
  724. TextDrawBackgroundColor(Barra[4], 255);
  725. TextDrawFont(Barra[4], 3);
  726. TextDrawLetterSize(Barra[4], 0.330000, 1.600000);
  727. TextDrawColor(Barra[4], -2139062017);
  728. TextDrawSetOutline(Barra[4], 1);
  729. TextDrawSetProportional(Barra[4], 1);
  730.  
  731.  
  732. // == Text Relogio e data
  733. Relogio[0] = TextDrawCreate(548.000000, 12.000000, " ~w~17~y~:~w~35");
  734. TextDrawBackgroundColor(Relogio[0], 255);
  735. TextDrawFont(Relogio[0], 2);
  736. TextDrawLetterSize(Relogio[0], 0.340000, 1.399999);
  737. TextDrawColor(Relogio[0], -1);
  738. TextDrawSetOutline(Relogio[0], 1);
  739. TextDrawSetProportional(Relogio[0], 1);
  740. TextDrawUseBox(Relogio[0], 1);
  741. TextDrawBoxColor(Relogio[0], 51);
  742. TextDrawTextSize(Relogio[0], 605.000000, 0.000000);
  743. TextDrawSetSelectable(Relogio[0], 0);
  744.  
  745. Relogio[1] = TextDrawCreate(548.000000, 27.000000, "~w~04~y~/~w~03~y~/~w~2015");
  746. TextDrawBackgroundColor(Relogio[1], 255);
  747. TextDrawFont(Relogio[1], 2);
  748. TextDrawLetterSize(Relogio[1], 0.220000, 1.399999);
  749. TextDrawColor(Relogio[1], -1);
  750. TextDrawSetOutline(Relogio[1], 1);
  751. TextDrawSetProportional(Relogio[1], 1);
  752. TextDrawUseBox(Relogio[1], 1);
  753. TextDrawBoxColor(Relogio[1], 51);
  754. TextDrawTextSize(Relogio[1], 605.000000, -1.000000);
  755. TextDrawSetSelectable(Relogio[1], 0);
  756.  
  757. // == Text Postos gasolina
  758. TextPostos[0] = TextDrawCreate(20.000000, 123.000000, "Posto ~y~Ipiranga");
  759. TextDrawBackgroundColor(TextPostos[0], 255);
  760. TextDrawFont(TextPostos[0], 3);
  761. TextDrawLetterSize(TextPostos[0], 0.600000, 3.000000);
  762. TextDrawColor(TextPostos[0], -1);
  763. TextDrawSetOutline(TextPostos[0], 1);
  764. TextDrawSetProportional(TextPostos[0], 1);
  765. TextDrawSetSelectable(TextPostos[0], 0);
  766.  
  767. TextPostos[1] = TextDrawCreate(20.000000, 153.000000, "~r~/enchergalao");
  768. TextDrawBackgroundColor(TextPostos[1], 255);
  769. TextDrawFont(TextPostos[1], 3);
  770. TextDrawLetterSize(TextPostos[1], 0.600000, 3.000000);
  771. TextDrawColor(TextPostos[1], -1);
  772. TextDrawSetOutline(TextPostos[1], 1);
  773. TextDrawSetProportional(TextPostos[1], 1);
  774. TextDrawSetSelectable(TextPostos[1], 0);
  775.  
  776. TextPostos[2] = TextDrawCreate(20.000000, 184.000000, "~r~/abastecer");
  777. TextDrawBackgroundColor(TextPostos[2], 255);
  778. TextDrawFont(TextPostos[2], 3);
  779. TextDrawLetterSize(TextPostos[2], 0.600000, 3.000000);
  780. TextDrawColor(TextPostos[2], -1);
  781. TextDrawSetOutline(TextPostos[2], 1);
  782. TextDrawSetProportional(TextPostos[2], 1);
  783. TextDrawSetSelectable(TextPostos[2], 0);
  784.  
  785. return 1;
  786. }
  787.  
  788. public OnGameModeExit()
  789. {
  790. for(new i = 0; i < MAX_PLAYERS; i++)
  791. {
  792. SalvarDados(i);
  793. }
  794. DOF2_Exit();
  795. return 1;
  796. }
  797.  
  798. public OnPlayerConnect(playerid)
  799. {
  800. SetTimerEx("Locais", 1000, true, "i", playerid);
  801.  
  802. new StringBans[40];
  803. format(StringBans, sizeof(StringBans), BANIDOS, Nome(playerid));
  804. if(DOF2_FileExists(StringBans)) return VerificarBans(playerid);
  805.  
  806. new StringIPSBans[40];
  807. format(StringIPSBans, sizeof(StringIPSBans), IPSBANIDOS, IP(playerid));
  808. if(DOF2_FileExists(StringIPSBans)) return VerificarBansIP(playerid);
  809.  
  810. // ==
  811. Motor[playerid] = CreatePlayerTextDraw(playerid, 142.000000, 419.000000, "");
  812. PlayerTextDrawBackgroundColor(playerid, Motor[playerid], 255);
  813. PlayerTextDrawFont(playerid, Motor[playerid], 2);
  814. PlayerTextDrawLetterSize(playerid, Motor[playerid], 0.300000, 1.600000);
  815. PlayerTextDrawColor(playerid, Motor[playerid], -1);
  816. PlayerTextDrawSetOutline(playerid, Motor[playerid], 1);
  817. PlayerTextDrawSetProportional(playerid, Motor[playerid], 1);
  818.  
  819. Combust[playerid] = CreatePlayerTextDraw(playerid, 141.000000, 401.000000, " ");
  820. PlayerTextDrawBackgroundColor(playerid, Combust[playerid], 255);
  821. PlayerTextDrawFont(playerid, Combust[playerid], 2);
  822. PlayerTextDrawLetterSize(playerid, Combust[playerid], 0.160000, 2.100000);
  823. PlayerTextDrawColor(playerid, Combust[playerid], -1);
  824. PlayerTextDrawSetOutline(playerid, Combust[playerid], 1);
  825. PlayerTextDrawSetProportional(playerid, Combust[playerid], 1);
  826.  
  827. Velo[playerid] = CreatePlayerTextDraw(playerid, 140.000000, 364.000000, " ");
  828. PlayerTextDrawBackgroundColor(playerid, Velo[playerid], 255);
  829. PlayerTextDrawFont(playerid, Velo[playerid], 2);
  830. PlayerTextDrawLetterSize(playerid, Velo[playerid], 0.599999, 4.699997);
  831. PlayerTextDrawColor(playerid, Velo[playerid], -1);
  832. PlayerTextDrawSetOutline(playerid, Velo[playerid], 1);
  833. PlayerTextDrawSetProportional(playerid, Velo[playerid], 1);
  834.  
  835. Kmh[playerid] = CreatePlayerTextDraw(playerid, 187.000000, 378.000000, " ~y~KM~i~/~y~H");
  836. PlayerTextDrawBackgroundColor(playerid, Kmh[playerid], 255);
  837. PlayerTextDrawFont(playerid, Kmh[playerid], 2);
  838. PlayerTextDrawLetterSize(playerid, Kmh[playerid], 0.190000, 2.799999);
  839. PlayerTextDrawColor(playerid, Kmh[playerid], -1);
  840. PlayerTextDrawSetOutline(playerid, Kmh[playerid], 1);
  841. PlayerTextDrawSetProportional(playerid, Kmh[playerid], 1);
  842.  
  843. Veiculo[playerid] = CreatePlayerTextDraw(playerid, 141.000000, 360.000000, " ");
  844. PlayerTextDrawBackgroundColor(playerid, Veiculo[playerid], 255);
  845. PlayerTextDrawFont(playerid, Veiculo[playerid], 2);
  846. PlayerTextDrawLetterSize(playerid, Veiculo[playerid], 0.250000, 1.200000);
  847. PlayerTextDrawColor(playerid, Veiculo[playerid], -1);
  848. PlayerTextDrawSetOutline(playerid, Veiculo[playerid], 1);
  849. PlayerTextDrawSetProportional(playerid, Veiculo[playerid], 1);
  850.  
  851. // == Login
  852. Login[playerid][0] = TextDrawCreate(197.000000, 80.000000, " Login");
  853. TextDrawBackgroundColor(Login[playerid][0], 255);
  854. TextDrawFont(Login[playerid][0], 3);
  855. TextDrawLetterSize(Login[playerid][0], 0.540000, 1.699998);
  856. TextDrawColor(Login[playerid][0], -1);
  857. TextDrawSetOutline(Login[playerid][0], 1);
  858. TextDrawSetProportional(Login[playerid][0], 1);
  859. TextDrawUseBox(Login[playerid][0], 1);
  860. TextDrawBoxColor(Login[playerid][0], 255);
  861. TextDrawTextSize(Login[playerid][0], 299.000000, 0.000000);
  862. TextDrawSetSelectable(Login[playerid][0], 0);
  863.  
  864. Login[playerid][1] = TextDrawCreate(220.000000, 138.000000, "Nick: ~w~");
  865. TextDrawBackgroundColor(Login[playerid][1], 255);
  866. TextDrawFont(Login[playerid][1], 2);
  867. TextDrawLetterSize(Login[playerid][1], 0.260000, 1.899999);
  868. TextDrawColor(Login[playerid][1], -1);
  869. TextDrawSetOutline(Login[playerid][1], 0);
  870. TextDrawSetProportional(Login[playerid][1], 1);
  871. TextDrawSetShadow(Login[playerid][1], 1);
  872. TextDrawSetSelectable(Login[playerid][1], 0);
  873.  
  874. Login[playerid][2] = TextDrawCreate(220.000000, 170.000000, "ID: ~w~00");
  875. TextDrawBackgroundColor(Login[playerid][2], 255);
  876. TextDrawFont(Login[playerid][2], 2);
  877. TextDrawLetterSize(Login[playerid][2], 0.389999, 1.899999);
  878. TextDrawColor(Login[playerid][2], -1);
  879. TextDrawSetOutline(Login[playerid][2], 0);
  880. TextDrawSetProportional(Login[playerid][2], 1);
  881. TextDrawSetShadow(Login[playerid][2], 1);
  882. TextDrawSetSelectable(Login[playerid][2], 0);
  883.  
  884. Login[playerid][3] = TextDrawCreate(235.000000, 248.000000, " JOGAR");
  885. TextDrawBackgroundColor(Login[playerid][3], 255);
  886. TextDrawFont(Login[playerid][3], 1);
  887. TextDrawLetterSize(Login[playerid][3], 0.500000, 1.499999);
  888. TextDrawColor(Login[playerid][3], -1);
  889. TextDrawSetOutline(Login[playerid][3], 1);
  890. TextDrawSetProportional(Login[playerid][3], 1);
  891. TextDrawUseBox(Login[playerid][3], 1);
  892. TextDrawBoxColor(Login[playerid][3], 102);
  893. TextDrawTextSize(Login[playerid][3], 403.000000, 10.000000);
  894. TextDrawSetSelectable(Login[playerid][3], true);
  895.  
  896. Login[playerid][4] = TextDrawCreate(235.000000, 292.000000, " FORUM");
  897. TextDrawBackgroundColor(Login[playerid][4], 255);
  898. TextDrawFont(Login[playerid][4], 1);
  899. TextDrawLetterSize(Login[playerid][4], 0.500000, 1.499999);
  900. TextDrawColor(Login[playerid][4], -1);
  901. TextDrawSetOutline(Login[playerid][4], 1);
  902. TextDrawSetProportional(Login[playerid][4], 1);
  903. TextDrawUseBox(Login[playerid][4], 1);
  904. TextDrawBoxColor(Login[playerid][4], 102);
  905. TextDrawTextSize(Login[playerid][4], 403.000000, 10.000000);
  906. TextDrawSetSelectable(Login[playerid][4], true);
  907.  
  908. Login[playerid][5] = TextDrawCreate(235.000000, 337.000000, " CREDITOS");
  909. TextDrawBackgroundColor(Login[playerid][5], 255);
  910. TextDrawFont(Login[playerid][5], 1);
  911. TextDrawLetterSize(Login[playerid][5], 0.500000, 1.499999);
  912. TextDrawColor(Login[playerid][5], -1);
  913. TextDrawSetOutline(Login[playerid][5], 1);
  914. TextDrawSetProportional(Login[playerid][5], 1);
  915. TextDrawUseBox(Login[playerid][5], 1);
  916. TextDrawBoxColor(Login[playerid][5], 102);
  917. TextDrawTextSize(Login[playerid][5], 403.000000, 10.000000);
  918. TextDrawSetSelectable(Login[playerid][5], true);
  919.  
  920. PlayAudioStreamForPlayer(playerid, "http://live.hunterfm.com/live");
  921. SelectTextDraw(playerid, 0xFF0000FF);
  922. for(new i = 0; i < sizeof(Fundo); i++) TextDrawShowForPlayer(playerid, Fundo[i]);
  923.  
  924.  
  925. new StringContas[40];
  926. format(StringContas, sizeof(StringContas), CONTAS, Nome(playerid));
  927. if(DOF2_FileExists(StringContas))
  928. {
  929. Msg(playerid, LARANJA, "LV: Você ja tem uma conta, digite sua senha para logar.");
  930.  
  931. Login[playerid][6] = TextDrawCreate(343.000000, 110.000000, "skin");
  932. TextDrawBackgroundColor(Login[playerid][6], 0);
  933. TextDrawFont(Login[playerid][6], 5);
  934. TextDrawLetterSize(Login[playerid][6], 0.479999, 10.600000);
  935. TextDrawColor(Login[playerid][6], -1);
  936. TextDrawSetOutline(Login[playerid][6], 1);
  937. TextDrawSetProportional(Login[playerid][6], 1);
  938. TextDrawUseBox(Login[playerid][6], 1);
  939. TextDrawBoxColor(Login[playerid][6], 255);
  940. TextDrawTextSize(Login[playerid][6], 99.000000, 120.000000);
  941. TextDrawSetPreviewModel(Login[playerid][6], DOF2_GetInt(StringContas, "Skin"));
  942. TextDrawSetPreviewRot(Login[playerid][6], 1.000000, 1.000000, 1.000000, 1.000000);
  943. TextDrawSetSelectable(Login[playerid][6], 0);
  944.  
  945. new NomeText[32], Tid[20];
  946. format(NomeText, sizeof(NomeText), "~g~~h~Nick: ~w~%s", Nome(playerid));
  947. TextDrawSetString(Login[playerid][1], NomeText);
  948. format(Tid, sizeof(Tid), "~g~~h~ID: ~w~%d", playerid);
  949. TextDrawSetString(Login[playerid][2], Tid);
  950.  
  951. for(new i = 0; i < 7; i++) TextDrawShowForPlayer(playerid, Login[playerid][i]);
  952.  
  953. } else {
  954.  
  955. Msg(playerid, VERMELHO, "LV: Você ainda não tem uma conta, digite sua senha para se registrar.");
  956.  
  957. for(new i = 0; i < 8; i++) TextDrawShowForPlayer(playerid, Registro[i]);
  958. }
  959. return 1;
  960. }
  961.  
  962. public OnPlayerRequestClass(playerid, classid)
  963. {
  964. InterpolateCameraPos(playerid, -2397.553710, 1436.038452, 140.798019, -2876.055175, 1382.189697, 159.150161, 17000);
  965. InterpolateCameraLookAt(playerid, -2401.776855, 1438.431640, 139.599197, -2872.188964, 1384.818359, 157.377395, 17000);
  966. return 1;
  967. }
  968.  
  969. public OnPlayerDisconnect(playerid, reason)
  970. {
  971. SalvarDados(playerid);
  972. new string[100];
  973. switch(reason)
  974. {
  975. case 0: format(string,sizeof string,"{058AFF}LV:» {CFCFCF}%s{FFFFFF} Saiu do servidor{FF0000} (Crash/Erro)",Nome(playerid));
  976. case 1: format(string,sizeof string,"{058AFF}LV:» {CFCFCF}%s{FFFFFF} Saiu do servidor{FF0000} (Vontade Propria)",Nome(playerid));
  977. case 2: format(string,sizeof string,"{058AFF}LV:» {CFCFCF}%s{FFFFFF} Saiu do servidor{FF0000} (Kickado/Banido)",Nome(playerid));
  978. }
  979. MsgAll(-1, string);
  980.  
  981. for(new p = 0; p < sizeof(Barra); p++) TextDrawHideForPlayer(playerid, Barra[p]);
  982. for(new p = 0; p < sizeof(Relogio); p++) TextDrawHideForPlayer(playerid, Relogio[p]);
  983. return 1;
  984. }
  985.  
  986. public OnPlayerSpawn(playerid)
  987. {
  988. if(PlayerInfo[playerid][pLogado] == false) return 1;
  989. for(new p = 0; p < sizeof(Relogio); p++) TextDrawShowForPlayer(playerid, Relogio[p]);
  990. for(new p = 0; p < sizeof(Barra); p++) TextDrawShowForPlayer(playerid, Barra[p]);
  991. return 1;
  992. }
  993.  
  994. forward SpawnInHome(playerid);
  995. public SpawnInHome(playerid)
  996. {
  997. new
  998. house,
  999. tenantHouseID,
  1000. tenantFile[200],
  1001. houseFile[200],
  1002. houseFile2[200],
  1003. ownerFile[200],
  1004. logString[700];
  1005.  
  1006. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", Nome(playerid));
  1007. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", Nome(playerid));
  1008.  
  1009. house = DOF2_GetInt(ownerFile, "houseID");
  1010. tenantHouseID = DOF2_GetInt(tenantFile, "houseID");
  1011.  
  1012. format(houseFile, sizeof houseFile, "Casas/Casas/Casa %d.ini", house);
  1013. format(houseFile2, sizeof houseFile2, "Casas/Casas/Casa %d.ini", tenantHouseID);
  1014.  
  1015. if(DOF2_FileExists(ownerFile))
  1016. {
  1017. new value = DOF2_GetInt(ownerFile, "ValorAreceber");
  1018.  
  1019. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  1020. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  1021. SetPlayerFacingAngle(playerid, CasaInfo[house][houseIntFA]);
  1022. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  1023.  
  1024. format(logString, sizeof logString, "O jogador %s[%d], foi spawnado na casa %d.", Nome(playerid), playerid, house);
  1025. WriteLog(LOG_HOUSES, logString);
  1026.  
  1027. if(value != 0)
  1028. {
  1029. format(logString, sizeof logString, "O jogador %s[%d], foi spawnado na casa %d, e coletou o aluguel de $%d.", Nome(playerid), playerid, house, CasaInfo[house][houseIncoming]);
  1030. WriteLog(LOG_HOUSES, logString);
  1031. GivePlayerCash(playerid, CasaInfo[house][houseIncoming]);
  1032. CasaInfo[house][houseIncoming] = 0;
  1033. DOF2_SetInt(ownerFile, "ValorAreceber", CasaInfo[house][houseIncoming]);
  1034. return 1;
  1035. }
  1036.  
  1037. return 1;
  1038. }
  1039.  
  1040. else if(DOF2_FileExists(tenantFile))
  1041. {
  1042. new
  1043. value = DOF2_GetInt(tenantFile, "ValorApagar");
  1044.  
  1045. SetPlayerVirtualWorld(playerid, CasaInfo[tenantHouseID][houseVirtualWorld]);
  1046. SetPlayerPos(playerid, CasaInfo[tenantHouseID][houseIntX], CasaInfo[tenantHouseID][houseIntY], CasaInfo[tenantHouseID][houseIntZ]);
  1047. SetPlayerFacingAngle(playerid, CasaInfo[tenantHouseID][houseIntFA]);
  1048. SetPlayerInterior(playerid, CasaInfo[tenantHouseID][houseInterior]);
  1049.  
  1050. format(logString, sizeof logString, "O jogador %s[%d], foi spawnado na casa %d.", Nome(playerid), playerid, tenantHouseID);
  1051. WriteLog(LOG_HOUSES, logString);
  1052.  
  1053. if(value != 0)
  1054. {
  1055. if(GetPlayerCash(playerid) < value)
  1056. {
  1057. new
  1058. Float: X, Float: Y, Float: Z;
  1059.  
  1060. GetPlayerPos(playerid, X, Y, Z);
  1061. PlayerPlaySound(playerid, 1085, X, Y, Z);
  1062. Msg(playerid, VERMELHO, "ERRO: Você não tem dinheiro o suficiente para pagar o aluguel e foi despejado.");
  1063.  
  1064. format(CasaInfo[tenantHouseID][houseTenant], 255, "Ninguem");
  1065. DOF2_SetString(houseFile2, "Locador", "Ninguem", "Aluguel");
  1066. DOF2_RemoveFile(tenantFile);
  1067. Update3DText(tenantHouseID);
  1068.  
  1069. format(logString, sizeof logString, "O jogador %s[%d], não tinha dinheiro o suficiente para pagar o aluguel da casa %d e foi despejado.", Nome(playerid), playerid, tenantHouseID);
  1070. WriteLog(LOG_HOUSES, logString);
  1071.  
  1072. return 1;
  1073. }
  1074.  
  1075. format(logString, sizeof logString, "O jogador %s[%d], foi spawnado na casa %d e pagou $%d de aluguel.", Nome(playerid), playerid, tenantHouseID, value);
  1076. WriteLog(LOG_HOUSES, logString);
  1077.  
  1078. GivePlayerCash(playerid, -value);
  1079. CasaInfo[tenantHouseID][houseOutcoming] = 0;
  1080.  
  1081. DOF2_SetInt(tenantFile, "ValorApagar", CasaInfo[tenantHouseID][houseOutcoming]);
  1082. return 1;
  1083. }
  1084.  
  1085. return 1;
  1086. }
  1087.  
  1088. return 1;
  1089. }
  1090.  
  1091. forward RentalCharge();
  1092. public RentalCharge()
  1093. {
  1094. new
  1095. Float: X, Float: Y, Float: Z,
  1096. housesCharged,
  1097. playersDumped,
  1098. ownerID,
  1099. tenantID,
  1100. logString[700],
  1101. playerName2[MAX_PLAYER_NAME],
  1102. playerName3[MAX_PLAYER_NAME],
  1103. ownerFile[200],
  1104. tenantFile[200],
  1105. houseFile[200],
  1106. string[128];
  1107.  
  1108. gettime(timeHour, timeMinute, timeSecond);
  1109.  
  1110. for(new i = 1; i < MAX_CASAS; i++)
  1111. {
  1112. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", CasaInfo[i][houseOwner]);
  1113. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", CasaInfo[i][houseTenant]);
  1114. format(houseFile, sizeof houseFile, "Casas/Casas/Casa %d.ini", i);
  1115.  
  1116. if(DOF2_FileExists(ownerFile) || DOF2_FileExists(tenantFile))
  1117. {
  1118. for(new ids = 0; ids < MAX_PLAYERS; ids++)
  1119. {
  1120. if(IsPlayerConnected(ids))
  1121. {
  1122. GetPlayerName(ids, playerName, MAX_PLAYER_NAME);
  1123.  
  1124. if(!strcmp(CasaInfo[i][houseOwner], playerName, true))
  1125. {
  1126. ownerID = ids;
  1127. GetPlayerName(ownerID, playerName2, MAX_PLAYER_NAME);
  1128. }
  1129.  
  1130. if(!strcmp(CasaInfo[i][houseTenant], playerName, true))
  1131. {
  1132. tenantID = ids;
  1133. GetPlayerName(tenantID, playerName3, MAX_PLAYER_NAME);
  1134. }
  1135. }
  1136. }
  1137. }
  1138. if(timeHour == 15)
  1139. {
  1140. if(timeMinute == 43)
  1141. {
  1142. if(timeSecond == 00)
  1143. {
  1144. if(strcmp(CasaInfo[i][houseTenant], "Ninguem", true))
  1145. {
  1146. housesCharged++;
  1147. CasaInfo[i][houseOutcoming] += CasaInfo[i][houseRentPrice];
  1148. CasaInfo[i][houseIncoming] += CasaInfo[i][houseRentPrice];
  1149. DOF2_SetInt(ownerFile, "ValorAreceber", CasaInfo[i][houseIncoming]);
  1150. DOF2_SetInt(tenantFile, "ValorApagar", CasaInfo[i][houseOutcoming]);
  1151.  
  1152. if(IsPlayerConnected(ownerID))
  1153. {
  1154. format(string, sizeof string, "{AB82FF}LV CASAS: Hora de receber o aluguel! Você recebeu {FFFFFF}$%d {FFFFFF}do locador.", CasaInfo[i][houseIncoming]);
  1155. Msg(ownerID, -1, string);
  1156. GivePlayerCash(ownerID, CasaInfo[i][houseIncoming]);
  1157. CasaInfo[i][houseIncoming] = 0;
  1158. DOF2_SetInt(ownerFile, "ValorAreceber", CasaInfo[i][houseIncoming]);
  1159. }
  1160.  
  1161. if(IsPlayerConnected(tenantID))
  1162. {
  1163. if(PlayerInfo[tenantID][SaldoBancario] < CasaInfo[i][houseOutcoming])
  1164. {
  1165. playersDumped++;
  1166. GetPlayerPos(tenantID, X, Y, Z);
  1167. PlayerPlaySound(tenantID, 1085, X, Y, Z);
  1168. Msg(tenantID, VERMELHO, "ERRO: Você não tem dinheiro o suficiente para pagar o aluguel. Você foi despejado.");
  1169. format(CasaInfo[i][houseTenant], 255, "Ninguem");
  1170. DOF2_SetString(houseFile, "Locador", "Ninguem", "Aluguel");
  1171. DOF2_RemoveFile(tenantFile);
  1172. Update3DText(i);
  1173. return 1;
  1174. }
  1175.  
  1176. format(string, sizeof string, "{AB82FF}LV CASAS: Hora de pagar o aluguel! Você pagou {FFFFFF}$%d {FFFFFF}de aluguel que foram descontados da conta bancaria.", CasaInfo[i][houseOutcoming]);
  1177. Msg(tenantID, -1, string);
  1178. PlayerInfo[tenantID][SaldoBancario] -= CasaInfo[i][houseOutcoming];
  1179. CasaInfo[i][houseOutcoming] = 0;
  1180. DOF2_SetInt(tenantFile, "ValorApagar", CasaInfo[i][houseOutcoming]);
  1181. }
  1182. }
  1183. }
  1184. }
  1185. }
  1186. }
  1187.  
  1188. if(housesCharged != 0)
  1189. {
  1190. format(logString, sizeof logString, "Foram cobrado os alugueis de %d casas, %d jogadores que não tinham dinheiro para pagar aluguel estavam conectados e foram despejados.", housesCharged, playersDumped);
  1191. return WriteLog(LOG_SYSTEM, logString);
  1192. }
  1193.  
  1194. return 1;
  1195. }
  1196.  
  1197. public OnPlayerDeath(playerid, killerid, reason)
  1198. {
  1199. if(killerid == INVALID_PLAYER_ID)
  1200. {
  1201. SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
  1202. } else {
  1203. SendDeathMessage(killerid,playerid,reason);
  1204. }
  1205.  
  1206. if(GetClosestHospital(playerid) == 0)
  1207. {
  1208. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin],-2651.6501, 634.4510, 14.4531, 180.0000, 0, 0, 0, 0, 0, 0);
  1209. } else if(GetClosestHospital(playerid) == 1){
  1210. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1173.5842, -1324.5615, 15.1953, 278.4624, 0, 0, 0, 0, 0, 0);
  1211. }else if(GetClosestHospital(playerid) == 2){
  1212. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 2031.9415, -1404.3578, 17.2614, 165.8180, 0, 0, 0, 0, 0, 0);
  1213. }else if(GetClosestHospital(playerid) == 3){
  1214. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1582.5615, 1768.7921, 10.8203, 93.7454, 0, 0, 0, 0, 0, 0);
  1215. }else if(GetClosestHospital(playerid) == 4){
  1216. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], -319.2737, 1049.8657, 20.3403, 93.7454, 0, 0, 0, 0, 0, 0);
  1217. }
  1218. return 1;
  1219. }
  1220.  
  1221. public OnVehicleSpawn(vehicleid)
  1222. {
  1223. return 1;
  1224. }
  1225.  
  1226. public OnVehicleDeath(vehicleid, killerid)
  1227. {
  1228. return 1;
  1229. }
  1230.  
  1231. public OnPlayerText(playerid, text[])
  1232. {
  1233. new Texto[128];
  1234. format(Texto, sizeof(Texto), "%s [%d]:{FFFFFF} %s", Nome(playerid), playerid, text);
  1235. MsgAll(GetPlayerColor(playerid), Texto);
  1236. SetPlayerChatBubble(playerid, text, -1, 80, 4000);
  1237. return 0;
  1238. }
  1239.  
  1240. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1241. {
  1242. if(PlayerInfo[playerid][pLevel] < 3) Msg(playerid, LARANJA, "LV: Para ver os comandos de ignição do carro digite /ajudacarro");
  1243. return 1;
  1244. }
  1245.  
  1246. public OnPlayerExitVehicle(playerid, vehicleid)
  1247. {
  1248. return 1;
  1249. }
  1250.  
  1251. public OnPlayerStateChange(playerid, newstate, oldstate)
  1252. {
  1253. if(newstate == PLAYER_STATE_DRIVER)
  1254. {
  1255. SetTimerEx("Velocimetro", 100, false, "i", playerid);
  1256.  
  1257. new modelo = GetVehicleModel(GetPlayerVehicleID(playerid));
  1258. //Habilitação nautica unica
  1259. if(modelo == 472 || modelo == 473 || modelo == 493 || modelo == 595 || modelo == 484 || modelo == 430 || modelo == 453 || modelo == 452 || modelo == 446 || modelo == 454)
  1260. {
  1261. if(PlayerInfo[playerid][HabNautica] == 0)
  1262. {
  1263. Msg(playerid, VERMELHO, "LV: Você não tem uma habilitação Nautica, Va ate o centro de licença /gps");
  1264. RemovePlayerFromVehicle(playerid);
  1265. TogglePlayerControllable(playerid, 1);
  1266. }
  1267. }
  1268. // habilitação aerea nivel 10 exp
  1269. if(modelo == 476 || modelo == 460 || modelo == 487 || modelo == 488 || modelo == 497 || modelo == 512 || modelo == 513 || modelo == 593)
  1270. {
  1271. if(PlayerInfo[playerid][HabAerea] == 0)
  1272. {
  1273. Msg(playerid, VERMELHO, "LV: Você não tem uma habilitação Aerea, Va ate o centro de licença /gps");
  1274. RemovePlayerFromVehicle(playerid);
  1275. TogglePlayerControllable(playerid, 1);
  1276. }
  1277. }
  1278.  
  1279. // habilitação aerea nivel 50 exp
  1280. if(modelo == 417 || modelo == 447 || modelo == 469 || modelo == 511 || modelo == 548 || modelo == 563)
  1281. {
  1282. if(PlayerInfo[playerid][HabAerea] < 50)
  1283. {
  1284. Msg(playerid, VERMELHO, "LV: Você não possue experiência necessaria para pilotar esse avião.");
  1285. RemovePlayerFromVehicle(playerid);
  1286. TogglePlayerControllable(playerid, 1);
  1287. format(String,sizeof String, "LV: Sua experiência em vôos: %d Exp. Quantidade necessaria: 50 Exp", PlayerInfo[playerid][HabAerea]);
  1288. Msg(playerid, VERMELHO, String);
  1289. }
  1290. }
  1291.  
  1292. // habilitação aerea nivel 100 exp
  1293. if(modelo == 425 || modelo == 519 || modelo == 520 || modelo == 553 || modelo == 577 || modelo == 592)
  1294. {
  1295. if(PlayerInfo[playerid][HabAerea] < 100)
  1296. {
  1297. Msg(playerid, VERMELHO, "LV: Você não possue experiência necessaria para pilotar esse avião.");
  1298. RemovePlayerFromVehicle(playerid);
  1299. TogglePlayerControllable(playerid, 1);
  1300. format(String,sizeof String, "LV: Sua experiência em vôos: %d Exp. Quantidade necessaria: 100 Exp", PlayerInfo[playerid][HabAerea]);
  1301. Msg(playerid, VERMELHO, String);
  1302. }
  1303. }
  1304.  
  1305. if(modelo == 400 || modelo == 401 || modelo == 402 || modelo == 404 || modelo == 405 || modelo == 410 || modelo == 411 || modelo == 412 || modelo == 413 || modelo == 415 || modelo == 419 || modelo == 420 || modelo == 421
  1306. || modelo == 422 || modelo == 423 || modelo == 424 || modelo == 426 || modelo == 429 || modelo == 434 || modelo == 436 || modelo == 438 || modelo == 439 || modelo == 440 || modelo == 441 || modelo == 442
  1307. || modelo == 444 || modelo == 445 || modelo == 451 || modelo == 457 || modelo == 458 || modelo == 459 || modelo == 466 || modelo == 467 || modelo == 470 || modelo == 474 || modelo == 475 || modelo == 477
  1308. || modelo == 480 || modelo == 482 || modelo == 483 || modelo == 485 || modelo == 489 || modelo == 490 || modelo == 491 || modelo == 492 || modelo == 494 || modelo == 495 || modelo == 496 || modelo == 498
  1309. || modelo == 499 || modelo == 500 || modelo == 502 || modelo == 503 || modelo == 504 || modelo == 505 || modelo == 506 || modelo == 507 || modelo == 508 || modelo == 516 || modelo == 517 || modelo == 518
  1310. || modelo == 526 || modelo == 527 || modelo == 528 || modelo == 529 || modelo == 530 || modelo == 531 || modelo == 533 || modelo == 534 || modelo == 535 || modelo == 536 || modelo == 540 || modelo == 541
  1311. || modelo == 542 || modelo == 543 || modelo == 545 || modelo == 546 || modelo == 547 || modelo == 549 || modelo == 550 || modelo == 551 || modelo == 552 || modelo == 554 || modelo == 555 || modelo == 556
  1312. || modelo == 557 || modelo == 558 || modelo == 559 || modelo == 560 || modelo == 561 || modelo == 562 || modelo == 565 || modelo == 566 || modelo == 567 || modelo == 568 || modelo == 571 || modelo == 572
  1313. || modelo == 574 || modelo == 575 || modelo == 576 || modelo == 579 || modelo == 580 || modelo == 582 || modelo == 583 || modelo == 587 || modelo == 588 || modelo == 589 || modelo == 596 || modelo == 597
  1314. || modelo == 598 || modelo == 599 || modelo == 600 || modelo == 601 || modelo == 602 || modelo == 603 || modelo == 604 || modelo == 605 || modelo == 522 || modelo == 461 || modelo == 521 || modelo == 523
  1315. || modelo == 463 || modelo == 586 || modelo == 468 || modelo == 471 || modelo == 409 || modelo == 414 || modelo == 418 || modelo == 525 || modelo == 532 || modelo == 573 || modelo == 609 || modelo == 406
  1316. || modelo == 407 || modelo == 408 || modelo == 416 || modelo == 427 || modelo == 428 || modelo == 431 || modelo == 433 || modelo == 437 || modelo == 455 || modelo == 456 || modelo == 486 || modelo == 524
  1317. || modelo == 544 || modelo == 578 || modelo == 403 || modelo == 443 || modelo == 514 || modelo == 515)
  1318. {
  1319. if(PlayerInfo[playerid][HabTerrestre] == 0)
  1320. {
  1321. Msg(playerid, VERMELHO, "LV: Você não tem uma habilitação Terrestre, Va ate o centro de licença /gps");
  1322. RemovePlayerFromVehicle(playerid);
  1323. TogglePlayerControllable(playerid, 1);
  1324. }
  1325. }
  1326. }
  1327. return 1;
  1328. }
  1329.  
  1330. public OnPlayerEnterCheckpoint(playerid)
  1331. {
  1332. return 1;
  1333. }
  1334.  
  1335. public OnPlayerLeaveCheckpoint(playerid)
  1336. {
  1337. return 1;
  1338. }
  1339.  
  1340. public OnPlayerEnterRaceCheckpoint(playerid)
  1341. {
  1342. return 1;
  1343. }
  1344.  
  1345. public OnPlayerLeaveRaceCheckpoint(playerid)
  1346. {
  1347. return 1;
  1348. }
  1349.  
  1350. public OnRconCommand(cmd[])
  1351. {
  1352. return 1;
  1353. }
  1354.  
  1355. public OnPlayerRequestSpawn(playerid)
  1356. {
  1357. return 1;
  1358. }
  1359.  
  1360. public OnPlayerPickUpPickup(playerid, pickupid)
  1361. {
  1362. return 1;
  1363. }
  1364.  
  1365. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1366. {
  1367. new engine, lights, alarm, doors, bonnet, boot, objective;
  1368. switch(newkeys)
  1369. {
  1370. case 4: //Alt - Motor (Engine)
  1371. {
  1372. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1373. {
  1374. new vehicleid = GetPlayerVehicleID(playerid);
  1375. if(GasolinaVeiculo[vehicleid] > 0)
  1376. {
  1377. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  1378. format(String,sizeof String, "LV: Motor %s.", (engine) ? ("{E31919}desligado") : ("{32CD32}ligado"));
  1379. Msg(playerid, CINZA, String);
  1380. SetVehicleParamsEx(vehicleid, (engine) ? (VEHICLE_PARAMS_OFF) : (VEHICLE_PARAMS_ON), lights, alarm, doors, bonnet, boot, objective);
  1381. }
  1382. }
  1383. }
  1384. case 132: //CTRL Direito - Capô (Bonnet)
  1385. {
  1386. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1387. {
  1388. new vehicleid = GetPlayerVehicleID(playerid);
  1389. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  1390. format(String,sizeof String, " LV: Capô %s.", (bonnet) ? ("{E31919}fechado") : ("{32CD32}aberto"));
  1391. Msg(playerid, CINZA, String);
  1392. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, (bonnet) ? (VEHICLE_PARAMS_OFF) : (VEHICLE_PARAMS_ON), boot, objective);
  1393. }
  1394. }
  1395. case 1: //CTRL Esquerdo - Porta malas (Boot)
  1396. {
  1397. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1398. {
  1399. new vehicleid = GetPlayerVehicleID(playerid);
  1400. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  1401. format(String,sizeof String, " LV: Porta-malas %s.", (boot) ? ("{E31919}fechado") : ("{32CD32}aberto"));
  1402. Msg(playerid, CINZA, String);
  1403. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, (boot) ? (VEHICLE_PARAMS_OFF) : (VEHICLE_PARAMS_ON), objective);
  1404. }
  1405. }
  1406. case 131072: //N - Farol (Lights)
  1407. {
  1408. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1409. {
  1410. new vehicleid = GetPlayerVehicleID(playerid);
  1411. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  1412. format(String,sizeof String, " LV: Farol %s.", (lights) ? ("{E31919}apagado") : ("{32CD32}aceso"));
  1413. Msg(playerid, CINZA, String);
  1414. SetVehicleParamsEx(vehicleid, engine, (lights) ? (VEHICLE_PARAMS_OFF) : (VEHICLE_PARAMS_ON), alarm, doors, bonnet, boot, objective);
  1415. }
  1416. }
  1417.  
  1418. case KEY_SECONDARY_ATTACK: // F casa
  1419. {
  1420. for(new house = 1; house < MAX_CASAS; house++)
  1421. {
  1422. if(IsPlayerInRangeOfPoint(playerid, 1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]))
  1423. {
  1424. if(PlayerInfo[playerid][pAdmin] == 5)
  1425. {
  1426. TogglePlayerControllable(playerid, 0);
  1427. ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_MSGBOX, "{00F2FC}Escolha um menu.", "{FFFFFF}Qual menu você gostaria de ter acesso desta casa?", "Normal", "Admin.");
  1428. return 1;
  1429. }
  1430. new Float: X, Float: Y, Float: Z;
  1431. ShowHouseMenu(playerid);
  1432. GetPlayerPos(playerid, X, Y, Z);
  1433. PlayerPlaySound(playerid, 1083, X, Y, Z);
  1434. }
  1435. else if(IsPlayerInRangeOfPoint(playerid, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]))
  1436. {
  1437. if(GetPlayerVirtualWorld(playerid) == CasaInfo[house][houseVirtualWorld])
  1438. {
  1439. SetPlayerPos(playerid, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  1440. SetPlayerVirtualWorld(playerid, 0);
  1441. SetPlayerInterior(playerid, 0);
  1442.  
  1443. new logString[400];
  1444. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1445. format(logString, sizeof logString, "O jogador %s[%d], saiu da casa %d", playerName, playerid, house);
  1446. WriteLog(LOG_SYSTEM, logString);
  1447. }
  1448. }
  1449. }
  1450. }
  1451. }
  1452. return 1;
  1453. }
  1454.  
  1455. public OnPlayerUpdate(playerid)
  1456. {
  1457. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  1458.  
  1459. new string[128];
  1460. format(string, sizeof(string), "~w~NICK: ~r~~h~%s________~w~SCORE: ~r~~h~%d________~w~ID: ~r~~h~%d",Nome(playerid), PlayerInfo[playerid][pLevel], playerid);
  1461. TextDrawSetString(Barra[4], string);
  1462. return 1;
  1463. }
  1464.  
  1465. forward GetPlayerDistanceToPoint(playerid,Float:x,Float:y);
  1466. public GetPlayerDistanceToPoint(playerid,Float:x,Float:y)
  1467. {
  1468. new Float:x1,Float:y1,Float:z1;
  1469. new Float:tmpdis;
  1470. GetPlayerPos(playerid,x1,y1,z1);
  1471. tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+floatpower(floatabs(floatsub(y,y1)),2));
  1472. return floatround(tmpdis);
  1473. }
  1474.  
  1475. forward GetClosestHospital(playerid);
  1476. public GetClosestHospital(playerid)
  1477. {
  1478. if(!IsPlayerConnected(playerid)) return -1;
  1479. new Float:prevdist = 100000.000;
  1480. new prevhosp;
  1481. for(new hospid = 0; hospid < 4; hospid++)
  1482. {
  1483. new Float:dist;
  1484. if(hospid == 0)
  1485. {
  1486. dist = GetPlayerDistanceToPoint(playerid,-2651.6501,634.1177);
  1487. }else if(hospid == 1){
  1488. dist = GetPlayerDistanceToPoint(playerid,1173.5842,-1324.5615);
  1489. }else if(hospid == 2){
  1490. dist = GetPlayerDistanceToPoint(playerid,2031.9415,-1404.3578);
  1491. }else if(hospid == 3){
  1492. dist = GetPlayerDistanceToPoint(playerid,1582.5615,1768.7921);
  1493. }
  1494.  
  1495. if((dist < prevdist))
  1496. {
  1497. prevdist = dist;
  1498. prevhosp = hospid;
  1499. }
  1500. }
  1501. return prevhosp;
  1502. }
  1503.  
  1504. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1505. {
  1506. new Float: X, Float: Y, Float: Z;
  1507. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1508. switch(dialogid)
  1509. {
  1510. case DIALOG_REGISTRO:
  1511. {
  1512. if(!response) return 1;
  1513. if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "REGISTRO LIFE VIRTUAL RPG", "\nPor favor digite uma senha com mais de 4 digitos:\n\n", "Ok", "Cancelar");
  1514.  
  1515. format(String, sizeof(String), "LV: Sua senha é {058AFF}[%s]{ffffff}.", inputtext);
  1516. Msg(playerid, -1, String);
  1517.  
  1518. new string[70];
  1519. format(string, sizeof(string), CONTAS, Nome(playerid));
  1520. DOF2_CreateFile(string);
  1521. DOF2_SetString(string, "Senha", inputtext);
  1522. DOF2_SaveFile();
  1523. DigitouSenha[playerid] = 1;
  1524. }
  1525.  
  1526. case DIALOG_EMAIL:
  1527. {
  1528. if(!response) return 1;
  1529. if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "EMAIL LIFE VIRTUAL RPG", "\nPor favor digite um email valido:\n\n", "Ok", "Cancelar");
  1530.  
  1531. format(String, sizeof(String), "LV: Seu email é {058AFF}[%s]{FFFFFF}.", inputtext);
  1532. Msg(playerid, -1, String);
  1533.  
  1534. new string[70];
  1535. format(string, sizeof(string), CONTAS, Nome(playerid));
  1536. DOF2_CreateFile(string);
  1537. DOF2_SetString(string, "Email", inputtext);
  1538. DOF2_SaveFile();
  1539. DigitouEmail[playerid] = 1;
  1540. }
  1541.  
  1542. case DIALOG_SEXO:
  1543. {
  1544. if(response) // Masculino
  1545. {
  1546. Msg(playerid, -1, "LV: Você selecionou sexo {058AFF}Masculino{ffffff}.");
  1547. PlayerInfo[playerid][pSexo] = 1;
  1548. PlayerInfo[playerid][pSkin] = 26;
  1549. DigitouSexo[playerid] = 1;
  1550.  
  1551. } else { // Feminino
  1552.  
  1553. Msg(playerid, -1, "LV: Você selecionou sexo {EE3B3B}Feminino{ffffff}.");
  1554. PlayerInfo[playerid][pSexo] = 2;
  1555. PlayerInfo[playerid][pSkin] = 56;
  1556. DigitouSexo[playerid] = 1;
  1557. }
  1558. }
  1559.  
  1560. case DIALOG_IDADE:
  1561. {
  1562. if(!response) return 1;
  1563. if(response)
  1564. {
  1565. if(strval(inputtext) < 5 || strval(inputtext) > 99) return ShowPlayerDialog(playerid, DIALOG_IDADE, DIALOG_STYLE_INPUT, "IDADE LIFE VIRTUAL RPG", "\nErro, sua idade deve ser de 5 a 99.\nPor favor, digite a idade corretamente.\n\n", "OK", "Cancelar");
  1566. format(String, sizeof(String), "LV: Você selecionou idade {058AFF}[%d]{ffffff} anos.", strval(inputtext));
  1567. Msg(playerid, -1, String);
  1568. PlayerInfo[playerid][pIdade] = strval(inputtext);
  1569. DigitouIdade[playerid] = 1;
  1570. }
  1571. }
  1572.  
  1573. case DIALOG_LOGIN:
  1574. {
  1575. if(!response) return 1;
  1576. new string[70];
  1577. format(string, sizeof(string), CONTAS, Nome(playerid));
  1578. if(!strcmp(inputtext, DOF2_GetString(string, "Senha"), false))
  1579. {
  1580. CarregarDados(playerid);
  1581.  
  1582. } else {
  1583.  
  1584. PlayerInfo[playerid][ErrouSenha] ++;
  1585. Msg(playerid, VERMELHO, "ERRO: Senha incorreta!");
  1586. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN LIFE VIRTUAL RPG:", "\n{FF0000}Senha Incorreta\n{FFFFFF}Digite sua senha abaixo para logar-se:\n\n", "Logar", "Voltar");
  1587.  
  1588. if(PlayerInfo[playerid][ErrouSenha] == 3)
  1589. {
  1590. Msg(playerid, VERMELHO, "ERRO: Você errou sua senha 3 vezes!");
  1591. SetTimerEx("Kickar", 100, false, "i", playerid);
  1592. }
  1593. }
  1594. }
  1595.  
  1596. case DIALOG_DADMIN:
  1597. {
  1598. if(response)
  1599. {
  1600. format(String, sizeof(String), "O Jogador {1B95E0}%s{00C2EC} é o mais novo admin do server!", Nome(playerid));
  1601. MsgAll(AZUL_CLARO, String);
  1602. WriteLog(LOG_ADM, String);
  1603. Msg(playerid, VERDE_CLARO, "Use /staff para ver seus comandos da Administração.");
  1604. PlayerInfo[playerid][pAdmin] = nivel;
  1605. }
  1606. if(!response)
  1607. {
  1608. format(String, sizeof(String), "O Jogador {1B95E0}%s{00C2EC} recusou ser admin do server!", Nome(playerid));
  1609. MsgAll(AZUL_CLARO, String);
  1610. }
  1611. }
  1612.  
  1613. case DIALOG_HELPER:
  1614. {
  1615. if(!response) return format(String, sizeof(String), "O Jogador {1B95E0}%s{00C2EC} recusou ser Helper do server.", Nome(playerid)), MsgAll(AZUL_CLARO, String);
  1616. format(String, sizeof(String), "O Jogador {1B95E0}%s{00C2EC} é o mais novo Helper do server", Nome(playerid));
  1617. MsgAll(AZUL_CLARO, String);
  1618. WriteLog(LOG_ADM, String);
  1619. Msg(playerid, VERDE_CLARO, "Use /staff para ver seus comandos de Helper.");
  1620. PlayerInfo[playerid][pHelper] = 1;
  1621. }
  1622.  
  1623. case DIALOG_ATIVAR_KEY:
  1624. {
  1625. if(!response) return 1;
  1626.  
  1627. new stringV[40];
  1628. format(stringV, sizeof stringV, VIP_KEYS, inputtext);
  1629. if(!DOF2_FileExists(stringV)) return Msg(playerid, VERMELHO, "ERRO: Codigo incorreto ou essa key não é válida !");
  1630. new Level = DOF2_GetInt(stringV, "LEVEIS");
  1631. SetarVip(playerid, Level);
  1632. DOF2_RemoveFile(stringV);
  1633. new stringLog[80];
  1634. format(stringLog, sizeof(stringLog), "O jogador %s ativou o codigo %s com %d leveis", Nome(playerid), inputtext, Level);
  1635. WriteLog(LOG_VIP, stringLog);
  1636. }
  1637.  
  1638. case DIALOG_NOVA_KEY:
  1639. {
  1640. if(!response) return 1;
  1641. format(vKey[playerid], 128, inputtext);
  1642. new Dialog[128];
  1643. format(Dialog, sizeof Dialog, "{FFFFFF}Seu novo codigo VIP: {DE3A3A}%s\n\n{FFFFFF}Agora nos informe a quantidade de leveis VIP:", vKey[playerid]);
  1644. ShowPlayerDialog(playerid, DIALOG_NOVAKEY_DIAS, DIALOG_STYLE_INPUT, "LV RPG KEYS VIP", Dialog, "Criar", "Cancelar");
  1645. }
  1646.  
  1647. case DIALOG_NOVAKEY_DIAS:
  1648. {
  1649. if(!IsNumeric(inputtext)) return Msg(playerid, VERMELHO, "ERRO: Digite uma quantidade de dias válidos.");
  1650. vDias[playerid] = strval(inputtext);
  1651. new Dialog[150];
  1652. format(Dialog, sizeof Dialog, "{FFFFFF}Informações de sua nova key:\n\nCódigo: {DE3A3A}%s\n{FFFFFF}Vencimento: {DE3A3A}%d dias\n\n{FFFFFF}Deseja criar ?", vKey[playerid], vDias[playerid]);
  1653. ShowPlayerDialog(playerid, DIALOG_KEY_CONFIRMAR, DIALOG_STYLE_MSGBOX, "LV RPG KEY VIP", Dialog, "Sim", "Não");
  1654. }
  1655.  
  1656. case DIALOG_KEY_CONFIRMAR:
  1657. {
  1658. if(!response) return 1;
  1659. CriarKey(playerid, vKey[playerid], vDias[playerid]);
  1660. }
  1661.  
  1662. case DIALOG_CRIAR_RADAR:
  1663. {
  1664. if(!response)
  1665. {
  1666. CriandoRadar = 0;
  1667. Msg(playerid, VERMELHO, "LV ADMIN: Criação de radar cancelada !");
  1668. return 1;
  1669. }
  1670. new Float:PosX, Float:PosY, Float:PosZ, Float:Angulo;
  1671. GetPlayerPos(playerid, PosX, PosY, PosZ);
  1672. GetPlayerFacingAngle(playerid, Angulo);
  1673.  
  1674. new string[30];
  1675. for(new i; i< MAX_RADAR; i++)
  1676. {
  1677. format(string, sizeof string, RADARES, i);
  1678. if(!DOF2_FileExists(string))
  1679. {
  1680. IDRadar[playerid] = i;
  1681. DOF2_CreateFile(string);
  1682. break;
  1683. }
  1684. }
  1685. RadarInfo[IDRadar[playerid]][rPosX] = PosX;
  1686. RadarInfo[IDRadar[playerid]][rPosY] = PosY;
  1687. RadarInfo[IDRadar[playerid]][rPosZ] = PosZ-1.5;
  1688. RadarInfo[IDRadar[playerid]][rAngulo] = Angulo;
  1689. RadarInfo[IDRadar[playerid]][rVelocidade] = VelocidadeRADAR;
  1690.  
  1691. ObjetoRadar[0][IDRadar[playerid]] = CreateDynamicObject(18880, RadarInfo[IDRadar[playerid]][rPosX], RadarInfo[IDRadar[playerid]][rPosY], RadarInfo[IDRadar[playerid]][rPosZ], 0.0, 0.0, RadarInfo[IDRadar[playerid]][rAngulo]);
  1692. ObjetoRadar[1][IDRadar[playerid]] = CreateDynamicObject(18880, RadarInfo[IDRadar[playerid]][rPosX], RadarInfo[IDRadar[playerid]][rPosY], RadarInfo[IDRadar[playerid]][rPosZ], 0.0, 0.0, RadarInfo[IDRadar[playerid]][rAngulo] + 180.0);
  1693.  
  1694. new StringRadar[40];
  1695. format(StringRadar, sizeof(StringRadar),"{FF0000}LV Radar ID: %d\n%d KM/H", IDRadar[playerid], RadarInfo[IDRadar[playerid]][rVelocidade]);
  1696. TRadar[IDRadar[playerid]] = Text3D:Create3DTextLabel(StringRadar, -1, RadarInfo[IDRadar[playerid]][rPosX], RadarInfo[IDRadar[playerid]][rPosY], RadarInfo[IDRadar[playerid]][rPosZ]+1, 100.0, 0);
  1697. IconeRadar[IDRadar[playerid]] = CreateDynamicMapIcon(RadarInfo[IDRadar[playerid]][rPosX], RadarInfo[IDRadar[playerid]][rPosY], RadarInfo[IDRadar[playerid]][rPosZ], 34, -1, -1, 0, -1, 100.0);
  1698.  
  1699. format(String, sizeof(String),"INFO: Radar ID: %d criado.",IDRadar[playerid]);
  1700. Msg(playerid, LARANJA, String);
  1701.  
  1702. SetPlayerPos(playerid, PosX+1,PosY+1,PosZ+1);
  1703. CriandoRadar = 0;
  1704. SalvarRadares();
  1705. }
  1706.  
  1707. case DIALOG_ABASTECER:
  1708. {
  1709. if(!response) return 1;
  1710. if(strval(inputtext) < 0 || strval(inputtext) > 100) return ShowPlayerDialog(playerid, DIALOG_ABASTECER, DIALOG_STYLE_INPUT, "~ ABASTECENDO ~", "{FF0000}ERRO\n\n{F8F8FF}Quantidade inválida.\nVocê pode abastecer até 100 litros.", "Abastecer", "Cancelar");
  1711. new Valor = strval(inputtext) * 3; // 3 reais o valor do litro
  1712. if(Valor > GetPlayerCash(playerid)) return Msg(playerid, VERMELHO, "ERRO: Saldo insuficiente, o valor do litro é de R$ 3.");
  1713. new vehicleid = GetPlayerVehicleID(playerid);
  1714. if(strval(inputtext) + GasolinaVeiculo[vehicleid] < 100)
  1715. {
  1716. GasolinaVeiculo[vehicleid] += strval(inputtext);
  1717. GivePlayerCash(playerid, - strval(inputtext) * 3);
  1718. format(String, sizeof(String), "LV: Foram abastecidos %d litros em seu veiculo.", strval(inputtext));
  1719. Msg(playerid, AZUL_CLARO, String);
  1720. return 1;
  1721. }
  1722.  
  1723. if(strval(inputtext) + GasolinaVeiculo[vehicleid])
  1724. {
  1725. new quantia = 100 - GasolinaVeiculo[vehicleid];
  1726. GasolinaVeiculo[vehicleid] = 100;
  1727. format(String, sizeof(String), "LV: Foram abastecidos %d litros em seu veiculo.", quantia);
  1728. Msg(playerid, AZUL_CLARO, String);
  1729. GivePlayerCash(playerid, - quantia);
  1730. return 1;
  1731. }
  1732. }
  1733.  
  1734. case DIALOG_GALAOABAST:
  1735. {
  1736. if(!response) return 1;
  1737. if(strval(inputtext) < 0 || strval(inputtext) > 20) return ShowPlayerDialog(playerid, DIALOG_ABASTECER, DIALOG_STYLE_INPUT, "~ ABASTECENDO ~", "{FF0000}ERRO\n\n{F8F8FF}Quantidade inválida.\nVocê pode abastecer até 20 litros no galão.", "Abastecer", "Cancelar");
  1738. if(strval(inputtext) + PlayerInfo[playerid][GalaoGasolina] > 20) return Msg(playerid, VERMELHO, "ERRO: A capacidade de seu galão é de apenas 20 litros, para ver /quantidadegalao.");
  1739. new Valor = strval(inputtext) * 3; // 3 reais o valor do litro
  1740. if(Valor > GetPlayerCash(playerid)) return Msg(playerid, VERMELHO, "ERRO: Saldo insuficiente, o valor do litro é de R$ 3.");
  1741. if(strval(inputtext) + PlayerInfo[playerid][GalaoGasolina] < 20)
  1742. {
  1743. PlayerInfo[playerid][GalaoGasolina] += strval(inputtext);
  1744. GivePlayerCash(playerid, - strval(inputtext) * 3);
  1745. format(String, sizeof(String), "LV: Foram abastecidos %d litros em seu galao de gasolina.", strval(inputtext));
  1746. Msg(playerid, AZUL_CLARO, String);
  1747. return 1;
  1748. }
  1749.  
  1750. if(strval(inputtext) + PlayerInfo[playerid][GalaoGasolina])
  1751. {
  1752. new quantia = 100 - PlayerInfo[playerid][GalaoGasolina];
  1753. PlayerInfo[playerid][GalaoGasolina] = 100;
  1754. format(String, sizeof(String), "LV: Foram abastecidos %d litros em seu galao de gasolina.", quantia);
  1755. Msg(playerid, AZUL_CLARO, String);
  1756. GivePlayerCash(playerid, - quantia);
  1757. return 1;
  1758. }
  1759. }
  1760. //banco
  1761. case DIALOG_SACAR:
  1762. {
  1763. if(!response) return 1;
  1764. if(strval(inputtext) > PlayerInfo[playerid][SaldoBancario]) return Msg(playerid, VERMELHO, "ERRO: Sua conta bancaria não possue essa quantia!");
  1765. PlayerInfo[playerid][SaldoBancario] -= strval(inputtext);
  1766. GivePlayerCash(playerid, strval(inputtext));
  1767.  
  1768. format(String, sizeof(String), "BANCO: Você sacou R$ %d da sua conta bancaria.", strval(inputtext));
  1769. Msg(playerid, ROSAB, String);
  1770. }
  1771.  
  1772. case DIALOG_DEPOSITAR:
  1773. {
  1774. if(!response) return 1;
  1775. if(strval(inputtext) > GetPlayerCash(playerid)) return Msg(playerid, VERMELHO, "ERRO: Você não possue essa quantia em mãos!");
  1776. PlayerInfo[playerid][SaldoBancario] += strval(inputtext);
  1777. GivePlayerCash(playerid, -strval(inputtext));
  1778.  
  1779. format(String, sizeof(String), "BANCO: Você depositou R$ %d em sua conta bancaria.", strval(inputtext));
  1780. Msg(playerid, ROSAB, String);
  1781. }
  1782.  
  1783. case DIALOG_TRANSF_ID:
  1784. {
  1785. if(!response) return 1;
  1786. if(!IsPlayerConnected(strval(inputtext))) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  1787.  
  1788. IDTransferir = strval(inputtext);
  1789. new Dialog[150];
  1790. format(Dialog, sizeof(Dialog), "\nVoce selecionou transferência para %s[%d].\nSe estiver correto digite o valor que deseja transferir:\n\n", Nome(IDTransferir), IDTransferir);
  1791. ShowPlayerDialog(playerid, DIALOG_TRANSF_RS, DIALOG_STYLE_INPUT, "BANCO SAN ANDREAS - TRANSFERÊNCIA", Dialog, "Ok", "Cancelar");
  1792. }
  1793.  
  1794. case DIALOG_TRANSF_RS:
  1795. {
  1796. if(!response) return 1;
  1797. if(strval(inputtext) > PlayerInfo[playerid][SaldoBancario]) return Msg(playerid, VERMELHO, "ERRO: Você não possue essa quantia em sua conta bancária!");
  1798. PlayerInfo[playerid][SaldoBancario] -= strval(inputtext);
  1799. PlayerInfo[IDTransferir][SaldoBancario] += strval(inputtext);
  1800.  
  1801. format(String, sizeof(String), "BANCO: Você transferiu R$ %d para conta de %s [%d].", strval(inputtext), Nome(IDTransferir), IDTransferir);
  1802. Msg(playerid, ROSAB, String);
  1803.  
  1804. new StringID[70];
  1805. format(StringID, sizeof(StringID), "BANCO: %s [%d] transferiu R$ %d para sua conta bancária.", Nome(IDTransferir), IDTransferir, strval(inputtext));
  1806. Msg(IDTransferir, ROSAB, StringID);
  1807. }
  1808.  
  1809. case DIALOG_EMPRESTIMO:
  1810. {
  1811. if(!response) return 1;
  1812. if(strval(inputtext) < 1000 || strval(inputtext) > 20000) return Msg(playerid, VERMELHO, "ERRO: Seu empréstimo pode ser de R$ 1000 até R$ 20000.");
  1813. PlayerInfo[playerid][SaldoBancario] += strval(inputtext);
  1814. PlayerInfo[playerid][FezEmprestimo] = 1;
  1815. PlayerInfo[playerid][Emprestimo] = strval(inputtext);
  1816.  
  1817. Msg(playerid, ROSAB, "BANCO: Seu empréstimo foi aprovado.");
  1818. format(String, sizeof(String), "BANCO: Você pegou um empréstimo de R$ %d.", strval(inputtext));
  1819. Msg(playerid, ROSAB, String);
  1820. }
  1821.  
  1822. case DIALOG_ADMIN:
  1823. {
  1824. if(response)
  1825. {
  1826. ShowHouseMenu(playerid);
  1827. TogglePlayerControllable(playerid, 1);
  1828. return 1;
  1829. }
  1830.  
  1831. if(!response)
  1832. {
  1833. ShowAdminMenu(playerid);
  1834. TogglePlayerControllable(playerid, 1);
  1835. return 1;
  1836. }
  1837. }
  1838. case DIALOG_GUEST:
  1839. {
  1840. if (!response)
  1841. return TogglePlayerControllable(playerid, 1);
  1842.  
  1843. new
  1844. house = GetProxHouse(playerid);
  1845.  
  1846. if(CasaInfo[house][houseStatus] == 1)
  1847. {
  1848. Msg(playerid, ROXOCLARO, "RV CASAS: Casa trancada!");
  1849.  
  1850. new logString[700];
  1851. format(logString, sizeof logString, "O jogador %s[%d], tentou entrar na casa %d, mais ela estava trancada.", playerName, playerid, house);
  1852. WriteLog(LOG_HOUSES, logString);
  1853. return 1;
  1854. }
  1855. else
  1856. {
  1857. if(IsPlayerInRangeOfPoint(playerid, 5.0, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]))
  1858. {
  1859. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  1860. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  1861. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  1862.  
  1863. new
  1864. logString[700];
  1865.  
  1866. format(logString, sizeof logString, "O jogador %s[%d], entrou na casa %d como visitante.", playerName, playerid, house);
  1867. WriteLog(LOG_HOUSES, logString);
  1868. }
  1869. }
  1870. }
  1871. case DIALOG_RENTING_GUEST:
  1872. {
  1873. if(!response)
  1874. return TogglePlayerControllable(playerid, 1);
  1875.  
  1876. new
  1877. house = GetProxHouse(playerid);
  1878.  
  1879. switch(listitem)
  1880. {
  1881. case 0:
  1882. {
  1883. if(CasaInfo[house][houseStatus] == 1)
  1884. {
  1885. Msg(playerid, ROXOCLARO, "RV CASAS: Casa trancada!");
  1886.  
  1887. new logString[256];
  1888. format(logString, sizeof logString, "O jogador %s[%d], tentou entrar na casa %d, mais ela estava trancada.", playerName, playerid, house);
  1889. WriteLog(LOG_HOUSES, logString);
  1890. return 1;
  1891. }
  1892.  
  1893. else
  1894. {
  1895. if(IsPlayerInRangeOfPoint(playerid, 5.0, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]))
  1896. {
  1897. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  1898. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  1899. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  1900.  
  1901. new
  1902. logString[128];
  1903.  
  1904. format(logString, sizeof logString, "O jogador %s[%d], entrou na casa %d como visitante.", playerName, playerid, house);
  1905. WriteLog(LOG_HOUSES, logString);
  1906. }
  1907. }
  1908. }
  1909. case 1:
  1910. {
  1911. new
  1912. ownerFile[200];
  1913.  
  1914. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName);
  1915.  
  1916. if(DOF2_FileExists(ownerFile))
  1917. {
  1918. new
  1919. alreadyOwner = DOF2_GetInt(ownerFile, "houseID"),
  1920. string[128];
  1921.  
  1922. GetPlayerPos(playerid, X, Y, Z);
  1923. PlayerPlaySound(playerid, 1085, X, Y, Z);
  1924.  
  1925. format(string, sizeof string, "ERRO: Você já é dono da casa %d! Não pode alugar uma casa.!", alreadyOwner);
  1926. Msg(playerid, VERMELHO, string);
  1927.  
  1928. TogglePlayerControllable(playerid, 1);
  1929. new
  1930. logString[700];
  1931.  
  1932. format(logString, sizeof logString, "O jogador %s[%d], tentou alugar a casa %d, mais ele já é dono da casa %d.", playerName, playerid, house, alreadyOwner);
  1933. WriteLog(LOG_HOUSES, logString);
  1934.  
  1935. return 1;
  1936. }
  1937.  
  1938. new
  1939. stringCat[600],
  1940. string[100],
  1941. string2[100],
  1942. string3[100];
  1943.  
  1944. GetPlayerName(playerIDOffer, playerName, MAX_PLAYER_NAME);
  1945. TogglePlayerControllable(playerIDOffer, 1);
  1946.  
  1947. format(string, sizeof string, "{00F2FC}Dono da casa a ser alugada: {46FE00}%s\n\n", CasaInfo[house][houseOwner]);
  1948. format(string2, sizeof string2, "{00F2FC}Valor a ser pago pelo aluguel da casa: {FFFFFF}$%d\n", CasaInfo[house][houseRentPrice]);
  1949. format(string3, sizeof string3, "{00F2FC}ID da casa a ser alugada: {FFFFFF}%d\n", house);
  1950.  
  1951. strcat(stringCat, "{00F2FC}Após alugar a casa, o aluguel será cobrado todo dia 00:00! Se você não estiver online\n");
  1952. strcat(stringCat, "o aluguel será cobrado quando você entrar novamente no servidor.\n\n");
  1953. strcat(stringCat, string);
  1954. strcat(stringCat, string2);
  1955. strcat(stringCat, string3);
  1956. strcat(stringCat, "{FD0900}ATENÇÃO: A casa dita acima vai ser alugada por você e você poderá trancar e destrancar a casa, tanto como nascerá nela.\nVocê também vai poder trancar e destrancar o carro caso ela tiver, caso não tiver você pode ajudar o dono a comprar um\npagando seu aluguel regurlamente.\n");
  1957. strcat(stringCat, "Você deseja alugar a casa, baseada nas informações acima descritas?\n");
  1958.  
  1959. ShowPlayerDialog(playerid, DIALOG_RENT_CONFIRM, DIALOG_STYLE_MSGBOX, "Venda de casa", stringCat, "Alugar", "Negar");
  1960. TogglePlayerControllable(playerid, 1);
  1961. }
  1962. }
  1963. }
  1964. case DIALOG_UNRENT_CONFIRM:
  1965. {
  1966. if (!response)
  1967. return Msg(playerid, -1, "Você optou por não desalugar a casa.");
  1968. new
  1969. tenantFile[200],
  1970. houseFile[200],
  1971. house = GetProxHouse(playerid),
  1972. logString[128];
  1973.  
  1974. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", CasaInfo[house][houseTenant]);
  1975. format(houseFile, sizeof houseFile, "Casas/Casas/Casa %d.ini", house);
  1976. format(CasaInfo[house][houseTenant], 24, "Ninguem");
  1977.  
  1978. DOF2_RemoveFile(tenantFile);
  1979. DOF2_SetString(houseFile, "Locador", "Ninguem", "Aluguel");
  1980.  
  1981. TogglePlayerControllable(playerid, 1);
  1982. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1983.  
  1984. format(logString, sizeof logString, "O jogador %s[%d], desalugou a casa %d.", playerName, playerid, house);
  1985. WriteLog(LOG_HOUSES, logString);
  1986.  
  1987. return 1;
  1988. }
  1989. case DIALOG_RENT_CONFIRM:
  1990. {
  1991. if(!response)
  1992. return 1;
  1993.  
  1994. new
  1995. house = GetProxHouse(playerid),
  1996. tenantFile[200],
  1997. houseFile[200],
  1998. logString[128];
  1999.  
  2000. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2001.  
  2002. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", playerName);
  2003. format(houseFile, sizeof houseFile, "Casas/Casas/Casa %d.ini", house);
  2004.  
  2005. if(DOF2_FileExists(tenantFile))
  2006. {
  2007. new
  2008. alreadyTenant = DOF2_GetInt(tenantFile, "houseID"),
  2009. string[128];
  2010.  
  2011. GetPlayerPos(playerid, X, Y, Z);
  2012. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2013.  
  2014. format(string, sizeof string, "ERRO: Você já é locador da casa %d! Você só pode ter 1 casa alugada!", alreadyTenant);
  2015. Msg(playerid, VERMELHO, string);
  2016.  
  2017. TogglePlayerControllable(playerid, 1);
  2018.  
  2019. format(logString, sizeof logString, "O jogador %s[%d], tentou alugar a casa %d, mas ele já é locador da casa %d.", playerName, playerid, house, alreadyTenant);
  2020. WriteLog(LOG_HOUSES, logString);
  2021. return 1;
  2022. }
  2023.  
  2024. format(CasaInfo[house][houseTenant], 24, playerName);
  2025.  
  2026. DOF2_CreateFile(tenantFile);
  2027. DOF2_SetInt(tenantFile, "houseID", house);
  2028. DOF2_SetString(houseFile, "Locador", CasaInfo[house][houseTenant], "Aluguel");
  2029.  
  2030. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  2031. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  2032. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  2033.  
  2034. DOF2_SaveFile();
  2035. Update3DText(house);
  2036.  
  2037. format(logString, sizeof logString, "O jogador %s[%d], alugou a casa %d.", playerName, playerid, house);
  2038. WriteLog(LOG_HOUSES, logString);
  2039. }
  2040.  
  2041. case DIALOG_EDITAR_CASA:
  2042. {
  2043. if(!response)
  2044. return TogglePlayerControllable(playerid, 1);
  2045.  
  2046. new
  2047. house = GetProxHouse(playerid);
  2048.  
  2049. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2050.  
  2051. switch(listitem)
  2052. {
  2053. case 0:
  2054. {
  2055. if(IsPlayerInRangeOfPoint(playerid, 5.0, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]))
  2056. {
  2057. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  2058. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  2059. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  2060.  
  2061. new
  2062. logString[128];
  2063.  
  2064. format(logString, sizeof logString, "O administrador %s[%d], entrou na casa %d como administrador.", playerName, playerid, house);
  2065. WriteLog(LOG_HOUSES, logString);
  2066. WriteLog(LOG_ADMIN, logString);
  2067. }
  2068. }
  2069. case 1:
  2070. {
  2071. if(strcmp(CasaInfo[house][houseOwner], "Ninguem", true))
  2072. {
  2073. GetPlayerPos(playerid, X, Y, Z);
  2074. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2075.  
  2076. Msg(playerid, VERMELHO, "ERRO: Não é possível alterar o preço de uma casa que não está a venda.");
  2077.  
  2078. new
  2079. logString[128];
  2080.  
  2081. format(logString, sizeof logString, "O administrador %s[%d], tentou alterar o preço da casa %d, mas ela não está a venda.", playerName, playerid, house);
  2082. WriteLog(LOG_ADMIN, logString);
  2083.  
  2084. ShowAdminMenu(playerid);
  2085. return 1;
  2086. }
  2087.  
  2088. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA_PRECO, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o preço da casa.", "{FFFFFF}Digite o novo preço que você quer abaixo\n{FFFFFF}Use somente números.\n", "Alterar", "Voltar");
  2089. TogglePlayerControllable(playerid, 1);
  2090. }
  2091. case 2:
  2092. {
  2093. if(CasaInfo[house][houseRentable] == 0)
  2094. {
  2095. GetPlayerPos(playerid, X, Y, Z);
  2096. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2097.  
  2098. Msg(playerid, VERMELHO, "ERRO: Não é possível alterar o preço do aluguel de uma casa que não está sendo alugada.");
  2099.  
  2100. new
  2101. logString[700];
  2102.  
  2103. format(logString, sizeof logString, "O administrador %s[%d], tentou alterar o preço de aluguel da casa %d, mas ela não está sendo alugada.", playerName, playerid, house);
  2104. WriteLog(LOG_ADMIN, logString);
  2105.  
  2106. ShowAdminMenu(playerid);
  2107. return 1;
  2108. }
  2109.  
  2110. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA_ALU_PRECO, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o preço do aluguel.", "{FFFFFF}Digite o novo preço que você quer abaixo\n{FFFFFF}Use somente números.\n", "Alterar", "Voltar");
  2111. TogglePlayerControllable(playerid, 1);
  2112. }
  2113. case 3:
  2114. {
  2115. new
  2116. stringCat[1200];
  2117.  
  2118. strcat(stringCat, "Interior {FB1300}1 \t{FCEC00}6 {FFFFFF}Comodos\n");
  2119. strcat(stringCat, "Interior {FB1300}2 \t{FCEC00}3 {FFFFFF}Comodos\n");
  2120. strcat(stringCat, "Interior {FB1300}3 \t{FCEC00}3 {FFFFFF}Comodos\n");
  2121. strcat(stringCat, "Interior {FB1300}4 \t{FCEC00}1 {FFFFFF}Comodo\n");
  2122. strcat(stringCat, "Interior {FB1300}5 \t{FCEC00}1 {FFFFFF}Comodo\n");
  2123. strcat(stringCat, "Interior {FB1300}6 \t{FCEC00}3 {FFFFFF}Comodos \t{FFFFFF}(Casa do CJ)\n");
  2124. strcat(stringCat, "Interior {FB1300}7 \t{FCEC00}5 {FFFFFF}Comodos\n");
  2125. strcat(stringCat, "Interior {FB1300}8 \t{FCEC00}7 {FFFFFF}Comodos\n");
  2126. strcat(stringCat, "Interior {FB1300}9 \t{FCEC00}4 {FFFFFF}Comodos\n");
  2127. strcat(stringCat, "Interior {FB1300}10 \t{FCEC00}Muitos {FFFFFF}Comodos \t{FFFFFF} (Casa do Madd Dog)\n");
  2128. strcat(stringCat, "Interior {FB1300}11 \t{FCEC00}7 {FFFFFF}Comodos\n");
  2129.  
  2130. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA_INT, DIALOG_STYLE_LIST,"{00F2FC}Você escolheu alterar o interior da casa.", stringCat, "Continuar", "Voltar");
  2131. TogglePlayerControllable(playerid, 1);
  2132. }
  2133. case 4:
  2134. {
  2135. ShowPlayerDialog(playerid, DIALOG_CASA_STATUS, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu mudar o status dessa casa.", "{FFFFFF}Oque você gostaria de fazer com o status atual da casa?\n", "Trancar", "Destrancar");
  2136. TogglePlayerControllable(playerid, 1);
  2137. }
  2138. case 5:
  2139. {
  2140. new
  2141. stringMessage[128];
  2142.  
  2143. if (strlen(CasaInfo[house][houseTitle]) > 0)
  2144. {
  2145. format(stringMessage, sizeof stringMessage, "{FFFFFF}Digite o novo título da casa.\n\nTítulo anterior: %s\n", CasaInfo[house][houseTitle]);
  2146. ShowPlayerDialog(playerid, DIALOG_HOUSE_TITLE_ADMIN, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu mudar o título da casa.", stringMessage, "Alterar", "Voltar");
  2147. }
  2148. else
  2149. ShowPlayerDialog(playerid, DIALOG_HOUSE_TITLE_ADMIN, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu mudar o título da casa.", "{FFFFFF}Digite o novo título da casa.\n\nTítulo anterior: {FFFFFF}Título ainda não definido\n", "Alterar", "Voltar");
  2150.  
  2151. TogglePlayerControllable(playerid, 1);
  2152. }
  2153. case 6:
  2154. {
  2155. ShowPlayerDialog(playerid, DIALOG_CHANGE_OWNER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o dono da casa.", "{FFFFFF}Digite o {FFFFFF}ID {FFFFFF}ou {FFFFFF}nickname {FFFFFF}do novo dono", "Continuar", "Voltar");
  2156. TogglePlayerControllable(playerid, 1);
  2157. }
  2158. case 7:
  2159. {
  2160. if(!strcmp(CasaInfo[house][houseOwner], "Ninguem", true))
  2161. {
  2162. GetPlayerPos(playerid, X, Y, Z);
  2163. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2164.  
  2165. Msg(playerid, VERMELHO, "ERRO: Não é possível vender uma casa que já está a venda.");
  2166. ShowAdminMenu(playerid);
  2167.  
  2168. new
  2169. logString[128];
  2170.  
  2171. format(logString, sizeof logString, "O administrador %s[%d], tentou vender a casa %d, mas ela já está à venda.", playerName, playerid, house);
  2172. WriteLog(LOG_ADMIN, logString);
  2173.  
  2174. return 1;
  2175. }
  2176.  
  2177. ShowPlayerDialog(playerid, DIALOG_VENDER_CASA_ADMIN, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu botar essa casa a venda", "{FFFFFF}Você tem certeza que deseja botar essa casa a venda?", "Sim", "Não");
  2178. TogglePlayerControllable(playerid, 1);
  2179. }
  2180. case 8:
  2181. {
  2182. ShowPlayerDialog(playerid, DIALOG_DELETE_HOUSE, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu deletar casa.", "{FFFFFF}Se a casa ter dono, ele não vai ter o dinheiro que gastou na casa novamente.\n{FFFFFF}Você confirma essa ação?", "Deletar", "Voltar");
  2183. TogglePlayerControllable(playerid, 1);
  2184. }
  2185. }
  2186. }
  2187. case DIALOG_VENDER_CASA_ADMIN:
  2188. {
  2189. if(!response)
  2190. return ShowAdminMenu(playerid);
  2191.  
  2192. new
  2193. house = GetProxHouse(playerid),
  2194. filePath[200],
  2195. ownerFile[200],
  2196. tenantFile[200];
  2197.  
  2198. format(filePath, sizeof filePath, "Casas/Casas/Casa %d.ini", house);
  2199. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", CasaInfo[house][houseTenant]);
  2200. GetPlayerName(CasaInfo[house][houseOwner], playerName, MAX_PLAYER_NAME);
  2201. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName);
  2202.  
  2203. if(DOF2_FileExists(ownerFile))
  2204. return DOF2_RemoveFile(ownerFile);
  2205.  
  2206. if(DOF2_FileExists(tenantFile))
  2207. return DOF2_RemoveFile(tenantFile);
  2208.  
  2209. format(CasaInfo[house][houseOwner], 255, "Ninguem");
  2210. format(CasaInfo[house][houseTenant], 255, "Ninguem");
  2211.  
  2212. DOF2_SetString(filePath, "Dono", "Ninguem", "Informações");
  2213. DOF2_SetString(filePath, "Locador", "Ninguem", "Aluguel");
  2214. DOF2_RemoveFile(ownerFile);
  2215. DOF2_SaveFile();
  2216.  
  2217. DestroyDynamicPickup(housePickupIn[house]);
  2218. DestroyDynamicMapIcon(houseMapIcon[house]);
  2219.  
  2220. Update3DText(house);
  2221. Msg(playerid, ROXOCLARO, "LV CASAS: Casa vendida!");
  2222.  
  2223. new
  2224. logString[128];
  2225.  
  2226. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2227.  
  2228. format(logString, sizeof logString, "O administrador %s[%d], botou a casa %d, à venda.", playerName, playerid, house);
  2229. WriteLog(LOG_ADMIN, logString);
  2230.  
  2231. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 31, -1, -1, 0, -1, 100.0);
  2232. housePickupIn[house] = CreateDynamicPickup(1273, 23, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  2233. }
  2234. case DIALOG_CHANGE_OWNER:
  2235. {
  2236. if(!response)
  2237. return ShowAdminMenu(playerid);
  2238.  
  2239. GetPlayerPos(playerid, X, Y, Z);
  2240.  
  2241. if(sscanf(inputtext, "u", newOwnerID))
  2242. {
  2243. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2244. Msg(playerid, VERMELHO, "ERRO: ID ou nome inválido!");
  2245. ShowPlayerDialog(playerid, DIALOG_CHANGE_OWNER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o dono da casa.", "{FFFFFF}Digite o {FFFFFF}ID {FFFFFF}ou {FFFFFF}nickname {FFFFFF}do novo dono", "Continuar", "Cancelar");
  2246. return 1;
  2247. }
  2248.  
  2249. if(!IsPlayerConnected(newOwnerID) || newOwnerID == INVALID_PLAYER_ID)
  2250. {
  2251. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2252. Msg(playerid, VERMELHO, "ERRO: Player desconectado!");
  2253. ShowPlayerDialog(playerid, DIALOG_CHANGE_OWNER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o dono da casa.", "{FFFFFF}Digite o {FFFFFF}ID {FFFFFF}ou {FFFFFF}nickname {FFFFFF}do novo dono", "Continuar", "Cancelar");
  2254. return 1;
  2255. }
  2256.  
  2257. new ownerFile[200];
  2258.  
  2259. GetPlayerName(newOwnerID, playerName, MAX_PLAYER_NAME);
  2260. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName);
  2261.  
  2262. if(DOF2_FileExists(ownerFile))
  2263. {
  2264. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2265. Msg(playerid, VERMELHO, "ERRO: Esse jogador já tem uma casa!");
  2266. ShowPlayerDialog(playerid, DIALOG_CHANGE_OWNER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o dono da casa.", "{FFFFFF}Digite o {FFFFFF}ID {FFFFFF}ou {FFFFFF}nickname {FFFFFF}do novo dono", "Continuar", "Cancelar");
  2267. return 1;
  2268. }
  2269.  
  2270. new
  2271. dialogString[200],
  2272. house;
  2273.  
  2274. house = GetProxHouse(playerid);
  2275. GetPlayerName(newOwnerID, playerName, MAX_PLAYER_NAME);
  2276.  
  2277. format(dialogString, sizeof dialogString, "{00F2FC}Dono Atual: {46FE00}%s\n{00F2FC}Novo Dono: {46FE00}%s\n\n{FFFFFF}Você confirma está ação?", CasaInfo[house][houseOwner], playerName);
  2278. ShowPlayerDialog(playerid, DIALOG_CHANGE_OWNER2, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu alterar o dono da casa.", dialogString, "Sim", "Não");
  2279. }
  2280.  
  2281. case DIALOG_CHANGE_OWNER2:
  2282. {
  2283. if(!response)
  2284. return ShowAdminMenu(playerid);
  2285.  
  2286. new
  2287. house = GetProxHouse(playerid),
  2288. filePath[200],
  2289. playerName2[MAX_PLAYER_NAME],
  2290. playerName3[MAX_PLAYER_NAME],
  2291. logString[128],
  2292. ownerFile[200],
  2293. newOwnerFile[200];
  2294.  
  2295. GetPlayerName(newOwnerID, playerName, MAX_PLAYER_NAME);
  2296. GetPlayerName(CasaInfo[house][houseOwner], playerName2, MAX_PLAYER_NAME);
  2297. GetPlayerName(playerid, playerName3, MAX_PLAYER_NAME);
  2298.  
  2299. format(filePath, sizeof filePath, "Casas/Casas/Casa %d.ini", house);
  2300. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName2);
  2301. format(newOwnerFile, sizeof newOwnerFile, "Casas/Donos/%s.ini", playerName);
  2302.  
  2303. if (!strcmp(playerName2, "Ninguem", true))
  2304. {
  2305. DOF2_CreateFile(newOwnerFile);
  2306. DOF2_SetInt(newOwnerFile, "houseID", house);
  2307. DOF2_SetString(filePath, "Dono", playerName, "Informações");
  2308. DOF2_SaveFile();
  2309.  
  2310. format(CasaInfo[house][houseOwner], 24, playerName);
  2311. CasaInfo[house][houseStatus] = DOF2_SetInt(filePath,"Status", 0, "Informações");
  2312.  
  2313. DestroyDynamicPickup(housePickupIn[house]);
  2314. DestroyDynamicMapIcon(houseMapIcon[house]);
  2315. housePickupIn[house] = CreateDynamicPickup(1272, 23, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  2316. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 32, -1, -1, 0, -1, 100.0);
  2317.  
  2318. Update3DText(house);
  2319. return 1;
  2320. }
  2321.  
  2322. format(logString, sizeof logString, "O administrador %s[%d], alterou o dono da casa %d, de %s para %s.", playerName3, playerid, house, playerName2, playerName);
  2323. WriteLog(LOG_ADMIN, logString);
  2324.  
  2325. DOF2_RenameFile(ownerFile, newOwnerFile);
  2326. DOF2_RemoveFile(ownerFile);
  2327. DOF2_SetString(filePath, "Dono", playerName);
  2328. DOF2_SaveFile();
  2329.  
  2330. format(CasaInfo[house][houseOwner], 255, playerName);
  2331.  
  2332. Update3DText(house);
  2333.  
  2334. Msg(playerid, -1, "{00F2FC}Feito!");
  2335. return 1;
  2336. }
  2337.  
  2338. case DIALOG_DELETE_HOUSE:
  2339. {
  2340. if(!response)
  2341. return ShowAdminMenu(playerid);
  2342.  
  2343. new
  2344. house = GetProxHouse(playerid),
  2345. filePath[150],
  2346. houseAtual[200],
  2347. checkID[200],
  2348. logString[128],
  2349. ownerFile[200],
  2350. tenantFile[200],
  2351. playerName2[MAX_PLAYER_NAME],
  2352. playerName3[MAX_PLAYER_NAME];
  2353.  
  2354. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2355. GetPlayerName(CasaInfo[house][houseOwner], playerName2, MAX_PLAYER_NAME);
  2356. GetPlayerName(CasaInfo[house][houseTenant], playerName3, MAX_PLAYER_NAME);
  2357.  
  2358. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", playerName3);
  2359. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName2);
  2360. format(logString, sizeof logString, "O administrador %s[%d], deletou a casa %d.", playerName, playerid, house);
  2361.  
  2362. WriteLog(LOG_ADMIN, logString);
  2363.  
  2364. if(DOF2_FileExists(ownerFile))
  2365. return DOF2_RemoveFile(ownerFile);
  2366.  
  2367. if(DOF2_FileExists(tenantFile))
  2368. return DOF2_RemoveFile(tenantFile);
  2369.  
  2370. DestroyDynamicPickup(housePickupIn[house]);
  2371. DestroyDynamicMapIcon(houseMapIcon[house]);
  2372. DestroyDynamic3DTextLabel(houseLabel[house]);
  2373.  
  2374. DOF2_RemoveFile(filePath);
  2375. Msg(playerid, ROXOCLARO, "LV CASAS: Casa deletada!");
  2376. format(houseAtual, sizeof houseAtual, "Casas/CasaAtual.ini");
  2377.  
  2378. for(new i = 1; i < MAX_CASAS; i++)
  2379. {
  2380. format(checkID, sizeof checkID, "Casas/Casas/Casa %d.ini", i);
  2381. if(!DOF2_FileExists(checkID))
  2382. {
  2383. DOF2_SetInt(houseAtual, "IDAtual", i);
  2384. break;
  2385. }
  2386. }
  2387.  
  2388. DOF2_SaveFile();
  2389. return 1;
  2390. }
  2391. case DIALOG_EDITAR_CASA_PRECO:
  2392. {
  2393. if(!response)
  2394. return ShowAdminMenu(playerid);
  2395.  
  2396. GetPlayerPos(playerid, X, Y, Z);
  2397.  
  2398. if(!IsNumeric(inputtext))
  2399. {
  2400. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2401. Msg(playerid, VERMELHO, "ERRO: Digite apenas números!");
  2402. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA_ALU_PRECO, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o preço do aluguel.", "{FFFFFF}Digite o novo preço que você quer abaixo\n{FFFFFF}Use somente números.\n", "Alterar", "Cancelar");
  2403. return 1;
  2404. }
  2405.  
  2406. if(!strlen(inputtext))
  2407. {
  2408. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2409. Msg(playerid, VERMELHO, "ERRO: Digite algo no campo ou cancele!");
  2410. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA_ALU_PRECO, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o preço do aluguel.", "{FFFFFF}Digite o novo preço que você quer abaixo\n{FFFFFF}Use somente números.\n", "Alterar", "Cancelar");
  2411. return 1;
  2412. }
  2413.  
  2414. new
  2415. house = GetProxHouse(playerid),
  2416. file[100],
  2417. logString[128];
  2418.  
  2419. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  2420.  
  2421. CasaInfo[house][housePrice] = strval(inputtext);
  2422. DOF2_SetInt(file, "Preço", CasaInfo[house][housePrice], "Informações");
  2423. DOF2_SaveFile();
  2424.  
  2425. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2426.  
  2427. format(logString, sizeof logString, "O administrador %s[%d], alterou o preço da casa %d.", playerName, playerid, house);
  2428. WriteLog(LOG_ADMIN, logString);
  2429. Update3DText(house);
  2430. }
  2431.  
  2432. case DIALOG_HOUSE_TITLE_ADMIN:
  2433. {
  2434. if(!response)
  2435. return ShowAdminMenu(playerid);
  2436.  
  2437. new
  2438. house = GetProxHouse(playerid);
  2439.  
  2440. if (!strlen(inputtext) && strlen(CasaInfo[house][houseTitle]) > 0)
  2441. {
  2442. Msg(playerid, -1, "Você removeu o título da casa.");
  2443. format(CasaInfo[house][houseTitle], 32, "%s", inputtext);
  2444. Update3DText(house);
  2445. return 1;
  2446. }
  2447.  
  2448. else if (!strlen(inputtext) && strlen(CasaInfo[house][houseTitle]) == 0)
  2449. {
  2450. Msg(playerid, -1, "A casa ainda não tem um título, portanto não é possível remove-lo.");
  2451. ShowPlayerDialog(playerid, DIALOG_HOUSE_TITLE_ADMIN, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu mudar o título dessa casa.", "{FFFFFF}Digite o novo título da casa.\n\nTítulo anterior: {FFFFFF}SEM TÍTULO\n", "Alterar", "Voltar");
  2452. return 1;
  2453. }
  2454.  
  2455. format(CasaInfo[house][houseTitle], 32, "%s", inputtext);
  2456. Update3DText(house);
  2457.  
  2458. new
  2459. file[100],
  2460. logString[160];
  2461.  
  2462. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  2463.  
  2464. DOF2_SetString(file, "Título", CasaInfo[house][houseTitle], "Informações");
  2465. DOF2_SaveFile();
  2466.  
  2467. Msg(playerid, -1, "Título alterado com sucesso.");
  2468.  
  2469. format(logString, sizeof logString, "O jogador/administrador %s[%d], alterou o título da casa %d para %s.", playerName, playerid, house, CasaInfo[house][houseTitle]);
  2470. WriteLog(LOG_ADMIN, logString);
  2471. WriteLog(LOG_HOUSES, logString);
  2472. }
  2473.  
  2474. case DIALOG_HOUSE_TITLE:
  2475. {
  2476. if(!response)
  2477. return ShowHouseMenu(playerid);
  2478.  
  2479. new
  2480. house = GetProxHouse(playerid);
  2481.  
  2482. if (!strlen(inputtext) && strlen(CasaInfo[house][houseTitle]) > 0)
  2483. {
  2484. Msg(playerid, -1, "Você removeu o título da casa.");
  2485. format(CasaInfo[house][houseTitle], 32, "%s", inputtext);
  2486. Update3DText(house);
  2487. return 1;
  2488. }
  2489.  
  2490. else if (!strlen(inputtext) && strlen(CasaInfo[house][houseTitle]) == 0)
  2491. {
  2492. Msg(playerid, -1, "A casa ainda não tem um título, portanto não é possível remove-lo.");
  2493. ShowPlayerDialog(playerid, DIALOG_HOUSE_TITLE_ADMIN, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu mudar o título dessa casa.", "{FFFFFF}Digite o novo título da casa.\n\nTítulo anterior: {FFFFFF}SEM TÍTULO\n", "Alterar", "Voltar");
  2494. return 1;
  2495. }
  2496.  
  2497. format(CasaInfo[house][houseTitle], 32, "%s", inputtext);
  2498. Update3DText(house);
  2499.  
  2500. new
  2501. file[100],
  2502. logString[160];
  2503.  
  2504. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  2505.  
  2506. DOF2_SetString(file, "Título", CasaInfo[house][houseTitle], "Informações");
  2507. DOF2_SaveFile();
  2508.  
  2509. Msg(playerid, -1, "Título alterado com sucesso.");
  2510.  
  2511. format(logString, sizeof logString, "O jogador/administrador %s[%d], alterou o título da casa %d para %s.", playerName, playerid, house, CasaInfo[house][houseTitle]);
  2512. WriteLog(LOG_ADMIN, logString);
  2513. WriteLog(LOG_HOUSES, logString);
  2514. }
  2515.  
  2516. case DIALOG_EDITAR_CASA_ALU_PRECO:
  2517. {
  2518. if(!response)
  2519. return ShowAdminMenu(playerid);
  2520.  
  2521. GetPlayerPos(playerid, X, Y, Z);
  2522.  
  2523. if(!IsNumeric(inputtext))
  2524. {
  2525. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2526. Msg(playerid, VERMELHO, "ERRO: Digite apenas números!");
  2527. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA_PRECO, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o preço da casa.", "{FFFFFF}Digite o novo preço que você quer abaixo\n{FFFFFF}Use somente números.\n", "Alterar", "Cancelar");
  2528. return 1;
  2529. }
  2530.  
  2531. if(!strlen(inputtext))
  2532. {
  2533. GetPlayerPos(playerid, X, Y, Z);
  2534. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2535. Msg(playerid, VERMELHO, "ERRO: Digite algo no campo ou cancele!");
  2536. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA_PRECO, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu alterar o preço da casa.", "{FFFFFF}Digite o novo preço que você quer abaixo\n{FFFFFF}Use somente números.\n", "Alterar", "Cancelar");
  2537. return 1;
  2538. }
  2539.  
  2540. new
  2541. house = GetProxHouse(playerid),
  2542. file[100],
  2543. logString[128];
  2544.  
  2545. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  2546.  
  2547. CasaInfo[house][houseRentPrice] = strval(inputtext);
  2548. DOF2_SetInt(file, "Preço do Aluguel", CasaInfo[house][houseRentPrice], "Informações");
  2549. DOF2_SaveFile();
  2550.  
  2551. format(logString, sizeof logString, "O administrador %s[%d], alterou o preço de aluguel da casa %d.", playerName, playerid, house);
  2552. WriteLog(LOG_ADMIN, logString);
  2553.  
  2554. Update3DText(house);
  2555. }
  2556.  
  2557. case DIALOG_EDITAR_CASA_INT:
  2558. {
  2559. if(!response)
  2560. return ShowAdminMenu(playerid);
  2561.  
  2562. switch(listitem)
  2563. {
  2564. case 0:
  2565. {
  2566. houseInteriorX[playerid] = 2196.84;
  2567. houseInteriorY[playerid] = -1204.36;
  2568. houseInteriorZ[playerid] = 1049.02;
  2569. houseInteriorFA[playerid] = 94.0010;
  2570. houseInteriorInt[playerid] = 6;
  2571. }
  2572. case 1:
  2573. {
  2574. houseInteriorX[playerid] = 2259.38;
  2575. houseInteriorY[playerid] = -1135.89;
  2576. houseInteriorZ[playerid] = 1050.64;
  2577. houseInteriorFA[playerid] = 275.3992;
  2578. houseInteriorInt[playerid] = 10;
  2579. }
  2580. case 2:
  2581. {
  2582. houseInteriorX[playerid] = 2282.99;
  2583. houseInteriorY[playerid] = -1140.28;
  2584. houseInteriorZ[playerid] = 1050.89;
  2585. houseInteriorFA[playerid] = 358.4660;
  2586. houseInteriorInt[playerid] = 11;
  2587. }
  2588. case 3:
  2589. {
  2590. houseInteriorX[playerid] = 2233.69;
  2591. houseInteriorY[playerid] = -1115.26;
  2592. houseInteriorZ[playerid] = 1050.88;
  2593. houseInteriorFA[playerid] = 358.4660;
  2594. houseInteriorInt[playerid] = 5;
  2595. }
  2596. case 4:
  2597. {
  2598. houseInteriorX[playerid] = 2218.39;
  2599. houseInteriorY[playerid] = -1076.21;
  2600. houseInteriorZ[playerid] = 1050.48;
  2601. houseInteriorFA[playerid] = 95.2635;
  2602. houseInteriorInt[playerid] = 1;
  2603. }
  2604. case 5:
  2605. {
  2606. houseInteriorX[playerid] = 2496.00;
  2607. houseInteriorY[playerid] = -1692.08;
  2608. houseInteriorZ[playerid] = 1014.74;
  2609. houseInteriorFA[playerid] = 177.8159;
  2610. houseInteriorInt[playerid] = 3;
  2611. }
  2612. case 6:
  2613. {
  2614. houseInteriorX[playerid] = 2365.25;
  2615. houseInteriorY[playerid] = -1135.58;
  2616. houseInteriorZ[playerid] = 1050.88;
  2617. houseInteriorFA[playerid] = 359.0367;
  2618. houseInteriorInt[playerid] = 8;
  2619. }
  2620. case 7:
  2621. {
  2622. houseInteriorX[playerid] = 2317.77;
  2623. houseInteriorY[playerid] = -1026.76;
  2624. houseInteriorZ[playerid] = 1050.21;
  2625. houseInteriorFA[playerid] = 359.0367;
  2626. houseInteriorInt[playerid] = 9;
  2627. }
  2628. case 8:
  2629. {
  2630. houseInteriorX[playerid] = 2324.41;
  2631. houseInteriorY[playerid] = -1149.54;
  2632. houseInteriorZ[playerid] = 1050.71;
  2633. houseInteriorFA[playerid] = 359.0367;
  2634. houseInteriorInt[playerid] = 12;
  2635. }
  2636. case 9:
  2637. {
  2638. houseInteriorX[playerid] = 1260.6603;
  2639. houseInteriorY[playerid] = -785.4005;
  2640. houseInteriorZ[playerid] = 1091.9063;
  2641. houseInteriorFA[playerid] = 270.9891;
  2642. houseInteriorInt[playerid] = 5;
  2643. }
  2644. case 10:
  2645. {
  2646. houseInteriorX[playerid] = 140.28;
  2647. houseInteriorY[playerid] = 1365.92;
  2648. houseInteriorZ[playerid] = 1083.85;
  2649. houseInteriorFA[playerid] = 9.6901;
  2650. houseInteriorInt[playerid] = 5;
  2651. }
  2652. }
  2653.  
  2654. new house = GetProxHouse(playerid),
  2655. file[100];
  2656.  
  2657. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  2658.  
  2659. CasaInfo[house][houseIntX] = houseInteriorX[playerid];
  2660. CasaInfo[house][houseIntY] = houseInteriorY[playerid];
  2661. CasaInfo[house][houseIntZ] = houseInteriorZ[playerid];
  2662. CasaInfo[house][houseIntFA] = houseInteriorFA[playerid];
  2663. CasaInfo[house][houseInterior] = houseInteriorInt[playerid];
  2664.  
  2665. DOF2_SetFloat(file, "Interior X", houseInteriorX[playerid], "Coordenadas");
  2666. DOF2_SetFloat(file, "Interior Y", houseInteriorY[playerid], "Coordenadas");
  2667. DOF2_SetFloat(file, "Interior Z", houseInteriorZ[playerid], "Coordenadas");
  2668. DOF2_SetFloat(file, "Interior Facing Angle", houseInteriorFA[playerid], "Coordenadas");
  2669. DOF2_SetInt(file, "Interior", houseInteriorInt[playerid], "Coordenadas");
  2670. DOF2_SaveFile();
  2671.  
  2672. Msg(playerid, -1, "{AB82FF}LV CASAS: Interior alterado com sucesso");
  2673.  
  2674. DestroyDynamicPickup(housePickupOut[house]);
  2675. housePickupOut[house] = CreateDynamicPickup(1318, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  2676.  
  2677. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2678.  
  2679. new
  2680. logString[128];
  2681.  
  2682. format(logString, sizeof logString, "O administrador %s[%d], alterou o interior da casa %d.", playerName, playerid, house);
  2683. WriteLog(LOG_ADMIN, logString);
  2684. }
  2685. case DIALOG_HOUSE_SELL_MENU:
  2686. {
  2687. if(!response)
  2688. return TogglePlayerControllable(playerid, 1);
  2689.  
  2690. switch(listitem)
  2691. {
  2692. case 0:
  2693. {
  2694. new
  2695. string[260],
  2696. filePath[200],
  2697. house = GetProxHouse(playerid),
  2698. alreadyOwner,
  2699. ownerFile[200],
  2700. tenantFile[200],
  2701. logString[128];
  2702.  
  2703. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2704. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName);
  2705. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", playerName);
  2706. format(filePath, sizeof filePath, "Casas/Casas/Casa %d.ini", house);
  2707.  
  2708. if(DOF2_FileExists(ownerFile))
  2709. {
  2710. alreadyOwner = DOF2_GetInt(ownerFile, "houseID");
  2711. GetPlayerPos(playerid, X, Y, Z);
  2712. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2713. format(string, sizeof string, "ERRO: Você já é dono da casa %d! Você só pode ter 1 casa!", alreadyOwner);
  2714. Msg(playerid, VERMELHO, string);
  2715. TogglePlayerControllable(playerid, 1);
  2716. return 1;
  2717. }
  2718.  
  2719. else if(DOF2_FileExists(tenantFile))
  2720. {
  2721. alreadyOwner = DOF2_GetInt(tenantFile, "houseID");
  2722. GetPlayerPos(playerid, X, Y, Z);
  2723. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2724. format(string, sizeof string, "ERRO: Você já é locador da casa %d! Você só pode ter 1 casa!", alreadyOwner);
  2725. Msg(playerid, VERMELHO, string);
  2726. return 1;
  2727. }
  2728.  
  2729. else if(GetPlayerCash(playerid) < CasaInfo[house][housePrice])
  2730. {
  2731. GetPlayerPos(playerid, X, Y, Z);
  2732. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2733. Msg(playerid, VERMELHO, "ERRO: Você não tem dinheiro o suficiente.");
  2734. TogglePlayerControllable(playerid, 1);
  2735. return 1;
  2736. }
  2737.  
  2738. format(string, sizeof string, "%s comprou a casa de id %d", playerName, house);
  2739. print(string);
  2740. WriteLog(LOG_HOUSES, string);
  2741.  
  2742. DOF2_CreateFile(ownerFile);
  2743. DOF2_SetInt(ownerFile, "houseID", house);
  2744. DOF2_SetString(filePath, "Dono", playerName, "Informações");
  2745. DOF2_SaveFile();
  2746.  
  2747. format(CasaInfo[house][houseOwner], 24, playerName);
  2748. CasaInfo[house][houseStatus] = DOF2_SetInt(filePath, "Status", 0, "Informações");
  2749.  
  2750. GivePlayerCash(playerid, -CasaInfo[house][housePrice]);
  2751. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  2752. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  2753. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  2754.  
  2755. DestroyDynamicPickup(housePickupIn[house]);
  2756. DestroyDynamicMapIcon(houseMapIcon[house]);
  2757. housePickupIn[house] = CreateDynamicPickup(1272, 23, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  2758. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 32, -1, -1, 0, -1, 100.0);
  2759.  
  2760. Update3DText(house);
  2761. format(logString, sizeof logString, "O jogador %s[%d], comprou a casa %d.", playerName, playerid, house);
  2762. WriteLog(LOG_HOUSES, logString);
  2763. }
  2764. case 1:
  2765. {
  2766. ShowAdminMenu(playerid);
  2767. TogglePlayerControllable(playerid, 1);
  2768. }
  2769. }
  2770. }
  2771. case DIALOG_HOUSE_TENANT_MENU:
  2772. {
  2773. if(!response)
  2774. return TogglePlayerControllable(playerid, 1);
  2775.  
  2776. new
  2777. house = GetProxHouse(playerid),
  2778. logString[128],
  2779. string[200];
  2780.  
  2781. switch(listitem)
  2782. {
  2783. case 0:
  2784. {
  2785. if(IsPlayerInRangeOfPoint(playerid, 5.0, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]))
  2786. {
  2787. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  2788. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  2789. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  2790.  
  2791. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2792. format(logString, sizeof logString, "O jogador %s[%d], entrou na casa %d como locador.", playerName, playerid, house);
  2793. WriteLog(LOG_HOUSES, logString);
  2794. }
  2795. }
  2796. case 1:
  2797. {
  2798. TogglePlayerControllable(playerid, 1);
  2799. ShowPlayerDialog(playerid, DIALOG_CASA_STATUS, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu mudar o status da casa.", "{FFFFFF}Oque você gostaria de fazer com o status atual da casa?\n", "Trancar", "Destrancar");
  2800. return 1;
  2801. }
  2802. case 2:
  2803. {
  2804. format(string, sizeof string, "{FFFFFF}Você deseja desalugar essa casa? {FFFFFF}(%d)\n", house);
  2805. ShowPlayerDialog(playerid, DIALOG_UNRENT_CONFIRM, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu desalugar a casa.", string, "Sim", "Não");
  2806. }
  2807. }
  2808. }
  2809. case DIALOG_HOUSE_OWNER_MENU:
  2810. {
  2811. if(!response)
  2812. return TogglePlayerControllable(playerid, 1);
  2813.  
  2814. new
  2815. house = GetProxHouse(playerid);
  2816.  
  2817. GetPlayerPos(playerid, X, Y, Z);
  2818.  
  2819. switch(listitem)
  2820. {
  2821. case 0:
  2822. {
  2823. if(IsPlayerInRangeOfPoint(playerid, 5.0, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]))
  2824. {
  2825. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  2826. SetPlayerVirtualWorld(playerid, CasaInfo[house][houseVirtualWorld]);
  2827. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  2828.  
  2829. new
  2830. logString[128];
  2831.  
  2832. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2833. format(logString, sizeof logString, "O jogador %s[%d], entrou na casa %d como dono da casa.", playerName, playerid, house);
  2834. WriteLog(LOG_HOUSES, logString);
  2835. }
  2836. }
  2837. case 1:
  2838. {
  2839. TogglePlayerControllable(playerid, 1);
  2840. ShowPlayerDialog(playerid, DIALOG_RENT, DIALOG_STYLE_MSGBOX, "{00F2FC}Aluguel.", "{FFFFFF}Oque você gostaria de fazer com o aluguel da sua casa?\n", "Ativar", "Desativar");
  2841. return 1;
  2842. }
  2843. case 2:
  2844. {
  2845. TogglePlayerControllable(playerid, 1);
  2846. ShowPlayerDialog(playerid, DIALOG_CASA_STATUS, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu mudar o status da sua casa.", "{FFFFFF}Oque você gostaria de fazer com o status atual da sua casa?\n", "Trancar", "Destrancar");
  2847. return 1;
  2848. }
  2849. case 3:
  2850. {
  2851. new
  2852. string[250];
  2853.  
  2854. format(string, sizeof string, "{FFFFFF}Você deseja vender sua casa por {FFFFFF}R$%d{FFFFFF}?\n", CasaInfo[house][housePrice]/2);
  2855. ShowPlayerDialog(playerid, DIALOG_VENDER_CASA, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu vender sua casa.", string, "Sim", "Não");
  2856. TogglePlayerControllable(playerid, 1);
  2857. return 1;
  2858. }
  2859. case 4:
  2860. {
  2861. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Digite o ID/playerName do player abaixo, é possível utilizar parte do nick quanto ID do player\n", "Próximo", "Voltar");
  2862. TogglePlayerControllable(playerid, 1);
  2863. return 1;
  2864. }
  2865. case 5:
  2866. {
  2867. new
  2868. string[250];
  2869.  
  2870. if(CasaInfo[house][houseRentable] == 0)
  2871. {
  2872. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2873. Msg(playerid, VERMELHO, "ERRO: Sua casa casa não está sendo alugada. Ative o aluguel antes.");
  2874. TogglePlayerControllable(playerid, 1);
  2875. return 1;
  2876. }
  2877.  
  2878. if(!strcmp(CasaInfo[house][houseTenant], "Ninguem", false))
  2879. {
  2880. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2881. Msg(playerid, VERMELHO, "ERRO: Não tem ninguém alugando sua casa no momento.");
  2882. TogglePlayerControllable(playerid, 1);
  2883. return 1;
  2884. }
  2885.  
  2886. format(string, sizeof string, "{FFFFFF}Você deseja despejar o locador {46FE00}%s{FFFFFF}, da sua casa?\n", CasaInfo[house][houseTenant]);
  2887. ShowPlayerDialog(playerid, DIALOG_DUMP_TENANT, DIALOG_STYLE_MSGBOX, "{00F2FC}Você escolheu despejar o locador da sua casa.", string, "Sim", "Não");
  2888. TogglePlayerControllable(playerid, 1);
  2889. }
  2890. case 6:
  2891. {
  2892. new
  2893. stringMessage[128];
  2894.  
  2895. if (strlen(CasaInfo[house][houseTitle]) > 0)
  2896. {
  2897. format(stringMessage, sizeof stringMessage, "{FFFFFF}Digite o novo título da casa.\n\nTítulo anterior: {46FE00}%s\n", CasaInfo[house][houseTitle]);
  2898. ShowPlayerDialog(playerid, DIALOG_HOUSE_TITLE, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu mudar o título da casa.", stringMessage, "Alterar", "Voltar");
  2899. }
  2900. else
  2901. ShowPlayerDialog(playerid, DIALOG_HOUSE_TITLE, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu mudar o título da casa.", "{FFFFFF}Digite o novo título da casa.\n\nTítulo anterior: {FFFFFF}SEM TÍTULO\n", "Alterar", "Voltar");
  2902.  
  2903. TogglePlayerControllable(playerid, 1);
  2904. }
  2905. }
  2906. }
  2907.  
  2908. case DIALOG_DUMP_TENANT:
  2909. {
  2910. if(!response)
  2911. return ShowHouseMenu(playerid);
  2912.  
  2913. new
  2914. house = GetProxHouse(playerid),
  2915. tenantFile[200],
  2916. houseFile[200],
  2917. string[128],
  2918. string2[128],
  2919. playerName2[MAX_PLAYER_NAME],
  2920. logString[128],
  2921. tenantID = GetTenantID(house);
  2922.  
  2923. if(tenantID != -255)
  2924. {
  2925. if(GetPlayerVirtualWorld(tenantID) == house)
  2926. {
  2927. SetPlayerPos(tenantID, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  2928. SetPlayerInterior(tenantID, 0);
  2929. SetPlayerVirtualWorld(tenantID, 0);
  2930. }
  2931. }
  2932.  
  2933. format(string, sizeof string, "{AB82FF}LV CASAS: Você foi despejado. Procure {46FE00}%s {FFFFFF}para saber o motivo.", CasaInfo[house][houseOwner]);
  2934. format(string2, sizeof string2, "{AB82FF}LV CASAS: Você despejou {46FE00}%s {FFFFFF}com sucesso, ele deve te procurar para saber o motivo.", CasaInfo[house][houseTenant]);
  2935.  
  2936. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", CasaInfo[house][houseTenant]);
  2937. format(houseFile, sizeof houseFile, "Casas/Casas/Casa %d.ini", house);
  2938.  
  2939. Msg(CasaInfo[house][houseTenant], -1, string);
  2940. Msg(playerid, -1, string2);
  2941.  
  2942. GetPlayerName(CasaInfo[house][houseTenant], playerName2, MAX_PLAYER_NAME);
  2943. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2944.  
  2945. format(logString, sizeof logString, "O jogador %s[%d], despejou o locador %s da casa %d.", playerName, playerid, playerName2, house);
  2946. WriteLog(LOG_HOUSES, logString);
  2947.  
  2948.  
  2949. DOF2_RemoveFile(tenantFile);
  2950. format(CasaInfo[house][houseTenant], 24, "Ninguem");
  2951. DOF2_SetString(houseFile, "Locador", "Ninguem", "Aluguel");
  2952. return 1;
  2953. }
  2954.  
  2955. case DIALOG_HOUSE_SELL_PLAYER:
  2956. {
  2957. if(!response)
  2958. return ShowHouseMenu(playerid);
  2959.  
  2960. new
  2961. targetID,
  2962. tenantFile[200],
  2963. ownerFile[200];
  2964.  
  2965. GetPlayerPos(playerid, X, Y, Z);
  2966.  
  2967. if(sscanf(inputtext, "u", targetID))
  2968. {
  2969. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2970. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Digite o ID/playerName do player abaixo, é possível utilizar parte do nick quanto ID do player\n", "Próximo", "Cancelar");
  2971. return 1;
  2972. }
  2973.  
  2974. else if(!IsPlayerConnected(targetID) || targetID == INVALID_PLAYER_ID)
  2975. {
  2976. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2977. Msg(playerid, VERMELHO, "ERRO: Jogador não conectado!");
  2978. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Digite o ID/playerName do player abaixo, é possível utilizar parte do nick quanto ID do player\n", "Próximo", "Cancelar");
  2979. return 1;
  2980. }
  2981.  
  2982. GetPlayerName(targetID, playerName, MAX_PLAYER_NAME);
  2983.  
  2984. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", playerName);
  2985. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName);
  2986.  
  2987. if(DOF2_FileExists(tenantFile))
  2988. {
  2989. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2990. Msg(playerid, VERMELHO, "ERRO: Este player já é locador de uma casa!");
  2991. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Digite o ID/playerName do player abaixo, é possível utilizar parte do nick quanto ID do player\n", "Próximo", "Cancelar");
  2992. return 1;
  2993. }
  2994.  
  2995. else if(DOF2_FileExists(ownerFile))
  2996. {
  2997. PlayerPlaySound(playerid, 1085, X, Y, Z);
  2998. Msg(playerid, VERMELHO, "ERRO: Este player já é dono de uma casa!");
  2999. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Digite o ID/playerName do player abaixo, é possível utilizar parte do nick quanto ID do player\n", "Próximo", "Cancelar");
  3000. return 1;
  3001. }
  3002.  
  3003. else if(playerid == targetID)
  3004. {
  3005. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3006. Msg(playerid, VERMELHO, "ERRO: Você não pode vender a casa para você mesmo!");
  3007. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Digite o ID/playerName do player abaixo, é possível utilizar parte do nick quanto ID do player\n", "Próximo", "Cancelar");
  3008. return 1;
  3009. }
  3010.  
  3011. playerReceiveHouse = targetID;
  3012. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER2, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Agora digite o preço abaixo e aguarde a confirmação\n{FFFFFF}Use somente números.\n", "Próximo", "Cancelar");
  3013. }
  3014.  
  3015. case DIALOG_HOUSE_SELL_PLAYER2:
  3016. {
  3017. if(!response)
  3018. return ShowHouseMenu(playerid);
  3019.  
  3020. new
  3021. sellingHousePrice;
  3022.  
  3023. if(sscanf(inputtext, "d", sellingHousePrice))
  3024. {
  3025. GetPlayerPos(playerid, X, Y, Z);
  3026. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3027. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_PLAYER2, DIALOG_STYLE_INPUT, "{00F2FC}Você escolheu vender sua casa para um player.", "{FFFFFF}Agora digite o preço abaixo\n{FFFFFF}Use somente números.\n", "Próximo", "Cancelar");
  3028. return 1;
  3029. }
  3030.  
  3031. priceReceiveHouse = sellingHousePrice;
  3032.  
  3033. new
  3034. stringCat[600],
  3035. string[100],
  3036. string2[100],
  3037. string3[100],
  3038. string4[100],
  3039. playerName2[MAX_PLAYER_NAME],
  3040. ownerFile[200];
  3041.  
  3042. GetPlayerName(playerReceiveHouse, playerName, MAX_PLAYER_NAME);
  3043. GetPlayerName(playerid, playerName2, MAX_PLAYER_NAME);
  3044.  
  3045. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName2);
  3046.  
  3047. houseSellingID = DOF2_GetInt(ownerFile, "houseID");
  3048. playerIDOffer = playerid;
  3049.  
  3050. format(string, sizeof string, "{00F2FC}Quem vai receber a casa: {46FE00}%s\n", playerName);
  3051. format(string2, sizeof string2, "{00F2FC}Valor a ser pago pela casa: {FFFFFF}$%d\n", sellingHousePrice);
  3052. format(string3, sizeof string3, "{00F2FC}ID da casa a ser vendida: {FFFFFF}%d\n", houseSellingID);
  3053. format(string4, sizeof string4, "{00F2FC}Dono da casa a ser vendida: {46FE00}%s\n\n", CasaInfo[houseSellingID][houseOwner]);
  3054.  
  3055. strcat(stringCat, string);
  3056. strcat(stringCat, string2);
  3057. strcat(stringCat, string3);
  3058. strcat(stringCat, string4);
  3059. strcat(stringCat, "{FD0900}ATENÇÃO: A casa dita acima vai ser do player para o qual a casa vai ser vendida, isso não pode ser desfeito,\nA menos que você a compre do player novamente.\n");
  3060. strcat(stringCat, "Você deseja confirmar essa ação, baseada nas informações acima descritas?\n");
  3061.  
  3062. ShowPlayerDialog(playerid, DIALOG_SELLING_CONFIRM, DIALOG_STYLE_MSGBOX, "Venda de casa para player", stringCat, "CONFIRMAR", "Cancelar");
  3063. }
  3064.  
  3065. case DIALOG_SELLING_CONFIRM:
  3066. {
  3067. if(!response)
  3068. return ShowHouseMenu(playerid);
  3069.  
  3070. if (!IsPlayerConnected(playerReceiveHouse) || playerReceiveHouse == INVALID_PLAYER_ID)
  3071. {
  3072. Msg(playerid, VERMELHO, "ERRO: O jogador se desconectou!");
  3073. playerReceiveHouse = 0;
  3074. return 1;
  3075. }
  3076.  
  3077. new
  3078. stringCat[600],
  3079. string[100],
  3080. string2[100],
  3081. string3[100];
  3082.  
  3083. GetPlayerName(playerIDOffer, playerName, MAX_PLAYER_NAME);
  3084. TogglePlayerControllable(playerIDOffer, 1);
  3085.  
  3086. strcat(stringCat, "{00F2FC}Há uma oferta para venda de uma casa para você!\n\n\n");
  3087.  
  3088. format(string, sizeof string, "{00F2FC}Dono da casa a ser vendida: {46FE00}%s\n\n", CasaInfo[houseSellingID][houseOwner]);
  3089. format(string2, sizeof string2, "{00F2FC}Valor a ser pago pela casa: {FFFFFF}$%d\n", priceReceiveHouse);
  3090. format(string3, sizeof string3, "{00F2FC}ID da casa a ser vendida: {FFFFFF}%d\n", houseSellingID);
  3091.  
  3092. strcat(stringCat, string);
  3093. strcat(stringCat, string2);
  3094. strcat(stringCat, string3);
  3095. strcat(stringCat, "{FD0900}ATENÇÃO: A casa dita acima vai ser sua e isso não pode ser desfeito,\nA menos que você a venda para o player do qual você comprou.\n");
  3096. strcat(stringCat, "Você deseja comprar a casa, baseada nas informações acima descritas?\n");
  3097.  
  3098. ShowPlayerDialog(playerReceiveHouse, DIALOG_HOUSE_SELL_PLAYER3, DIALOG_STYLE_MSGBOX, "Venda de casa", stringCat, "Comprar", "Negar");
  3099. }
  3100. case DIALOG_HOUSE_SELL_PLAYER3:
  3101. {
  3102. GetPlayerPos(playerid, X, Y, Z);
  3103. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  3104.  
  3105. if(!response)
  3106. {
  3107. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3108. TogglePlayerControllable(playerid, 1);
  3109.  
  3110. new
  3111. string[128];
  3112.  
  3113. format(string, sizeof string, "O jogador {00F2FC}%s {FFFFFF}negou a sua oferta de comprar a casa número {00F2FC}%d {FFFFFF}por {00F2FC}$%d", playerName, houseSellingID, priceReceiveHouse);
  3114. Msg(playerIDOffer, -1, string);
  3115. return 1;
  3116. }
  3117.  
  3118. if(GetPlayerCash(playerid) < priceReceiveHouse)
  3119. {
  3120. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3121. TogglePlayerControllable(playerid, 1);
  3122.  
  3123. new
  3124. string[150];
  3125.  
  3126. format(string, sizeof string, "O jogador {00F2FC}%s {FFFFFF}não tem dinheiro o suficiente para comprar a casa número {00F2FC}%d {FFFFFF}por {00F2FC}$%d", playerName, houseSellingID, priceReceiveHouse);
  3127. Msg(playerIDOffer, -1, string);
  3128. Msg(playerid, VERMELHO, "ERRO: Você não tem dinheiro o suficiente!");
  3129. return 1;
  3130. }
  3131.  
  3132. new
  3133. housePath2[200],
  3134. playerName2[MAX_PLAYER_NAME],
  3135. house = houseSellingID,
  3136. ownerFile[200],
  3137. ownerFile2[200];
  3138.  
  3139. GivePlayerCash(playerid, -priceReceiveHouse);
  3140. GivePlayerCash(playerIDOffer, priceReceiveHouse);
  3141.  
  3142. Msg(playerid, -1, "{00F2FC}Negócio fechado! {FFFFFF}Divirta-se!");
  3143. Msg(playerIDOffer, -1, "{00F2FC}Negócio fechado! {FFFFFF}Divirta-se!");
  3144.  
  3145. GetPlayerName(playerIDOffer, playerName2, 24);
  3146.  
  3147. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini", playerName2);
  3148. format(ownerFile2, sizeof ownerFile2, "Casas/Donos/%s.ini", playerName);
  3149. DOF2_RenameFile(ownerFile, ownerFile2);
  3150.  
  3151. format(housePath2, sizeof housePath2, "Casas/Casas/Casa %d.ini", house);
  3152. format(CasaInfo[house][houseOwner], 255, playerName2);
  3153.  
  3154. DOF2_SetString(housePath2, "Dono", playerName2);
  3155. DOF2_SaveFile();
  3156.  
  3157. SetPlayerPos(playerid, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  3158. SetPlayerVirtualWorld(playerid, house);
  3159. SetPlayerInterior(playerid, CasaInfo[house][houseInterior]);
  3160.  
  3161. TogglePlayerControllable(playerid, 1);
  3162. TogglePlayerControllable(playerIDOffer, 1);
  3163.  
  3164. new logString[128];
  3165. format(logString, sizeof logString, "O jogador %s[%d], vendeu a casa %d para o jogador %s[%d] por $%d.", playerName2, playerIDOffer, house, playerName, playerid, priceReceiveHouse);
  3166. WriteLog(LOG_HOUSES, logString);
  3167. Update3DText(house);
  3168. }
  3169.  
  3170. case DIALOG_RENT:
  3171. {
  3172. new house = GetProxHouse(playerid);
  3173. GetPlayerPos(playerid, X, Y, Z);
  3174. if(response)
  3175. {
  3176. if(CasaInfo[house][houseRentable] == 1)
  3177. {
  3178. Msg(playerid, VERMELHO, "ERRO: O aluguel da sua casa já está ativado!");
  3179. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3180. return 1;
  3181. }
  3182. ShowPlayerDialog(playerid, DIALOG_RENT_PRICE, DIALOG_STYLE_INPUT, "{00F2FC}Insira o valor do aluguel.", "{FFFFFF}Insira o valor do aluguel que você quer.\nEsse valor vai ser entregue na sua casa a cada 24 horas se haver um locador na sua casa\n{FFFFFF}Use somente números.\n", "Alugar!", "Cancelar");
  3183. }
  3184. else
  3185. {
  3186. if(CasaInfo[house][houseRentable] == 0)
  3187. {
  3188. Msg(playerid, VERMELHO, "ERRO: O aluguel da sua casa já está desativado!");
  3189. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3190. return 1;
  3191. }
  3192.  
  3193. if(strcmp(CasaInfo[house][houseTenant], "Ninguem", false))
  3194. {
  3195. GetPlayerPos(playerid, X, Y, Z);
  3196. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3197. Msg(playerid, VERMELHO, "ERRO: Não é possível desativar o aluguel com alguém alugando sua casa.");
  3198. TogglePlayerControllable(playerid, 1);
  3199. return 1;
  3200. }
  3201.  
  3202. CasaInfo[house][houseRentable] = 0;
  3203. Update3DText(house);
  3204. Msg(playerid, ROXOCLARO, "LV CASAS: Aluguel desativado!");
  3205.  
  3206. new logString[128];
  3207. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  3208. format(logString, sizeof logString, "O jogador %s[%d], desativou o aluguel da casa %d.", playerName, playerid, house);
  3209. WriteLog(LOG_HOUSES, logString);
  3210. }
  3211. }
  3212.  
  3213. case DIALOG_RENT_PRICE:
  3214. {
  3215. if(!response)
  3216. return ShowHouseMenu(playerid);
  3217.  
  3218. GetPlayerPos(playerid, X, Y, Z);
  3219.  
  3220. if(!IsNumeric(inputtext))
  3221. {
  3222. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3223. Msg(playerid, VERMELHO, "ERRO: Digite apenas números!");
  3224. ShowPlayerDialog(playerid, DIALOG_RENT_PRICE, DIALOG_STYLE_INPUT, "{00F2FC}Insira o valor do aluguel.", "{FFFFFF}Insira o valor do aluguel que você quer.\nEsse valor vai ser entregue na sua casa a cada 24 horas se haver um locador na sua casa\n{FFFFFF}Use somente números.\n", "Alugar!", "Cancelar");
  3225. return 1;
  3226. }
  3227.  
  3228. if(!strlen(inputtext))
  3229. {
  3230. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3231. Msg(playerid, VERMELHO, "ERRO: Digite algo no campo ou cancele!");
  3232. ShowPlayerDialog(playerid, DIALOG_RENT_PRICE, DIALOG_STYLE_INPUT, "{00F2FC}Insira o valor do aluguel.", "{FFFFFF}Insira o valor do aluguel que você quer.\nEsse valor vai ser entregue na sua casa a cada 24 horas se haver um locador na sua casa\n{FFFFFF}Use somente números.\n", "Alugar!", "Cancelar");
  3233. return 1;
  3234. }
  3235.  
  3236. new
  3237. house = GetProxHouse(playerid),
  3238. logString[128],
  3239. file[200];
  3240.  
  3241. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  3242.  
  3243. CasaInfo[house][houseRentable] = 1;
  3244. CasaInfo[house][houseRentPrice] = strval(inputtext);
  3245.  
  3246. DOF2_SetInt(file, "Aluguel Ativado", CasaInfo[house][houseRentable], "Aluguel");
  3247. DOF2_SetInt(file, "Preço do Aluguel", CasaInfo[house][houseRentPrice], "Aluguel");
  3248. DOF2_SaveFile();
  3249.  
  3250. Update3DText(house);
  3251. Msg(playerid, ROXOCLARO, "LV CASAS: Aluguel ativado!");
  3252.  
  3253. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  3254. format(logString, sizeof logString, "O jogador %s[%d], ativou o aluguel da casa %d por $%d.", playerName, playerid, house, CasaInfo[house][houseRentPrice]);
  3255. WriteLog(LOG_HOUSES, logString);
  3256.  
  3257. return 1;
  3258. }
  3259.  
  3260. case DIALOG_CRIAR_CASA:
  3261. {
  3262. if(!response)
  3263. return 1;
  3264.  
  3265. switch(listitem)
  3266. {
  3267. case 0:
  3268. {
  3269. houseInteriorX[playerid] = 2196.84;
  3270. houseInteriorY[playerid] = -1204.36;
  3271. houseInteriorZ[playerid] = 1049.02;
  3272. houseInteriorFA[playerid] = 94.0010;
  3273. houseInteriorInt[playerid] = 6;
  3274. houseIntPrice[playerid] = 65000;
  3275. }
  3276. case 1:
  3277. {
  3278. houseInteriorX[playerid] = 2259.38;
  3279. houseInteriorY[playerid] = -1135.89;
  3280. houseInteriorZ[playerid] = 1050.64;
  3281. houseInteriorFA[playerid] = 275.3992;
  3282. houseInteriorInt[playerid] = 10;
  3283. houseIntPrice[playerid] = 37000;
  3284. }
  3285. case 2:
  3286. {
  3287. houseInteriorX[playerid] = 2282.99;
  3288. houseInteriorY[playerid] = -1140.28;
  3289. houseInteriorZ[playerid] = 1050.89;
  3290. houseInteriorFA[playerid] = 358.4660;
  3291. houseInteriorInt[playerid] = 11;
  3292. houseIntPrice[playerid] = 37000;
  3293. }
  3294. case 3:
  3295. {
  3296. houseInteriorX[playerid] = 2233.69;
  3297. houseInteriorY[playerid] = -1115.26;
  3298. houseInteriorZ[playerid] = 1050.88;
  3299. houseInteriorFA[playerid] = 358.4660;
  3300. houseInteriorInt[playerid] = 5;
  3301. houseIntPrice[playerid] = 20000;
  3302. }
  3303. case 4:
  3304. {
  3305. houseInteriorX[playerid] = 2218.39;
  3306. houseInteriorY[playerid] = -1076.21;
  3307. houseInteriorZ[playerid] = 1050.48;
  3308. houseInteriorFA[playerid] = 95.2635;
  3309. houseInteriorInt[playerid] = 1;
  3310. houseIntPrice[playerid] = 20000;
  3311. }
  3312. case 5:
  3313. {
  3314. houseInteriorX[playerid] = 2496.00;
  3315. houseInteriorY[playerid] = -1692.08;
  3316. houseInteriorZ[playerid] = 1014.74;
  3317. houseInteriorFA[playerid] = 177.8159;
  3318. houseInteriorInt[playerid] = 3;
  3319. houseIntPrice[playerid] = 150000;
  3320. }
  3321. case 6:
  3322. {
  3323. houseInteriorX[playerid] = 2365.25;
  3324. houseInteriorY[playerid] = -1135.58;
  3325. houseInteriorZ[playerid] = 1050.88;
  3326. houseInteriorFA[playerid] = 359.0367;
  3327. houseInteriorInt[playerid] = 8;
  3328. houseIntPrice[playerid] = 320000;
  3329. }
  3330. case 7:
  3331. {
  3332. houseInteriorX[playerid] = 2317.77;
  3333. houseInteriorY[playerid] = -1026.76;
  3334. houseInteriorZ[playerid] = 1050.21;
  3335. houseInteriorFA[playerid] = 359.0367;
  3336. houseInteriorInt[playerid] = 9;
  3337. houseIntPrice[playerid] = 120000;
  3338. }
  3339. case 8:
  3340. {
  3341. houseInteriorX[playerid] = 2324.41;
  3342. houseInteriorY[playerid] = -1149.54;
  3343. houseInteriorZ[playerid] = 1050.71;
  3344. houseInteriorFA[playerid] = 359.0367;
  3345. houseInteriorInt[playerid] = 12;
  3346. houseIntPrice[playerid] = 95000;
  3347. }
  3348. case 9:
  3349. {
  3350. houseInteriorX[playerid] = 1260.6603;
  3351. houseInteriorY[playerid] = -785.4005;
  3352. houseInteriorZ[playerid] = 1091.9063;
  3353. houseInteriorFA[playerid] = 270.9891;
  3354. houseInteriorInt[playerid] = 5;
  3355. houseIntPrice[playerid] = 1200000;
  3356. }
  3357. case 10:
  3358. {
  3359. houseInteriorX[playerid] = 140.28;
  3360. houseInteriorY[playerid] = 1365.92;
  3361. houseInteriorZ[playerid] = 1083.85;
  3362. houseInteriorFA[playerid] = 9.6901;
  3363. houseInteriorInt[playerid] = 5;
  3364. houseIntPrice[playerid] = 660000;
  3365. }
  3366. }
  3367.  
  3368. new
  3369. house,
  3370. houseAtual[200],
  3371. checkID[200],
  3372. logString[128];
  3373.  
  3374. GetPlayerPos(playerid, X, Y, Z);
  3375. format(houseAtual, sizeof houseAtual, "Casas/CasaAtual.ini");
  3376.  
  3377. if(!DOF2_FileExists(houseAtual))
  3378. {
  3379. DOF2_CreateFile(houseAtual);
  3380. DOF2_SetInt(houseAtual, "IDAtual", 1);
  3381. DOF2_SaveFile();
  3382. house = 1;
  3383. }
  3384.  
  3385. else
  3386. {
  3387. for(new i = 1; i < MAX_CASAS; i++)
  3388. {
  3389. format(checkID, sizeof checkID, "Casas/Casas/Casa %d.ini", i);
  3390. if(!DOF2_FileExists(checkID))
  3391. {
  3392. DOF2_SetInt(houseAtual, "IDAtual", i);
  3393. DOF2_SaveFile();
  3394. house = i;
  3395. break;
  3396. }
  3397. }
  3398. }
  3399.  
  3400. CreateHouse(house, X, Y, Z, houseInteriorX[playerid], houseInteriorY[playerid], houseInteriorZ[playerid], houseInteriorFA[playerid], houseIntPrice[playerid], houseInteriorInt[playerid]);
  3401.  
  3402. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  3403. format(logString, sizeof logString, "O administrador %s[%d], criou a casa %d.", playerName, playerid, house);
  3404. WriteLog(LOG_ADMIN, logString);
  3405. Msg(playerid, ROXOCLARO, "LV CASAS: Casa criada!");
  3406. }
  3407.  
  3408. case DIALOG_CASA_STATUS:
  3409. {
  3410. new
  3411. filePath[200],
  3412. house = GetProxHouse(playerid);
  3413.  
  3414. format(filePath, sizeof filePath, "Casas/Casas/Casa %d.ini", house);
  3415.  
  3416. GetPlayerPos(playerid, X, Y, Z);
  3417. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  3418.  
  3419. if(!response)
  3420. {
  3421. if(CasaInfo[house][houseStatus] == 0)
  3422. {
  3423. Msg(playerid, VERMELHO, "ERRO: A casa já está destrancada!");
  3424. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3425. return 1;
  3426. }
  3427.  
  3428. CasaInfo[house][houseStatus] = 0;
  3429.  
  3430. DOF2_SetInt(filePath, "Status", 0, "Informações");
  3431. DOF2_SaveFile();
  3432.  
  3433. Msg(playerid, ROXOCLARO, "LV CASAS: Casa destrancada!");
  3434.  
  3435. new logString[128];
  3436. format(logString, sizeof logString, "O jogador %s[%d], destrancou a casa %d.", playerName, playerid, house);
  3437. WriteLog(LOG_HOUSES, logString);
  3438. Update3DText(house);
  3439. }
  3440. else
  3441. {
  3442. if(CasaInfo[house][houseStatus] == 1)
  3443. {
  3444. PlayerPlaySound(playerid, 1085, X, Y, Z);
  3445. Msg(playerid, VERMELHO, "ERRO: A casa já está trancada!");
  3446. return 1;
  3447. }
  3448.  
  3449. CasaInfo[house][houseStatus] = 1;
  3450.  
  3451. DOF2_SetInt(filePath, "Status", 1, "Informações");
  3452. DOF2_SaveFile();
  3453.  
  3454. Msg(playerid, ROXOCLARO, "RV CASAS: A casa foi trancada!");
  3455.  
  3456. new logString[128];
  3457. format(logString, sizeof logString, "O jogador %s[%d], destrancou a casa %d.", playerName, playerid, house);
  3458. WriteLog(LOG_HOUSES, logString);
  3459. Update3DText(house);
  3460. }
  3461. }
  3462.  
  3463. case DIALOG_VENDER_CASA:
  3464. {
  3465. if(!response)
  3466. return ShowHouseMenu(playerid);
  3467.  
  3468. new
  3469. housePath[200],
  3470. ownerFile[200],
  3471. tenantFile[200],
  3472. annMessage[128],
  3473. logString[128],
  3474. totalPrice;
  3475.  
  3476. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  3477.  
  3478. format(ownerFile, sizeof ownerFile, "Casas/Donos/%s.ini",playerName);
  3479.  
  3480. new
  3481. house = DOF2_GetInt(ownerFile, "houseID");
  3482.  
  3483. format(tenantFile, sizeof tenantFile, "Casas/Locadores/%s.ini", CasaInfo[house][houseTenant]);
  3484. format(housePath, sizeof housePath, "Casas/Casas/Casa %d.ini", house);
  3485.  
  3486. totalPrice = CasaInfo[house][housePrice]/2;
  3487.  
  3488. format(annMessage, sizeof annMessage, "{AB82FF}LV CASAS: Você vendeu sua casa por $%d", totalPrice);
  3489. Msg(playerid, -1, annMessage);
  3490.  
  3491. GivePlayerCash(playerid, totalPrice);
  3492.  
  3493. CasaInfo[house][houseStatus] = DOF2_SetInt(housePath, "Status", 1, "Informações");
  3494. format(CasaInfo[house][houseOwner], 255, "Ninguem");
  3495. format(CasaInfo[house][houseTenant], 255, "Ninguem");
  3496.  
  3497. DOF2_SetString(housePath, "Dono", "Ninguem", "Informações");
  3498. DOF2_SetString(housePath, "Locador", "Ninguem", "Aluguel");
  3499. DOF2_RemoveFile(ownerFile);
  3500.  
  3501. if(DOF2_FileExists(tenantFile))
  3502. return DOF2_RemoveFile(tenantFile);
  3503.  
  3504. DestroyDynamicPickup(housePickupIn[house]);
  3505. DestroyDynamicMapIcon(houseMapIcon[house]);
  3506.  
  3507. SetPlayerPos(playerid, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  3508. SetPlayerInterior(playerid, 0);
  3509. SetPlayerVirtualWorld(playerid, 0);
  3510.  
  3511. Update3DText(house);
  3512. DOF2_SaveFile();
  3513.  
  3514. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 31, -1, -1, 0, -1, 100.0);
  3515. housePickupIn[house] = CreateDynamicPickup(1273, 23, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  3516. Msg(playerid, ROXOCLARO, "LV CASAS: Casa vendida!");
  3517.  
  3518. format(logString, sizeof logString, "O jogador %s[%d], vendeu a casa %d.", playerName, playerid, house);
  3519. WriteLog(LOG_HOUSES, logString);
  3520. }
  3521. }
  3522. return 1;
  3523. }
  3524.  
  3525. forward VerificarBans(playerid);
  3526. public VerificarBans(playerid)
  3527. {
  3528. Msg(playerid, VERMELHO, "LV: Você possui registros de banimento!");
  3529.  
  3530. new Bans[80];
  3531. format(Bans, sizeof(Bans), BANIDOS, Nome(playerid));
  3532.  
  3533. new string[128];
  3534. format(string, sizeof string, "BAN: Conta: {1E90FF}%s", Nome(playerid));
  3535. Msg(playerid, VERMELHO, string);
  3536.  
  3537. format(string, sizeof string, "BAN: Admin: {1E90FF}%s", DOF2_GetString(Bans, "Admin"));
  3538. Msg(playerid, VERMELHO, string);
  3539.  
  3540. format(string, sizeof string, "BAN: Motivo: {1E90FF}%s", DOF2_GetString(Bans, "Motivo"));
  3541. Msg(playerid, VERMELHO, string);
  3542.  
  3543. format(string, sizeof string, "BAN: Data / Hora: {1E90FF}%s", DOF2_GetString(Bans, "DataeHora"));
  3544. Msg(playerid, VERMELHO, string);
  3545.  
  3546. format(string, sizeof string, "BAN: IP: {1E90FF}%s", DOF2_GetString(Bans, "IP"));
  3547. Msg(playerid, VERMELHO, string);
  3548.  
  3549. SetTimerEx("Kickar", 100, false, "i", playerid);
  3550. return 1;
  3551. }
  3552.  
  3553. forward VerificarBansIP(playerid);
  3554. public VerificarBansIP(playerid)
  3555. {
  3556. Msg(playerid, VERMELHO, "LV: Esse IP esta banido!");
  3557.  
  3558. new Bans[70], string[128];
  3559. format(Bans, sizeof(Bans), IPSBANIDOS, Nome(playerid));
  3560.  
  3561. format(string, sizeof string, "BAN: Admin: {1E90FF}%s", DOF2_GetString(Bans, "Admin"));
  3562. Msg(playerid, VERMELHO, string);
  3563.  
  3564. format(string, sizeof string, "BAN: Motivo: {1E90FF}%s", DOF2_GetString(Bans, "Motivo"));
  3565. Msg(playerid, VERMELHO, string);
  3566.  
  3567. format(string, sizeof string, "BAN: Data / Hora: {1E90FF}%s", DOF2_GetString(Bans, "DataeHora"));
  3568. Msg(playerid, VERMELHO, string);
  3569.  
  3570. format(string, sizeof string, "BAN: IP: {1E90FF}%s", DOF2_GetString(Bans, "IP"));
  3571. Msg(playerid, VERMELHO, string);
  3572.  
  3573. SetTimerEx("Kickar", 100, false, "i", playerid);
  3574. return 1;
  3575. }
  3576.  
  3577. forward Kickar(playerid);
  3578. public Kickar(playerid)
  3579. {
  3580. Kick(playerid);
  3581. }
  3582.  
  3583. forward Taximetro(playerid);
  3584. public Taximetro(playerid)
  3585. {
  3586.  
  3587. }
  3588.  
  3589. stock Nome(playerid)
  3590. {
  3591. new name[24];
  3592. GetPlayerName(playerid, name, sizeof(name));
  3593. return name;
  3594. }
  3595.  
  3596. stock IP(playerid)
  3597. {
  3598. new pIP[26];
  3599. GetPlayerIp(playerid, pIP, sizeof(pIP));
  3600. return pIP;
  3601. }
  3602.  
  3603. stock NivelRequerido(playerid, lvl)
  3604. {
  3605. if(PlayerInfo[playerid][pAdmin] < lvl)
  3606. {
  3607. format(String, sizeof(String), "{FF0000}ERRO:»{FFD700} Você precisa ser admin nivel %d para usar este comando!", lvl);
  3608. Msg(playerid, VERMELHO, String);
  3609. return 0;
  3610. }
  3611. return 1;
  3612. }
  3613.  
  3614. forward CriarLogs();
  3615. public CriarLogs()
  3616. {
  3617. if(!fexist(LOG_ADM)) CreateLog(LOG_ADM);
  3618. if(!fexist(LOG_VIP)) CreateLog(LOG_VIP);
  3619. if(!fexist(LOG_ARMA)) CreateLog(LOG_ARMA);
  3620. if(!fexist(LOG_GRANA)) CreateLog(LOG_GRANA);
  3621. if(!fexist(LOG_KICK)) CreateLog(LOG_KICK);
  3622. if(!fexist(LOG_CHAT)) CreateLog(LOG_CHAT);
  3623. if(!fexist(LOG_BAN)) CreateLog(LOG_BAN);
  3624. if(!fexist(LOG_DESBAN)) CreateLog(LOG_DESBAN);
  3625. if(!fexist(LOG_HOUSES)) CreateLog(LOG_HOUSES);
  3626. if(!fexist(LOG_ADMIN)) CreateLog(LOG_ADMIN);
  3627. if(!fexist(LOG_SYSTEM)) CreateLog(LOG_SYSTEM);
  3628.  
  3629. print("Logs Criados/Carregados com sucesso.");
  3630. return 1;
  3631. }
  3632.  
  3633. stock MensagemDupla(playerid, msg1[], msg2[])
  3634. {
  3635. Msg(playerid, CINZA, msg1);
  3636. Msg(playerid, CINZA, msg2);
  3637. return 1;
  3638. }
  3639.  
  3640. stock PosicaoFrentePlayer( playerid, &Float:x, &Float:y, Float:distance)
  3641. {
  3642. new Float:a;
  3643. GetPlayerPos( playerid, x, y, a);
  3644. GetPlayerFacingAngle( playerid, a);
  3645. if(GetPlayerVehicleID( playerid ))
  3646. {
  3647. GetVehicleZAngle(GetPlayerVehicleID( playerid ), a);
  3648. }
  3649. x += (distance * floatsin(-a, degrees));
  3650. y += (distance * floatcos(-a, degrees));
  3651. }
  3652.  
  3653. forward Velocimetro(playerid);
  3654. public Velocimetro(playerid)
  3655. {
  3656. new State = GetPlayerState(playerid);
  3657. if(State == PLAYER_STATE_DRIVER)
  3658. {
  3659. new vid, modelo;
  3660. vid = GetPlayerVehicleID(playerid);
  3661. modelo = GetVehicleModel(vid);
  3662. if(modelo == 509 || modelo == 510 || modelo == 481) return 1;
  3663.  
  3664. VerificarRadar(playerid);
  3665. VerificarGasolina(playerid);
  3666.  
  3667. new string[200];
  3668. new engine, lights, alarm, doors, bonnet, boot, objective;
  3669. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  3670.  
  3671. format(string, sizeof string,"%s", engine ? (" ~g~Ligado") : ("~r~Desligado"));
  3672. PlayerTextDrawSetString(playerid, Motor[playerid], string);
  3673. PlayerTextDrawShow(playerid, Motor[playerid]);
  3674.  
  3675. new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(playerid));
  3676. PlayerVehicleModelID -= 400;
  3677.  
  3678. new ncarro[30];
  3679. format(ncarro,30, PlayerVehicle[PlayerVehicleModelID]);
  3680.  
  3681. format(string,sizeof(string),"~w~%d", GetPlayerSpeed(playerid));
  3682. PlayerTextDrawSetString(playerid, Velo[playerid], string);
  3683. PlayerTextDrawShow(playerid, Velo[playerid]);
  3684.  
  3685. format(string,sizeof(string),"~p~%s", ncarro);
  3686. PlayerTextDrawSetString(playerid, Veiculo[playerid], string);
  3687. PlayerTextDrawShow(playerid, Veiculo[playerid]);
  3688.  
  3689. format(string,sizeof(string),"~g~Combustivel ~r~%d% ~w~ L", GasolinaVeiculo[vid]);
  3690. PlayerTextDrawSetString(playerid, Combust[playerid], string);
  3691. PlayerTextDrawShow(playerid, Combust[playerid]);
  3692.  
  3693. format(string,sizeof(string)," ~y~KM~i~/~y~H");
  3694. PlayerTextDrawSetString(playerid, Kmh[playerid], string);
  3695. PlayerTextDrawShow(playerid, Kmh[playerid]);
  3696.  
  3697. if(modelo == 472 || modelo == 473 || modelo == 493 || modelo == 595 || modelo == 484 || modelo == 430 ||
  3698. modelo == 453 || modelo == 452 || modelo == 446 || modelo == 454 || modelo == 476 || modelo == 460 ||
  3699. modelo == 487 || modelo == 488 || modelo == 497 || modelo == 512 || modelo == 513 || modelo == 593 ||
  3700. modelo == 417 || modelo == 447 || modelo == 469 || modelo == 511 || modelo == 548 || modelo == 563 ||
  3701. modelo == 425 || modelo == 519 || modelo == 520 || modelo == 553 || modelo == 577 || modelo == 592)
  3702. {
  3703. PlayerTextDrawHide(playerid, Combust[playerid]);
  3704. }
  3705.  
  3706. } else {
  3707.  
  3708. PlayerTextDrawHide(playerid, Velo[playerid]);
  3709. PlayerTextDrawHide(playerid, Motor[playerid]);
  3710. PlayerTextDrawHide(playerid, Combust[playerid]);
  3711. PlayerTextDrawHide(playerid, Kmh[playerid]);
  3712. PlayerTextDrawHide(playerid, Veiculo[playerid]);
  3713. }
  3714. SetTimerEx("Velocimetro", 100, false, "i", playerid);
  3715. return 1;
  3716. }
  3717.  
  3718. forward CarregarRadares();
  3719. public CarregarRadares()
  3720. {
  3721. for(new r = 0; r < MAX_RADAR; r++)
  3722. {
  3723. new Arquivo[50];
  3724. format(Arquivo,sizeof(Arquivo), RADARES, r);
  3725. if(DOF2_FileExists(Arquivo))
  3726. {
  3727. RadarInfo[r][rVelocidade] = DOF2_GetInt(Arquivo,"Velocidade");
  3728. RadarInfo[r][rPosX] = DOF2_GetFloat(Arquivo,"PosX");
  3729. RadarInfo[r][rPosY] = DOF2_GetFloat(Arquivo,"PosY");
  3730. RadarInfo[r][rPosZ] = DOF2_GetFloat(Arquivo,"PosZ");
  3731. RadarInfo[r][rAngulo] = DOF2_GetFloat(Arquivo,"Angulo");
  3732. ObjetoRadar[0][r] = CreateDynamicObject(18880, RadarInfo[r][rPosX], RadarInfo[r][rPosY], RadarInfo[r][rPosZ], 0.0, 0.0, RadarInfo[r][rAngulo]);
  3733. ObjetoRadar[1][r] = CreateDynamicObject(18880, RadarInfo[r][rPosX], RadarInfo[r][rPosY], RadarInfo[r][rPosZ], 0.0, 0.0, RadarInfo[r][rAngulo] + 180.0);
  3734.  
  3735. new stringr[30];
  3736. format(stringr, sizeof(stringr),"{FF0000}LV Radar ID: %d\n%d KM/H", r, RadarInfo[r][rVelocidade]);
  3737. TRadar[r] = Text3D:Create3DTextLabel(stringr, -1, RadarInfo[r][rPosX], RadarInfo[r][rPosY], RadarInfo[r][rPosZ]+1, 100.0, 0);
  3738. IconeRadar[r] = CreateDynamicMapIcon(RadarInfo[r][rPosX], RadarInfo[r][rPosY], RadarInfo[r][rPosZ], 34, -1, -1, 0, -1, 100.0);
  3739. }
  3740. }
  3741. return 1;
  3742. }
  3743.  
  3744. forward SalvarRadares();
  3745. public SalvarRadares()
  3746. {
  3747. for(new r = 0; r < MAX_RADAR; r++)
  3748. {
  3749. new Arquivo[50];
  3750. format(Arquivo,sizeof(Arquivo), RADARES, r);
  3751. if(DOF2_FileExists(Arquivo))
  3752. {
  3753. DOF2_SetInt(Arquivo, "Velocidade", RadarInfo[r][rVelocidade]);
  3754. DOF2_SetFloat(Arquivo, "PosX", RadarInfo[r][rPosX]);
  3755. DOF2_SetFloat(Arquivo, "PosY", RadarInfo[r][rPosY]);
  3756. DOF2_SetFloat(Arquivo, "PosZ", RadarInfo[r][rPosZ]);
  3757. DOF2_SetFloat(Arquivo, "Angulo", RadarInfo[r][rAngulo]);
  3758. DOF2_SaveFile();
  3759. }
  3760. }
  3761. return 1;
  3762. }
  3763.  
  3764. forward VerificarRadar(playerid);
  3765. public VerificarRadar(playerid)
  3766. {
  3767. if(PassouRadar[playerid] == true) return 1;
  3768. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
  3769. new modelo = GetVehicleModel(GetPlayerVehicleID(playerid));
  3770. if(modelo == 417 || modelo == 425 || modelo == 460 || modelo == 464 || modelo == 465 || modelo == 467 || modelo == 476 || modelo == 487 || modelo == 488 || modelo == 497 || modelo == 501 || modelo == 511 || modelo == 512 || modelo == 513 || modelo == 519 || modelo == 520 || modelo == 548 || modelo == 553 || modelo == 563 || modelo == 577 || modelo == 592 || modelo == 593) return 1;
  3771.  
  3772. for(new r = 0; r < MAX_RADAR; r++)
  3773. {
  3774. if(!IsPlayerInRangeOfPoint(playerid, 8.0, RadarInfo[r][rPosX], RadarInfo[r][rPosY], RadarInfo[r][rPosZ])) return PassouRadar[playerid] = false;
  3775. if(GetPlayerSpeed(playerid) > RadarInfo[r][rVelocidade])
  3776. {
  3777. format(String, sizeof(String),"LV RADAR: Você ultrapassou o limite de velocidade! Limite: {CAE1FF}%d KM/H{6495ED}, você passou a {CAE1FF}%d {6495ED}KM/H!",RadarInfo[r][rVelocidade], GetPlayerSpeed(playerid));
  3778. Msg(playerid, 0x6495EDFF, String);
  3779. PassouRadar[playerid] = true;
  3780. } else {
  3781. format(String, sizeof(String),"LV RADAR: Velocidade detectada:{CAE1FF} %d {6495ED}KM/H", GetPlayerSpeed(playerid));
  3782. Msg(playerid, 0x6495EDFF, String);
  3783. PassouRadar[playerid] = true;
  3784. }
  3785. }
  3786. return 1;
  3787. }
  3788.  
  3789. stock GetPlayerSpeed(playerid)
  3790. {
  3791. new Float:ST[4];
  3792. if(IsPlayerInAnyVehicle(playerid))
  3793. GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
  3794. else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
  3795. ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
  3796. return floatround(ST[3]);
  3797. }
  3798.  
  3799. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  3800. {
  3801. if(clickedid == Registro[2]) ShowPlayerDialog(playerid, DIALOG_SEXO, DIALOG_STYLE_MSGBOX, "SEXO LIFE VIRTUAL RPG:", "\nEscolhe seu sexo clicando nos botões abaixo:\n\n", "Masculino", "Feminino");
  3802. if(clickedid == Registro[3]) ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "REGISTRO LIFE VIRTUAL RPG:", "\nDigite sua senha abaixo:\n\n", "Ok", "Voltar");
  3803. if(clickedid == Registro[4]) ShowPlayerDialog(playerid, DIALOG_IDADE, DIALOG_STYLE_INPUT, "IDADE LIFE VIRTUAL RPG", "\nPor favor, digite sua idade:\n\n", "OK", "Cancelar");
  3804. if(clickedid == Registro[5]) ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "EMAIL LIFE VIRTUAL RPG:", "\nPor favor digite seu email abaixo;\nSera importante caso perca sua senha.\n\n", "Ok", "Cancelar");
  3805. if(clickedid == Registro[7]) Kick(playerid);
  3806.  
  3807. if(clickedid == Registro[6]) // Iniciar
  3808. {
  3809. if(DigitouSenha[playerid] == 1 && DigitouSexo[playerid] == 1 && DigitouIdade[playerid] == 1 && DigitouEmail[playerid] == 1)
  3810. {
  3811. RegistrarDados(playerid);
  3812. } else {
  3813. TextDrawShowForPlayer(playerid, Registro[8]); // mensagem de erro preencha os dados
  3814. }
  3815. }
  3816. // == Login
  3817. if(clickedid == Login[playerid][3]) ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN LIFE VIRTUAL RPG:", "\nDigite sua senha abaixo para logar-se:\n\n", "Logar", "Voltar");
  3818. if(clickedid == Login[playerid][4]) ShowPlayerDialog(playerid, DIALOG_FORUM, DIALOG_STYLE_MSGBOX, "FORUM LIFE VIRTUAL RPG:", "\nAcesse e se cadastre em nosso fórum:\n\n {FFFFFF}www.lifevirtual.forumeiros.com\n\n", "Ok", "");
  3819. if(clickedid == Login[playerid][5]) ShowPlayerDialog(playerid, DIALOG_CREDITOS, DIALOG_STYLE_MSGBOX, "CREDITOS LIFE VIRTUAL RPG:", "\nEquipe Life Virtual RPG\nScript por Cleyson Stein\n\n", "Ok", "");
  3820.  
  3821. // == Banco
  3822. new Dialog[85];
  3823. if(clickedid == Banco[6]) // Saldo
  3824. {
  3825. format(Dialog,sizeof(Dialog),"\nNome: {FF0000}%s{FFFFFF},\nSeu saldo bancário é de:\n\nR$ {FF0000}%d{FFFFFF}.", Nome(playerid), PlayerInfo[playerid][SaldoBancario]);
  3826. ShowPlayerDialog(playerid, DIALOG_SALDO, DIALOG_STYLE_MSGBOX, "BANCO SAN ANDREAS - SALDO", Dialog, "Ok", "");
  3827. }
  3828. if(clickedid == Banco[8]) // X sair
  3829. {
  3830. for(new i = 0; i < sizeof(Banco); i++) TextDrawHideForPlayer(playerid, Banco[i]);
  3831. CancelSelectTextDraw(playerid);
  3832. }
  3833.  
  3834. if(clickedid == Banco[2]) ShowPlayerDialog(playerid, DIALOG_SACAR, DIALOG_STYLE_INPUT, "BANCO SAN ANDREAS - SAQUE", "\nPor favor digite a quantia que deseja sacar:\n\n", "Ok", "Cancelar");
  3835. if(clickedid == Banco[3]) ShowPlayerDialog(playerid, DIALOG_DEPOSITAR, DIALOG_STYLE_INPUT, "BANCO SAN ANDREAS - DEPÓSITO", "\nPor favor digite a quantia que deseja depositar:\n\n", "Ok", "Cancelar");
  3836. if(clickedid == Banco[4]) // emprestimo
  3837. {
  3838. if(PlayerInfo[playerid][FezEmprestimo] == 1) return Msg(playerid, VERMELHO, "ERRO: Você ja fez um empréstimo. Pague o antes para pedir um novo.");
  3839. if(PlayerInfo[playerid][pLevel] < 20) return Msg(playerid, VERMELHO, "ERRO: Você só pode pegar empréstimos com level acima de 20.");
  3840. ShowPlayerDialog(playerid, DIALOG_EMPRESTIMO, DIALOG_STYLE_INPUT, "BANCO SAN ANDREAS - EMPRÉSTIMO", "\nEmpréstimo disponível para você; de R$ 1000 a R$ 20000.\nSerão descontados da sua conta bancária a cada UP\nO valor do juros é de 2% a cada UP.\n\nSe estiver de acordo digite o valor do empréstimo:\n\n", "Ok", "Cancelar");
  3841. }
  3842. if(clickedid == Banco[5]) ShowPlayerDialog(playerid, DIALOG_TRANSF_ID, DIALOG_STYLE_INPUT, "BANCO SAN ANDREAS - TRANSFERÊNCIA", "\nPor favor digite o ID para quem deseja transferir:\n\n", "Ok", "Cancelar");
  3843.  
  3844. return 1;
  3845. }
  3846.  
  3847. forward ChatAdmin(COLOR,const string[],level);
  3848. public ChatAdmin(COLOR,const string[],level)
  3849. {
  3850. for(new i = 0; i < MAX_PLAYERS; i++)
  3851. {
  3852. if(IsPlayerConnected(i))
  3853. {
  3854. if(PlayerInfo[i][pAdmin] > 0)
  3855. {
  3856. Msg(i, COLOR, string);
  3857. }
  3858. }
  3859. }
  3860. return 1;
  3861. }
  3862.  
  3863. forward ChatHelper(COLOR,const string[],level);
  3864. public ChatHelper(COLOR,const string[],level)
  3865. {
  3866. for(new i = 0; i < MAX_PLAYERS; i++)
  3867. {
  3868. if(IsPlayerConnected(i))
  3869. {
  3870. if(PlayerInfo[i][pHelper] == 1)
  3871. {
  3872. Msg(i, COLOR, string);
  3873. }
  3874. }
  3875. }
  3876. return 1;
  3877. }
  3878.  
  3879. forward AvisarTaxista(COLOR,const string[],level);
  3880. public AvisarTaxista(COLOR,const string[],level)
  3881. {
  3882. for(new i = 0; i < MAX_PLAYERS; i++)
  3883. {
  3884. if(IsPlayerConnected(i))
  3885. {
  3886. if(PlayerInfo[i][pProfissao] == TAXISTA)
  3887. {
  3888. Msg(i, COLOR, string);
  3889. }
  3890. }
  3891. }
  3892. return 1;
  3893. }
  3894.  
  3895. forward VerificarGasolina(playerid);
  3896. public VerificarGasolina(playerid)
  3897. {
  3898. if(IsPlayerInAnyVehicle(playerid))
  3899. {
  3900. new carid = GetPlayerVehicleID(playerid);
  3901. new engine, lights, alarm, doors, bonnet, boot, objective;
  3902. GetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, boot, objective);
  3903. if(engine) //assim so ira consumir gasolina se o motor estiver on
  3904. {
  3905. GetVehicleVelocity(carid, VehSpeed[0], VehSpeed[1], VehSpeed[2]);
  3906. if(floatround(((floatsqroot(((VehSpeed[0] * VehSpeed[0]) + (VehSpeed[1] * VehSpeed[1]) + (VehSpeed[2] * VehSpeed[2]))) * (170.0))) * 1) > 5)
  3907. {
  3908. new modelo = GetVehicleModel(carid);
  3909. if(modelo == 472 || modelo == 473 || modelo == 493 || modelo == 595 || modelo == 484 || modelo == 430 ||
  3910. modelo == 453 || modelo == 452 || modelo == 446 || modelo == 454 || modelo == 476 || modelo == 460 ||
  3911. modelo == 487 || modelo == 488 || modelo == 497 || modelo == 512 || modelo == 513 || modelo == 593 ||
  3912. modelo == 417 || modelo == 447 || modelo == 469 || modelo == 511 || modelo == 548 || modelo == 563 ||
  3913. modelo == 425 || modelo == 519 || modelo == 520 || modelo == 553 || modelo == 577 || modelo == 592) return 1;
  3914. if(GasolinaVeiculo[carid] == 0)
  3915. {
  3916. SetVehicleParamsEx(carid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
  3917. Msg(playerid, VERMELHO, "LV: A Gasolina de seu carro acabou, arraste o carro até um posto, ou compre um galão no posto.");
  3918. }
  3919. if(GasolinaVeiculo[carid] > 0)
  3920. {
  3921. ConsumoGas[playerid]+=1;
  3922. if(ConsumoGas[playerid] >= (45 * 13))
  3923. {
  3924. GasolinaVeiculo[carid]--;
  3925. ConsumoGas[playerid] = 0;
  3926. }
  3927. }
  3928. }
  3929. }
  3930. }
  3931. return 1;
  3932. }
  3933.  
  3934. forward Att_Relogio();
  3935. public Att_Relogio()
  3936. {
  3937. new str[35], str2[25], ano, mes, dia, hora, minuto, segundo;
  3938. getdate(ano, mes, dia);
  3939. gettime(hora, minuto, segundo);
  3940.  
  3941. format(str, sizeof(str), "~w~%02d~y~/~w~%02d~y~/~w~%d", dia, mes, ano);
  3942. TextDrawSetString(Relogio[1], str);
  3943.  
  3944. format(str2, sizeof(str2), " ~w~%02d~y~:~w~%02d", hora, minuto);
  3945. TextDrawSetString(Relogio[0], str2);
  3946. return 1;
  3947. }
  3948.  
  3949. forward Locais(i);
  3950. public Locais(i)
  3951. {
  3952. if(IsPlayerInRangeOfPoint( i, 10.0, 1940.6096,-1772.7147,12.9500 ) || IsPlayerInRangeOfPoint( i, 10.0, -90.8525,-1169.3555,1.9823 ) ||
  3953. IsPlayerInRangeOfPoint( i, 10.0, -1607.8698,-2715.5637,48.9453 ) || IsPlayerInRangeOfPoint( i, 10.0, -2244.2200,-2560.6169,31.9219 ) ||
  3954. IsPlayerInRangeOfPoint( i, 10.0, -2026.7922,156.5871,29.0391 ) || IsPlayerInRangeOfPoint( i, 10.0, -2410.0215,976.2697,45.4209 ) ||
  3955. IsPlayerInRangeOfPoint( i, 10.0, -1328.4185,2675.4663,50.0625 ) || IsPlayerInRangeOfPoint( i, 10.0, 1596.2703,2198.8335,10.8203 ) ||
  3956. IsPlayerInRangeOfPoint( i, 10.0, 2639.4871,1106.6412,10.8203 ) || IsPlayerInRangeOfPoint( i, 10.0, 2114.7256,920.3104,10.8203 ) ||
  3957. IsPlayerInRangeOfPoint( i, 10.0, 1004.8821,-937.0840,42.3281 ) || IsPlayerInRangeOfPoint( i, 10.0, 1382.6870,459.7101,20.3452 ) ||
  3958. IsPlayerInRangeOfPoint( i, 10.0, -1676.3906,412.9636,6.9068 ) || IsPlayerInRangeOfPoint( i, 10.0, 70.4693,1218.8176,18.5393 ) ||
  3959. IsPlayerInRangeOfPoint( i, 10.0, 613.1774,1692.8209,7.1875 ) || IsPlayerInRangeOfPoint( i, 10.0, 2147.0969,2747.4377,10.5474 ) ||
  3960. IsPlayerInRangeOfPoint( i, 10.0, 2202.2954,2474.0007,10.5474 ) || IsPlayerInRangeOfPoint( i, 10.0, 655.3937,-565.2368,15.9072 ))
  3961. {
  3962. for(new p = 0; p < sizeof(TextPostos); p++) TextDrawShowForPlayer(i, TextPostos[p]);
  3963. AreaPosto[i] = 1;
  3964. } else {
  3965. AreaPosto[i] = 0;
  3966. for(new p = 0; p < sizeof(TextPostos); p++) TextDrawHideForPlayer(i, TextPostos[p]);
  3967. }
  3968. return 1;
  3969. }
  3970.  
  3971. RetirarTextEntrada(playerid)
  3972. {
  3973. CancelSelectTextDraw(playerid);
  3974. StopAudioStreamForPlayer(playerid);
  3975. for(new i = 0; i < sizeof(Registro); i++) TextDrawHideForPlayer(playerid, Registro[i]);
  3976. for(new i = 0; i < sizeof(Fundo); i++) TextDrawHideForPlayer(playerid, Fundo[i]);
  3977. for(new i = 0; i < 8; i++) TextDrawHideForPlayer(playerid, Login[playerid][i]);
  3978. return 1;
  3979. }
  3980.  
  3981. RegistrarDados(playerid)
  3982. {
  3983. PlayerInfo[playerid][pLogado] = true;
  3984. PlayerInfo[playerid][pProfissao] = DESEMPREGADO;
  3985. PlayerInfo[playerid][Emprestimo] = 0;
  3986. PlayerInfo[playerid][FezEmprestimo] = 0;
  3987. PlayerInfo[playerid][GalaoGasolina] = 0;
  3988. PlayerInfo[playerid][TemGalao] = 0;
  3989. PlayerInfo[playerid][pLevel] = 0;
  3990. PlayerInfo[playerid][pHelper] = 0;
  3991. PlayerInfo[playerid][pAdmin] = 0;
  3992. PlayerInfo[playerid][pVip] = 0;
  3993. PlayerInfo[playerid][pPos][0] = 1685.5984;
  3994. PlayerInfo[playerid][pPos][1] = -2333.9424;
  3995. PlayerInfo[playerid][pPos][2] = 13.5469;
  3996. PlayerInfo[playerid][pInterior] = 0;
  3997. PlayerInfo[playerid][HabAerea] = 0;
  3998. PlayerInfo[playerid][HabNautica] = 0;
  3999. PlayerInfo[playerid][HabTerrestre] = 0;
  4000.  
  4001. new string[75];
  4002. format(string,sizeof string,"{058AFF}LV:» {CFCFCF}%s{FFFFFF} Entrou no servidor", Nome(playerid));
  4003. MsgAll(-1, string);
  4004.  
  4005. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  4006. SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos][0], PlayerInfo[playerid][pPos][1], PlayerInfo[playerid][pPos][2], 269.15, 0, 0, 0, 0, 0, 0);
  4007. SpawnPlayer(playerid);
  4008.  
  4009. printf("LV-> Nova conta registrada: %s", Nome(playerid));
  4010. RetirarTextEntrada(playerid);
  4011. return 1;
  4012. }
  4013.  
  4014. CarregarDados(playerid)
  4015. {
  4016. PlayerInfo[playerid][pLogado] = true;
  4017.  
  4018. new stringV[50];
  4019. format(stringV, sizeof stringV, VIPS, Nome(playerid));
  4020. if(DOF2_FileExists(stringV))
  4021. {
  4022. PlayerInfo[playerid][pVip] = 1;
  4023. PlayerInfo[playerid][TempoVip] = DOF2_GetInt(stringV, "LEVEIS RESTANTES");
  4024. }
  4025.  
  4026. new string[250];
  4027. format(string, sizeof(string), CONTAS, Nome(playerid));
  4028. PlayerInfo[playerid][pAdmin] = DOF2_GetInt(string, "Admin");
  4029. PlayerInfo[playerid][pSexo] = DOF2_GetInt(string, "Sexo");
  4030. PlayerInfo[playerid][pIdade] = DOF2_GetInt(string, "Idade");
  4031. PlayerInfo[playerid][pHelper] = DOF2_GetInt(string, "Helper");
  4032. PlayerInfo[playerid][pSkin] = DOF2_GetInt(string, "Skin");
  4033. PlayerInfo[playerid][pLevel] = DOF2_GetInt(string, "Level");
  4034. PlayerInfo[playerid][HabAerea] = DOF2_GetInt(string, "HabAerea");
  4035. PlayerInfo[playerid][HabNautica] = DOF2_GetInt(string, "HabNautica");
  4036. PlayerInfo[playerid][HabTerrestre] = DOF2_GetInt(string, "HabTerrestre");
  4037. PlayerInfo[playerid][pProfissao] = DOF2_GetInt(string, "Profissao");
  4038. PlayerInfo[playerid][pPos][0] = DOF2_GetFloat(string, "PosX");
  4039. PlayerInfo[playerid][pPos][1] = DOF2_GetFloat(string, "PosY");
  4040. PlayerInfo[playerid][pPos][2] = DOF2_GetFloat(string, "PosZ");
  4041. PlayerInfo[playerid][pInterior] = DOF2_GetInt(string, "Interior");
  4042. PlayerInfo[playerid][TemGalao] = DOF2_GetInt(string, "TemGalao");
  4043. PlayerInfo[playerid][GalaoGasolina] = DOF2_GetInt(string, "GalaoGasolina");
  4044. PlayerInfo[playerid][SaldoBancario] = DOF2_GetInt(string, "SaldoBancario");
  4045. PlayerInfo[playerid][Emprestimo] = DOF2_GetInt(string, "Emprestimo");
  4046. PlayerInfo[playerid][FezEmprestimo] = DOF2_GetInt(string, "FezEmprestimo");
  4047.  
  4048. format(string,sizeof string,"{058AFF}LV:» {CFCFCF}%s{FFFFFF} Entrou no servidor", Nome(playerid));
  4049. MsgAll(-1, string);
  4050.  
  4051. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  4052. SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
  4053. SetSpawnInfo(playerid, 1, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos][0], PlayerInfo[playerid][pPos][1], PlayerInfo[playerid][pPos][2], 269.15, 0, 0, 0, 0, 0, 0);
  4054. SpawnPlayer(playerid);
  4055. SpawnInHome(playerid);
  4056. CarregarProfs(playerid);
  4057. RetirarTextEntrada(playerid);
  4058. return 1;
  4059. }
  4060.  
  4061. SalvarDados(playerid)
  4062. {
  4063. if(PlayerInfo[playerid][pLogado] == false) return 1;
  4064.  
  4065. if(PlayerInfo[playerid][pVip] > 0)
  4066. {
  4067. new stringV[50];
  4068. format(stringV, sizeof stringV, VIPS, Nome(playerid));
  4069. if(!DOF2_FileExists(stringV)) DOF2_CreateFile(stringV);
  4070. DOF2_SetInt(stringV, "LEVEIS RESTANTES", PlayerInfo[playerid][TempoVip]);
  4071. DOF2_SaveFile();
  4072. }
  4073.  
  4074. PlayerInfo[playerid][SaldoBancario] += GetPlayerCash(playerid);
  4075. ResetPlayerCash(playerid);
  4076.  
  4077. new Float:X, Float:Y, Float:Z, string[300];
  4078. GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
  4079. format(string, sizeof(string), CONTAS, Nome(playerid));
  4080. DOF2_SetInt(string, "Level", PlayerInfo[playerid][pLevel]);
  4081. DOF2_SetInt(string, "Admin", PlayerInfo[playerid][pAdmin]);
  4082. DOF2_SetInt(string, "Helper", PlayerInfo[playerid][pHelper]);
  4083. DOF2_SetInt(string, "Skin", PlayerInfo[playerid][pSkin]);
  4084. DOF2_SetInt(string, "Idade", PlayerInfo[playerid][pIdade]);
  4085. DOF2_SetInt(string, "Sexo", PlayerInfo[playerid][pSexo]);
  4086. DOF2_SetInt(string, "HabAerea", PlayerInfo[playerid][HabAerea]);
  4087. DOF2_SetInt(string, "HabNautica", PlayerInfo[playerid][HabNautica]);
  4088. DOF2_SetInt(string, "HabTerrestre", PlayerInfo[playerid][HabTerrestre]);
  4089. DOF2_SetInt(string, "Profissao", PlayerInfo[playerid][pProfissao]);
  4090. DOF2_SetInt(string, "TemGalao", PlayerInfo[playerid][TemGalao]);
  4091. DOF2_SetInt(string, "GalaoGasolina", PlayerInfo[playerid][GalaoGasolina]);
  4092. DOF2_SetInt(string, "SaldoBancario", PlayerInfo[playerid][SaldoBancario]);
  4093. DOF2_SetInt(string, "Emprestimo", PlayerInfo[playerid][Emprestimo]);
  4094. DOF2_SetInt(string, "FezEmprestimo", PlayerInfo[playerid][FezEmprestimo]);
  4095. DOF2_SetInt(string, "Interior", GetPlayerInterior(playerid));
  4096. DOF2_SetFloat(string, "PosX", X);
  4097. DOF2_SetFloat(string, "PosY", Y);
  4098. DOF2_SetFloat(string, "PosZ", Z);
  4099. DOF2_SaveFile();
  4100. PlayerInfo[playerid][pLogado] = false;
  4101. printf("LV-> Conta salva: %s", Nome(playerid));
  4102. return 1;
  4103. }
  4104.  
  4105. CarregarProfs(playerid)
  4106. {
  4107. if(PlayerInfo[playerid][pProfissao] == DESEMPREGADO) return SetPlayerColor(playerid, C_DESEMPREGADO);
  4108. if(PlayerInfo[playerid][pProfissao] == TAXISTA) return SetPlayerColor(playerid, C_TAXISTA);
  4109. return 1;
  4110. }
  4111.  
  4112. /*stock EntrarIntCasa(playerid, IntID)
  4113. {
  4114. switch(IntID)
  4115. {
  4116. case 1:
  4117. {
  4118. SetPlayerPos(playerid, 2496.0549, -1695.1749, 1014.7422);
  4119. SetPlayerFacingAngle(playerid, 179.2174);
  4120. SetPlayerInterior(playerid, 3);
  4121. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[46] {FFFFFF}Casa dos Johnsons");
  4122. }
  4123.  
  4124. case 2:
  4125. {
  4126. SetPlayerPos(playerid, 1267.8407, -776.9587, 1091.9063);
  4127. SetPlayerFacingAngle(playerid, 231.3418);
  4128. SetPlayerInterior(playerid, 5);
  4129. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[55] {FFFFFF}Mansão do Mad Dog");
  4130. }
  4131.  
  4132. case 3:
  4133. {
  4134. SetPlayerPos(playerid, 419.8936, 2537.1155, 10.00);
  4135. SetPlayerFacingAngle(playerid, 67.6537);
  4136. SetPlayerInterior(playerid, 10);
  4137. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[59] {FFFFFF}Torre Aeroporto Abandonado");
  4138. }
  4139.  
  4140. case 4:
  4141. {
  4142. SetPlayerPos(playerid, 2233.6919, -1112.8107, 1050.8828);
  4143. SetPlayerFacingAngle(playerid, 8.6483);
  4144. SetPlayerInterior(playerid, 5);
  4145. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[67] {FFFFFF}Casa Segura 1");
  4146. }
  4147.  
  4148. case 5:
  4149. {
  4150. SetPlayerPos(playerid, 2319.1272, -1023.9562, 1050.2109);
  4151. SetPlayerFacingAngle(playerid, 167.3959);
  4152. SetPlayerInterior(playerid, 9);
  4153. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[69] {FFFFFF}Casa Segura 3");
  4154. }
  4155.  
  4156. case 6:
  4157. {
  4158. SetPlayerPos(playerid, 2261.0977, -1137.8833, 1050.6328);
  4159. SetPlayerFacingAngle(playerid, 266.88);
  4160. SetPlayerInterior(playerid, 10);
  4161. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[70] {FFFFFF}Casa Segura 4");
  4162. }
  4163.  
  4164. case 7:
  4165. {
  4166. SetPlayerPos(playerid, 234.6087, 1187.8195, 1080.2578);
  4167. SetPlayerFacingAngle(playerid, 349.4844);
  4168. SetPlayerInterior(playerid, 3);
  4169. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[76] {FFFFFF}Casa 1");
  4170. }
  4171.  
  4172. case 8:
  4173. {
  4174. SetPlayerPos(playerid, 225.5707, 1240.0643, 1082.1406);
  4175. SetPlayerFacingAngle(playerid, 96.2852);
  4176. SetPlayerInterior(playerid, 2);
  4177. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[77] {FFFFFF}Casa 2");
  4178. }
  4179.  
  4180. case 9:
  4181. {
  4182. SetPlayerPos(playerid, 224.288, 1289.1907, 1082.1406);
  4183. SetPlayerFacingAngle(playerid, 359.868);
  4184. SetPlayerInterior(playerid, 1);
  4185. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[78] {FFFFFF}Casa 3");
  4186. }
  4187.  
  4188. case 10:
  4189. {
  4190. SetPlayerPos(playerid, 239.2819, 1114.1991, 1080.9922);
  4191. SetPlayerFacingAngle(playerid, 270.2654);
  4192. SetPlayerInterior(playerid, 5);
  4193. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[79] {FFFFFF}Casa 4");
  4194. }
  4195.  
  4196. case 11:
  4197. {
  4198. SetPlayerPos(playerid, 295.1391, 1473.3719, 1080.2578);
  4199. SetPlayerFacingAngle(playerid, 352.9526);
  4200. SetPlayerInterior(playerid, 15);
  4201. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[81] {FFFFFF}Casa 5");
  4202. }
  4203.  
  4204. case 12:
  4205. {
  4206. SetPlayerPos(playerid, 227.3922, 1114.6572, 1080.9985);
  4207. SetPlayerFacingAngle(playerid, 267.459);
  4208. SetPlayerInterior(playerid, 5);
  4209. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[93] {FFFFFF}Casa 7");
  4210. }
  4211.  
  4212. case 13:
  4213. {
  4214. SetPlayerPos(playerid, 2323.7063, -1147.6509, 1050.7101);
  4215. SetPlayerFacingAngle(playerid, 206.5352);
  4216. SetPlayerInterior(playerid, 12);
  4217. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[106] {FFFFFF}Casa 12");
  4218. }
  4219.  
  4220. case 14:
  4221. {
  4222. SetPlayerPos(playerid, 2216.1282, -1076.3052, 1050.4844);
  4223. SetPlayerFacingAngle(playerid, 86.428);
  4224. SetPlayerInterior(playerid, 1);
  4225. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[131] {FFFFFF}Casa 19");
  4226. }
  4227.  
  4228. case 15:
  4229. {
  4230. SetPlayerPos(playerid, 2365.1089, -1133.0795, 1050.875);
  4231. SetPlayerFacingAngle(playerid, 177.3947);
  4232. SetPlayerInterior(playerid, 8);
  4233. Msg(playerid, -1, "Você entrou no interior: {00EEFE}[135] {FFFFFF}Casa 20");
  4234. }
  4235. }
  4236. return 1;
  4237. }*/
  4238.  
  4239. ShowAdminMenu(playerid)
  4240. {
  4241. new stringCat[1200];
  4242. strcat(stringCat, "Visualizar interior\n");
  4243. strcat(stringCat, "Alterar Preço\n");
  4244. strcat(stringCat, "Alterar Preço Aluguel\n");
  4245. strcat(stringCat, "Alterar Interior\n");
  4246. strcat(stringCat, "Alterar Status\n");
  4247. strcat(stringCat, "Alterar Título\n");
  4248. strcat(stringCat, "Mudar dono\n");
  4249. strcat(stringCat, "{FD0100}Vender casa\n");
  4250. strcat(stringCat, "{FD0100}Deletar casa\n");
  4251. ShowPlayerDialog(playerid, DIALOG_EDITAR_CASA, DIALOG_STYLE_LIST, "LIFE VIRTUAL RPG - CASAS", stringCat, "Selecionar", "Cancelar");
  4252. return 1;
  4253. }
  4254.  
  4255. ShowHouseMenu(playerid)
  4256. {
  4257. new house = GetProxHouse(playerid),
  4258. stringCat[1200];
  4259.  
  4260. if(!strcmp(CasaInfo[house][houseOwner], "Ninguem", true))
  4261. {
  4262. ShowPlayerDialog(playerid, DIALOG_HOUSE_SELL_MENU, DIALOG_STYLE_LIST, "LIFE VIRTUAL RPG - CASAS", "Comprar Casa\n", "Selecionar", "Cancelar");
  4263. TogglePlayerControllable(playerid, 0);
  4264. }
  4265.  
  4266. else if(!strcmp(CasaInfo[house][houseOwner], Nome(playerid), true))
  4267. {
  4268. strcat(stringCat, "{00FAF7}Entrar em casa\n");
  4269. strcat(stringCat, "{09FD00}Ativar{46FE00}/{FD0300}Desativar {FFFFFF}aluguel da casa\n");
  4270. strcat(stringCat, "{09FD00}Trancar{46FE00}/{FD0300}Destrancar {FFFFFF}a casa\n");
  4271. strcat(stringCat, "Vender sua casa\n");
  4272. strcat(stringCat, "Vender sua casa para um player\n");
  4273. strcat(stringCat, "Despejar Locador\n");
  4274. strcat(stringCat, "Alterar Título da casa\n");
  4275.  
  4276. ShowPlayerDialog(playerid, DIALOG_HOUSE_OWNER_MENU, DIALOG_STYLE_LIST, "LIFE VIRTUAL RPG - CASAS", stringCat, "Selecionar", "Cancelar");
  4277. TogglePlayerControllable(playerid, 0);
  4278. }
  4279. else if(strcmp(CasaInfo[house][houseOwner], Nome(playerid), true))
  4280. {
  4281. if(CasaInfo[house][houseRentable] == 1)
  4282. {
  4283. if(strcmp(CasaInfo[house][houseTenant], Nome(playerid), true))
  4284. {
  4285. strcat(stringCat, "{00FAF7}Entrar na casa\n");
  4286. strcat(stringCat, "Alugar casa\n");
  4287. ShowPlayerDialog(playerid, DIALOG_RENTING_GUEST, DIALOG_STYLE_LIST, "LIFE VIRTUAL RPG - CASAS", stringCat, "Selecionar", "Cancelar");
  4288. TogglePlayerControllable(playerid, 0);
  4289. return 1;
  4290. }
  4291.  
  4292. else
  4293. {
  4294. strcat(stringCat, "{00FAF7}Entrar em casa\n");
  4295. strcat(stringCat, "{09FD00}Trancar{46FE00}/{FD0300}Destrancar {FFFFFF}a casa\n");
  4296. strcat(stringCat, "{FD0100}Desalugar\n");
  4297. ShowPlayerDialog(playerid, DIALOG_HOUSE_TENANT_MENU, DIALOG_STYLE_LIST, "LIFE VIRTUAL RPG - CASAS", stringCat, "Selecionar", "Cancelar");
  4298. TogglePlayerControllable(playerid, 0);
  4299. }
  4300. }
  4301. else
  4302. {
  4303. ShowPlayerDialog(playerid, DIALOG_GUEST, DIALOG_STYLE_MSGBOX, "LIFE VIRTUAL RPG - CASAS", "{FFFFFF}Você deseja entrar nesta casa?", "Sim", "Não");
  4304. TogglePlayerControllable(playerid, 0);
  4305. return 1;
  4306. }
  4307. }
  4308.  
  4309. new logString[128];
  4310. format(logString, sizeof logString, "O jogador %s[%d], abriu o menu da casa %d.", playerName, playerid, house);
  4311. WriteLog(LOG_HOUSES, logString);
  4312. return 1;
  4313. }
  4314.  
  4315. ShowCreateHouseDialog(playerid)
  4316. {
  4317. if(!NivelRequerido(playerid, 5)) return 1;
  4318. new stringCat[1200];
  4319. strcat(stringCat, "Interior {FB1300}1 \t{FCEC00}6 {FFFFFF}Comodos \t\t{00EAFA}R$ 65.000,00 \n");
  4320. strcat(stringCat, "Interior {FB1300}2 \t{FCEC00}3 {FFFFFF}Comodos \t\t{00EAFA}R$ 37.000,00 \n");
  4321. strcat(stringCat, "Interior {FB1300}3 \t{FCEC00}3 {FFFFFF}Comodos \t\t{00EAFA}R$ 37.000,00 \n");
  4322. strcat(stringCat, "Interior {FB1300}4 \t{FCEC00}1 {FFFFFF}Comodo \t\t{00EAFA}R$ 20.000,00 \n");
  4323. strcat(stringCat, "Interior {FB1300}5 \t{FCEC00}1 {FFFFFF}Comodo \t\t{00EAFA}R$ 20.000,00 \n");
  4324. strcat(stringCat, "Interior {FB1300}6 \t{FCEC00}3 {FFFFFF}Comodos \t\t{00EAFA}R$ 150.000,00 {FFFFFF}| (Casa do CJ)\n");
  4325. strcat(stringCat, "Interior {FB1300}7 \t{FCEC00}5 {FFFFFF}Comodos \t\t{00EAFA}R$ 320.000,00 \n");
  4326. strcat(stringCat, "Interior {FB1300}8 \t{FCEC00}7 {FFFFFF}Comodos \t\t{00EAFA}R$ 120.000,00 \n");
  4327. strcat(stringCat, "Interior {FB1300}9 \t{FCEC00}4 {FFFFFF}Comodos \t\t{00EAFA}R$ 95.000,00 \n");
  4328. strcat(stringCat, "Interior {FB1300}10 \t{FCEC00}Muitos {FFFFFF}Comodos \t{00EAFA}R$ 1.200.000,00 {FFFFFF}| (Casa do Madd Dog)\n");
  4329. strcat(stringCat, "Interior {FB1300}11 \t{FCEC00}7 {FFFFFF}Comodos \t\t{00EAFA}R$ 660.000,00 \n");
  4330. ShowPlayerDialog(playerid, DIALOG_CRIAR_CASA, DIALOG_STYLE_LIST,"Criando Casa", stringCat, "Continuar", "Cancelar");
  4331. return 1;
  4332. }
  4333.  
  4334. CreateHouse(house, Float:PickupX, Float:PickupY, Float:PickupZ, Float:InteriorX, Float:InteriorY, Float:InteriorZ, Float:InteriorFA, houseValue, houseInt)
  4335. {
  4336. new file[100];
  4337. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  4338. if(!DOF2_FileExists(file))
  4339. {
  4340. format(CasaInfo[house][houseOwner], 24, "Ninguem");
  4341. format(CasaInfo[house][houseTenant], 24, "Ninguem");
  4342. format(CasaInfo[house][houseTitle], 32, "Título não definido");
  4343.  
  4344. CasaInfo[house][houseX] = PickupX;
  4345. CasaInfo[house][houseY] = PickupY;
  4346. CasaInfo[house][houseZ] = PickupZ;
  4347. CasaInfo[house][houseIntX] = InteriorX;
  4348. CasaInfo[house][houseIntY] = InteriorY;
  4349. CasaInfo[house][houseIntZ] = InteriorZ;
  4350. CasaInfo[house][houseIntFA] = InteriorFA;
  4351. CasaInfo[house][houseInterior] = houseInt;
  4352. CasaInfo[house][housePrice] = houseValue;
  4353. CasaInfo[house][houseVirtualWorld] = house;
  4354. CasaInfo[house][houseStatus] = 1;
  4355. CasaInfo[house][houseRentable] = 0;
  4356. CasaInfo[house][houseRentPrice] = 0;
  4357.  
  4358. DOF2_CreateFile(file);
  4359. DOF2_SetInt(file, "ID", house, "Informações");
  4360. DOF2_SetInt(file, "Preço", houseValue, "Informações");
  4361. DOF2_SetString(file, "Dono", "Ninguem", "Informações");
  4362. DOF2_SetString(file, "Título", "Título não definido", "Informações");
  4363. DOF2_SetInt(file, "Status", 1, "Informações");
  4364.  
  4365. DOF2_SetInt(file, "Aluguel Ativado", 0, "Aluguel");
  4366. DOF2_SetInt(file, "Preço do Aluguel", 0, "Aluguel");
  4367. DOF2_SetString(file, "Locador", "Ninguem", "Aluguel");
  4368.  
  4369. DOF2_SetInt(file, "Interior", houseInt, "Coordenadas");
  4370. DOF2_SetFloat(file, "Exterior X", PickupX, "Coordenadas");
  4371. DOF2_SetFloat(file, "Exterior Y", PickupY, "Coordenadas");
  4372. DOF2_SetFloat(file, "Exterior Z", PickupZ, "Coordenadas");
  4373. DOF2_SetFloat(file, "Interior X", InteriorX, "Coordenadas");
  4374. DOF2_SetFloat(file, "Interior Y", InteriorY, "Coordenadas");
  4375. DOF2_SetFloat(file, "Interior Z", InteriorZ, "Coordenadas");
  4376. DOF2_SetFloat(file, "Interior Facing Angle", InteriorFA, "Coordenadas");
  4377. DOF2_SetInt(file, "Virtual World", house, "Coordenadas");
  4378. DOF2_SaveFile();
  4379. }
  4380. else
  4381. {
  4382. CasaInfo[house][housePrice] = DOF2_GetInt(file, "Preço", "Informações");
  4383. format(CasaInfo[house][houseOwner], 24, DOF2_GetString(file, "Dono", "Informações"));
  4384. format(CasaInfo[house][houseTitle], 32, DOF2_GetString(file, "Título", "Informações"));
  4385. CasaInfo[house][houseStatus] = DOF2_GetInt(file, "Status", "Informações");
  4386.  
  4387. CasaInfo[house][houseRentable] = DOF2_GetInt(file, "Aluguel Ativado", "Aluguel");
  4388. CasaInfo[house][houseRentPrice] = DOF2_GetInt(file, "Preço do Aluguel", "Aluguel");
  4389. format(CasaInfo[house][houseTenant], 24, DOF2_GetString(file, "Locador", "Aluguel"));
  4390.  
  4391. CasaInfo[house][houseX] = DOF2_GetFloat(file, "Exterior X", "Coordenadas");
  4392. CasaInfo[house][houseY] = DOF2_GetFloat(file, "Exterior Y", "Coordenadas");
  4393. CasaInfo[house][houseZ] = DOF2_GetFloat(file, "Exterior Z", "Coordenadas");
  4394. CasaInfo[house][houseIntX] = DOF2_GetFloat(file, "Interior X", "Coordenadas");
  4395. CasaInfo[house][houseIntY] = DOF2_GetFloat(file, "Interior Y", "Coordenadas");
  4396. CasaInfo[house][houseIntZ] = DOF2_GetFloat(file, "Interior Z", "Coordenadas");
  4397. CasaInfo[house][houseInterior] = DOF2_GetInt(file, "Interior", "Coordenadas");
  4398. CasaInfo[house][houseVirtualWorld] = DOF2_GetInt(file, "Virtual World", "Coordenadas");
  4399.  
  4400. }
  4401.  
  4402. new
  4403. houseStatusName[20],
  4404. houseRentName[20],
  4405. textlabel[200];
  4406.  
  4407. if(!strcmp(CasaInfo[house][houseOwner], "Ninguem", true))
  4408. {
  4409. housePickupIn[house] = CreateDynamicPickup(1273, 1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  4410. housePickupOut[house] = CreateDynamicPickup(1318, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  4411. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 31, -1, -1, 0, -1, 100.0);
  4412. if(CasaInfo[house][houseStatus] == 1) houseStatusName = "Trancada";
  4413. else if(CasaInfo[house][houseStatus] == 0) houseStatusName = "Destrancada";
  4414. format(textlabel, sizeof textlabel, TEXT_SELLING_HOUSE, house, CasaInfo[house][housePrice]);
  4415. houseLabel[house] = CreateDynamic3DTextLabel(textlabel, -1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 20.0);
  4416. }
  4417. else
  4418. {
  4419. if(CasaInfo[house][houseRentable] == 1)
  4420. {
  4421. housePickupIn[house] = CreateDynamicPickup(1272, 1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  4422. housePickupOut[house] = CreateDynamicPickup(1318, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  4423. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 32, -1, -1, 0, -1, 100.0);
  4424. if(CasaInfo[house][houseStatus] == 1) houseStatusName = "Trancada";
  4425. else if(CasaInfo[house][houseStatus] == 0) houseStatusName = "Destrancada";
  4426. format(textlabel, sizeof textlabel, TEXT_RENT_HOUSE, CasaInfo[house][houseTitle], CasaInfo[house][houseOwner], CasaInfo[house][houseTenant], CasaInfo[house][houseRentPrice], houseStatusName, house);
  4427. houseLabel[house] = CreateDynamic3DTextLabel(textlabel, -1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 20.0);
  4428. return 1;
  4429. }
  4430. else
  4431. {
  4432. housePickupIn[house] = CreateDynamicPickup(1272, 1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  4433. housePickupOut[house] = CreateDynamicPickup(1318, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  4434. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 32, -1, -1, 0, -1, 100.0);
  4435. if(CasaInfo[house][houseStatus] == 1) houseStatusName = "Trancada";
  4436. else if(CasaInfo[house][houseStatus] == 0) houseStatusName = "Destrancada";
  4437. if(CasaInfo[house][houseRentable] == 1) houseRentName = "Ativado";
  4438. else if(CasaInfo[house][houseRentable] == 0) houseRentName = "Desativado";
  4439. format(textlabel, sizeof textlabel, TEXT_HOUSE, CasaInfo[house][houseTitle], CasaInfo[house][houseOwner], houseRentName, houseStatusName, house);
  4440. houseLabel[house] = CreateDynamic3DTextLabel(textlabel, -1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 20.0);
  4441. return 1;
  4442. }
  4443. }
  4444.  
  4445. new logString[128];
  4446. format(logString, sizeof logString, "-------- A CASA DE ID %d FOI CRIADA COM SUCESSO! --------", house);
  4447. WriteLog(LOG_SYSTEM, logString);
  4448. return 1;
  4449. }
  4450.  
  4451. forward SaveHouses();
  4452. public SaveHouses()
  4453. {
  4454. new file[200];
  4455. for(new house = 1; house < MAX_CASAS; house++)
  4456. {
  4457. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  4458. if(DOF2_FileExists(file))
  4459. {
  4460. DOF2_SetInt(file, "ID", house, "Informações");
  4461. DOF2_SetInt(file, "Preço", CasaInfo[house][housePrice], "Informações");
  4462. DOF2_SetString(file, "Dono", CasaInfo[house][houseOwner], "Informações");
  4463. DOF2_SetString(file, "Título", CasaInfo[house][houseTitle], "Informações");
  4464. DOF2_SetInt(file, "Status", CasaInfo[house][houseStatus], "Informações");
  4465.  
  4466. DOF2_SetString(file, "Locador", CasaInfo[house][houseTenant], "Aluguel");
  4467. DOF2_SetInt(file, "Aluguel Ativado", CasaInfo[house][houseRentable], "Aluguel");
  4468. DOF2_SetInt(file, "Preço do Aluguel", CasaInfo[house][houseRentPrice], "Aluguel");
  4469.  
  4470. DOF2_SetInt(file, "Interior", CasaInfo[house][houseInterior], "Coordenadas");
  4471. DOF2_SetFloat(file, "Exterior X", CasaInfo[house][houseX], "Coordenadas");
  4472. DOF2_SetFloat(file, "Exterior Y", CasaInfo[house][houseY], "Coordenadas");
  4473. DOF2_SetFloat(file, "Exterior Z", CasaInfo[house][houseZ], "Coordenadas");
  4474. DOF2_SetFloat(file, "Interior X", CasaInfo[house][houseIntX], "Coordenadas");
  4475. DOF2_SetFloat(file, "Interior Y", CasaInfo[house][houseIntY], "Coordenadas");
  4476. DOF2_SetFloat(file, "Interior Z", CasaInfo[house][houseIntZ], "Coordenadas");
  4477. DOF2_SetFloat(file, "Interior Facing Angle", CasaInfo[house][houseIntFA], "Coordenadas");
  4478. DOF2_SetInt(file, "Virtual World", CasaInfo[house][houseVirtualWorld], "Coordenadas");
  4479. DOF2_SaveFile();
  4480. return 1;
  4481. }
  4482. }
  4483. return 1;
  4484. }
  4485.  
  4486. forward SaveHouse(house);
  4487. public SaveHouse(house)
  4488. {
  4489. new file[200];
  4490. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  4491. if(DOF2_FileExists(file))
  4492. {
  4493. DOF2_SetInt(file, "ID", house, "Informações");
  4494. DOF2_SetInt(file, "Preço", CasaInfo[house][housePrice], "Informações");
  4495. DOF2_SetString(file, "Dono", CasaInfo[house][houseOwner], "Informações");
  4496. DOF2_SetString(file, "Título", CasaInfo[house][houseTitle], "Informações");
  4497. DOF2_SetInt(file, "Status", CasaInfo[house][houseStatus], "Informações");
  4498.  
  4499. DOF2_SetString(file, "Locador", CasaInfo[house][houseTenant], "Aluguel");
  4500. DOF2_SetInt(file, "Aluguel Ativado", CasaInfo[house][houseRentable], "Aluguel");
  4501. DOF2_SetInt(file, "Preço do Aluguel", CasaInfo[house][houseRentPrice], "Aluguel");
  4502.  
  4503. DOF2_SetInt(file, "Interior", CasaInfo[house][houseInterior], "Coordenadas");
  4504. DOF2_SetFloat(file, "Exterior X", CasaInfo[house][houseX], "Coordenadas");
  4505. DOF2_SetFloat(file, "Exterior Y", CasaInfo[house][houseY], "Coordenadas");
  4506. DOF2_SetFloat(file, "Exterior Z", CasaInfo[house][houseZ], "Coordenadas");
  4507. DOF2_SetFloat(file, "Interior X", CasaInfo[house][houseIntX], "Coordenadas");
  4508. DOF2_SetFloat(file, "Interior Y", CasaInfo[house][houseIntY], "Coordenadas");
  4509. DOF2_SetFloat(file, "Interior Z", CasaInfo[house][houseIntZ], "Coordenadas");
  4510. DOF2_SetFloat(file, "Interior Facing Angle", CasaInfo[house][houseIntFA], "Coordenadas");
  4511. DOF2_SetInt(file, "Virtual World", CasaInfo[house][houseVirtualWorld], "Coordenadas");
  4512. DOF2_SaveFile();
  4513. return 1;
  4514. }
  4515. return 1;
  4516. }
  4517.  
  4518. GetProxHouse(playerid)
  4519. {
  4520. for(new i = 1; i < MAX_CASAS; i++)
  4521. {
  4522. if(IsPlayerInRangeOfPoint(playerid, 2, CasaInfo[i][houseX], CasaInfo[i][houseY], CasaInfo[i][houseZ]))
  4523. {
  4524. return i;
  4525. }
  4526. else if(IsPlayerInRangeOfPoint(playerid, 2, CasaInfo[i][houseIntX], CasaInfo[i][houseIntY], CasaInfo[i][houseIntZ]))
  4527. {
  4528. return i;
  4529. }
  4530. }
  4531. return -255;
  4532. }
  4533.  
  4534. CriarTodasAsCasas()
  4535. {
  4536. new
  4537. housesCreated,
  4538. file[200],
  4539. houseStatusName[20],
  4540. textlabel[250],
  4541. houseRentName[20],
  4542. logString[700];
  4543.  
  4544. for(new house = 1; house < MAX_CASAS; house++)
  4545. {
  4546. format(file, sizeof file, "Casas/Casas/Casa %d.ini", house);
  4547.  
  4548. if(DOF2_FileExists(file))
  4549. {
  4550. CasaInfo[house][housePrice] = DOF2_GetInt(file, "Preço", "Informações");
  4551. CasaInfo[house][houseStatus] = DOF2_GetInt(file, "Status", "Informações");
  4552. format(CasaInfo[house][houseOwner], 24, DOF2_GetString(file, "Dono", "Informações"));
  4553. format(CasaInfo[house][houseTitle], 32, DOF2_GetString(file, "Título", "Informações"));
  4554.  
  4555. CasaInfo[house][houseRentable] = DOF2_GetInt(file, "Aluguel Ativado", "Aluguel");
  4556. CasaInfo[house][houseRentPrice] = DOF2_GetInt(file, "Preço do Aluguel", "Aluguel");
  4557. format(CasaInfo[house][houseTenant], 24, DOF2_GetString(file, "Locador", "Aluguel"));
  4558.  
  4559. CasaInfo[house][houseX] = DOF2_GetFloat(file, "Exterior X", "Coordenadas");
  4560. CasaInfo[house][houseY] = DOF2_GetFloat(file, "Exterior Y", "Coordenadas");
  4561. CasaInfo[house][houseZ] = DOF2_GetFloat(file, "Exterior Z", "Coordenadas");
  4562. CasaInfo[house][houseIntX] = DOF2_GetFloat(file, "Interior X", "Coordenadas");
  4563. CasaInfo[house][houseIntY] = DOF2_GetFloat(file, "Interior Y", "Coordenadas");
  4564. CasaInfo[house][houseIntZ] = DOF2_GetFloat(file, "Interior Z", "Coordenadas");
  4565. CasaInfo[house][houseVirtualWorld] = DOF2_GetInt(file, "Virtual World", "Coordenadas");
  4566. CasaInfo[house][houseInterior] = DOF2_GetInt(file, "Interior", "Coordenadas");
  4567.  
  4568. if(CasaInfo[house][houseStatus] == 1)
  4569. houseStatusName = "Trancada";
  4570.  
  4571. else if(CasaInfo[house][houseStatus] == 0)
  4572. houseStatusName = "Destrancada";
  4573.  
  4574. if(CasaInfo[house][houseRentable] == 1)
  4575. houseRentName = "Ativado";
  4576.  
  4577. else if(CasaInfo[house][houseRentable] == 0)
  4578. houseRentName = "Desativado";
  4579.  
  4580. housesCreated++;
  4581.  
  4582. format(logString, sizeof logString, "-------- A CASA DE ID %d FOI CRIADA COM SUCESSO! --------", house);
  4583. WriteLog(LOG_SYSTEM, logString);
  4584.  
  4585. if(!strcmp(CasaInfo[house][houseOwner], "Ninguem", true))
  4586. {
  4587. housePickupIn[house] = CreateDynamicPickup(1273, 1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  4588. housePickupOut[house] = CreateDynamicPickup(1318, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  4589. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 31, -1, -1, 0, -1, 100.0);
  4590. format(textlabel, sizeof textlabel, TEXT_SELLING_HOUSE, house, CasaInfo[house][housePrice]);
  4591. houseLabel[house] = CreateDynamic3DTextLabel(textlabel, -1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 20.0);
  4592. }
  4593. else
  4594. {
  4595. if(CasaInfo[house][houseRentable] == 1)
  4596. {
  4597. housePickupIn[house] = CreateDynamicPickup(1272, 1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  4598. housePickupOut[house] = CreateDynamicPickup(1318, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  4599. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 32, -1, -1, 0, -1, 100.0);
  4600. format(textlabel, sizeof textlabel, TEXT_RENT_HOUSE, CasaInfo[house][houseTitle], CasaInfo[house][houseOwner], CasaInfo[house][houseTenant], CasaInfo[house][houseRentPrice], houseStatusName, house);
  4601. houseLabel[house] = CreateDynamic3DTextLabel(textlabel, -1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 20.0);
  4602. }
  4603. else
  4604. {
  4605. housePickupIn[house] = CreateDynamicPickup(1272, 1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  4606. housePickupOut[house] = CreateDynamicPickup(1318, 1, CasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
  4607. houseMapIcon[house] = CreateDynamicMapIcon(CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 32, -1, -1, 0, -1, 100.0);
  4608. format(textlabel, sizeof textlabel, TEXT_HOUSE, CasaInfo[house][houseTitle], CasaInfo[house][houseOwner], houseRentName, houseStatusName, house);
  4609. houseLabel[house] = CreateDynamic3DTextLabel(textlabel, -1, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ], 20.0);
  4610. }
  4611. }
  4612. }
  4613. }
  4614. if(housesCreated == 0)
  4615. {
  4616. print("Não foi detectado nenhuma casa criada");
  4617. }
  4618. else
  4619. {
  4620. printf("Foram criadas %d casas", housesCreated);
  4621. }
  4622. return 1;
  4623. }
  4624.  
  4625. IsNumeric(const string[])
  4626. {
  4627. for (new i = 0, j = strlen(string); i < j; i++)
  4628. {
  4629. if (string[i] > '9' || string[i] < '0') return 0;
  4630. }
  4631. return 1;
  4632. }
  4633.  
  4634. Update3DText(house)
  4635. {
  4636. new houseRentName[20], textlabel[200], houseStatusName[20];
  4637. if(!strcmp(CasaInfo[house][houseOwner], "Ninguem", true))
  4638. {
  4639. if(CasaInfo[house][houseStatus] == 1)
  4640. houseStatusName = "Trancada";
  4641.  
  4642. else if(CasaInfo[house][houseStatus] == 0)
  4643. houseStatusName = "Destrancada";
  4644.  
  4645. format(textlabel, sizeof textlabel, TEXT_SELLING_HOUSE, house, CasaInfo[house][housePrice]);
  4646. UpdateDynamic3DTextLabelText(houseLabel[house], -1, textlabel);
  4647. return 1;
  4648. }
  4649.  
  4650. else if(strcmp(CasaInfo[house][houseOwner], "Ninguem", true))
  4651. {
  4652. if(CasaInfo[house][houseRentable] == 1)
  4653. {
  4654. if(CasaInfo[house][houseStatus] == 1)
  4655. houseStatusName = "Trancada";
  4656.  
  4657. else if(CasaInfo[house][houseStatus] == 0)
  4658. houseStatusName = "Destrancada";
  4659.  
  4660. format(textlabel, sizeof textlabel, TEXT_RENT_HOUSE, CasaInfo[house][houseTitle], CasaInfo[house][houseOwner], CasaInfo[house][houseTenant], CasaInfo[house][houseRentPrice], houseStatusName, house);
  4661. UpdateDynamic3DTextLabelText(houseLabel[house], -1, textlabel);
  4662. return 1;
  4663. }
  4664. else
  4665. {
  4666. if(CasaInfo[house][houseStatus] == 1)
  4667. houseStatusName = "Trancada";
  4668.  
  4669. else if(CasaInfo[house][houseStatus] == 0)
  4670. houseStatusName = "Destrancada";
  4671.  
  4672. if(CasaInfo[house][houseRentable] == 1)
  4673. houseRentName = "Ativado";
  4674.  
  4675. else if(CasaInfo[house][houseRentable] == 0)
  4676. houseRentName = "Desativado";
  4677.  
  4678. format(textlabel, sizeof textlabel, TEXT_HOUSE, CasaInfo[house][houseTitle], CasaInfo[house][houseOwner], houseRentName, houseStatusName, house);
  4679. UpdateDynamic3DTextLabelText(houseLabel[house], -1, textlabel);
  4680. return 1;
  4681. }
  4682. }
  4683. return 1;
  4684. }
  4685.  
  4686. GetTenantID(house)
  4687. {
  4688. new tenantID;
  4689. for(new s = GetMaxPlayers(), i; i < s; i++)
  4690. {
  4691. if(!strcmp(Nome(i), CasaInfo[house][houseTenant], true))
  4692. {
  4693. if (IsPlayerConnected(i))
  4694. {
  4695. tenantID = i;
  4696. break;
  4697. } else {
  4698. tenantID = -255;
  4699. }
  4700. }
  4701. }
  4702. return tenantID;
  4703. }
  4704.  
  4705. // vips
  4706. stock CriarKey(playerid, Key[], Leveis)
  4707. {
  4708. new stringV[70];
  4709. format(stringV, sizeof stringV, VIP_KEYS, Key);
  4710. if(DOF2_FileExists(stringV)) return Msg(playerid, VERMELHO, "ERRO: Key ja existente.");
  4711. if(Leveis <= 0) return Msg(playerid, VERMELHO, "ERRO: Não pode ser criada uma Key com 0 leveis.");
  4712.  
  4713. DOF2_CreateFile(stringV);
  4714. DOF2_SetInt(stringV, "LEVEIS", Leveis);
  4715. DOF2_SaveFile();
  4716.  
  4717. Msg(playerid, LARANJA, "KEY: Nova Key VIP criada.");
  4718. format(String, sizeof String, "KEY: [%s] -- LEVEIS: [%d]", Key, Leveis);
  4719. Msg(playerid, LARANJA, String);
  4720. return 1;
  4721. }
  4722.  
  4723. stock SetarVip(playerid, Leveis)
  4724. {
  4725. new stringV[60];
  4726. if(PlayerInfo[playerid][pVip] > 0)
  4727. {
  4728. format(stringV, sizeof stringV, "LV VIP: Seu VIP foi renovado. + %d leveis.", Leveis);
  4729. PlayerInfo[playerid][TempoVip] += Leveis;
  4730. } else {
  4731. format(stringV, sizeof stringV, "LV VIP: Seu VIP foi ativado. %d leveis. /ComandosVip", Leveis);
  4732. PlayerInfo[playerid][TempoVip] = Leveis;
  4733. }
  4734. Msg(playerid, COR_VIP, stringV);
  4735. PlayerInfo[playerid][pVip] = 1;
  4736. return 1;
  4737. }
  4738.  
  4739. // vips
  4740. CMD:ativarvip(playerid)
  4741. {
  4742. ShowPlayerDialog(playerid, DIALOG_ATIVAR_KEY, DIALOG_STYLE_INPUT, "LIFE VIRTUAL RPG - VIP", "\nNos informe sua key para ativar seu beneficio VIP:\n\n", "Ativar", "Sair");
  4743. return 1;
  4744. }
  4745.  
  4746. CMD:staff(playerid, params[])
  4747. {
  4748. new Ajuda[1500];
  4749. if((PlayerInfo[playerid][pAdmin] == 0) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin ou helper para usar este comando!");
  4750. if(PlayerInfo[playerid][pHelper] == 1)//HELPER
  4751. {
  4752. strcat(Ajuda,"{FFFFFF}Helper\n{FFEA03}/Hc - /Ir - /Trazer - /Particular - /DarTerrestre\n/DarAera - /DarNautica - /Afk - /SairAfk - /Responder\n\n");
  4753. }
  4754. if(PlayerInfo[playerid][pAdmin] > 0)//NIVEL 1
  4755. {
  4756. strcat(Ajuda, "{FFFFFF}Nivel 1\n{4CFA1B}/Ir - /Trazer - /Verip - /Avisar - /Destrancarcarros - /DarTerrestre - /DarAera - /DarNautica\n/Kickar - /Tapa - /Assistir - /pAssistir - /Particular - /Afk - /SairAfk - /LimparChat\n/Banir - /Desbanir - /BanirIP - /DesbanirIP - /Ac\n\n");
  4757. }
  4758. if(PlayerInfo[playerid][pAdmin] > 1)//NIVEL 2
  4759. {
  4760. strcat(Ajuda, "{FFFFFF}Nivel 2\n{0C9E05}/Advertir - /Ir - /Trazer - /Congelar - /Descongelar - /Dararma - /Desarmar\n/CV - /Respawn - /DestruirCarro - /SetarVida - /SetarColete - /Jetpack - /TrazerTodos - /MoverPlayer - /PosPlayer\n/Blindar - /Desblindar\n\n");
  4761. }
  4762. if(PlayerInfo[playerid][pAdmin] > 2)//NIVEL 3
  4763. {
  4764. strcat(Ajuda, "{FFFFFF}Nivel 3\n{11CFCF}/SetarSkin - /Clima - /GodMode - /Ejetar - /Falar - /Crash - /SetarPos - /VerPos\n/Barril - /dBarris - /Tempo - /Enquete - /Disfarce - /SairDisfarce - /KickSecreto - /BanSecreto\n\n");
  4765. }
  4766. if(PlayerInfo[playerid][pAdmin] > 3)//NIVEL 4
  4767. {
  4768. strcat(Ajuda, "{FFFFFF}Nivel 4\n{1170CF}/KickarTodos - /DesarmarTodos - /GMX - /Invisivel - /Visivel - /CongelarTodos\n/DescongelarTodos - /MatarTodos - /DarVip - /TirarVip - /SetGasolina - /SetProf\nSetLevel - /DarLevel\n\n");
  4769. }
  4770. if(PlayerInfo[playerid][pAdmin] > 4)//NIVEL 5
  4771. {
  4772. strcat(Ajuda, "{FFFFFF}Nivel 5\n{FA0505}/DarAdmin - /SetarGravidade - /DarHelper - /TirarHelper - /DarGalao\n/TrancarServer - /DestrancarServer - /CriarCasa - /IrCasa\n\n");
  4773. }
  4774. ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_MSGBOX, "LV ADMIN - Ajuda", Ajuda, "Fechar", "");
  4775. return 1;
  4776. }
  4777.  
  4778.  
  4779. // Comandos Helper
  4780.  
  4781. CMD:hc(playerid, params[])
  4782. {
  4783. if(PlayerInfo[playerid][pHelper] == 0) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser helper para usar esse comando.");
  4784. new Texto[128];
  4785. if(sscanf(params, "s", Texto)) return MensagemDupla(playerid, "Use /hc [Texto]", "Use o comando para usar o chat particular de helper.");
  4786. format(String, sizeof(String), "{FFA500}(CHAT-HELPER) %s(%d) diz: %s", Nome(playerid), playerid, Texto);
  4787. ChatHelper(-1, String, 1);
  4788. return 1;
  4789. }
  4790.  
  4791. CMD:responder(playerid, params[])
  4792. {
  4793. if(PlayerInfo[playerid][pHelper] == 0) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser helper para usar esse comando.");
  4794. new texto[128];
  4795. if(sscanf(params, "us", ID, texto)) return MensagemDupla(playerid, "LV HELPER: Use /responder [playerid] [resposta]", "Use o comando para responder uma /duvida.");
  4796. if(strcmp(Pergunta[ID], "Nenhuma", true) == 0) return Msg(playerid, CINZA, "O jogador não fez nenhuma pergunta.");
  4797. format(String, sizeof String, "LV HELPER: Resposta do Helper %s da sua pergunta: %s", Nome(playerid), Pergunta[ID]);
  4798. Msg(ID, AMARELO, String);
  4799. format(String, sizeof String, "%s", texto);
  4800. Msg(ID, AMARELO, String);
  4801. format(String, sizeof(String), "Resposta enviada com sucesso para %s [ID: %d]", Nome(ID), ID);
  4802. Msg(playerid, VERDE_CLARO, String);
  4803. Pergunta[ID] = "Nenhuma";
  4804. return 1;
  4805. }
  4806.  
  4807. CMD:daraerea(playerid, params[])
  4808. {
  4809. new EXP;
  4810. if((PlayerInfo[playerid][pAdmin] < 1) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin ou helper para usar este comando!");
  4811. if(sscanf(params, "ui", ID, EXP)) return Msg(playerid, CINZA, "LV ADMIN: Use /daraerea [ID] [EXP]"), Msg(playerid, CINZA, "Use o comando para dar habilitação aerea a um jogador");
  4812. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  4813. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te deu habilitação aerea com EXP de %d.", Nome(playerid), EXP);
  4814. Msg(ID, AZUL_CLARO, String);
  4815. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  4816. PlayerInfo[playerid][HabAerea] = EXP;
  4817. return 1;
  4818. }
  4819.  
  4820. CMD:darnautica(playerid, params[])
  4821. {
  4822. if((PlayerInfo[playerid][pAdmin] < 1) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin ou helper para usar este comando!");
  4823. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /darnautica [ID]"), Msg(playerid, CINZA, "Use o comando para dar habilitação nautica a um jogador");
  4824. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  4825. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te deu habilitação nautica.", Nome(playerid));
  4826. Msg(ID, AZUL_CLARO, String);
  4827. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  4828. PlayerInfo[playerid][HabNautica] = 1;
  4829. return 1;
  4830. }
  4831.  
  4832. CMD:darterrestre(playerid, params[])
  4833. {
  4834. if((PlayerInfo[playerid][pAdmin] < 1) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin ou helper para usar este comando!");
  4835. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /darterrestre [ID]"), Msg(playerid, CINZA, "Use o comando para dar habilitação terrestre a um jogador");
  4836. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  4837. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te deu habilitação terrestre.", Nome(playerid));
  4838. Msg(ID, AZUL_CLARO, String);
  4839. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  4840. PlayerInfo[playerid][HabTerrestre] = 1;
  4841. return 1;
  4842. }
  4843.  
  4844. CMD:afk(playerid)
  4845. {
  4846. if((PlayerInfo[playerid][pAdmin] < 1) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin ou helper para usar este comando!");
  4847. TogglePlayerSpectating(playerid, true);
  4848. GetPlayerHealth(playerid, VidaAFK);
  4849. SetPlayerHealth(playerid, 99999);
  4850. TogglePlayerControllable(playerid, false);
  4851. PlayerInfo[playerid][pAfk] = 1;
  4852. if(PlayerInfo[playerid][pHelper] == 1)
  4853. {
  4854. format(String, sizeof(String), "LV HELPER: O Helper {1B95E0}%s{00C2EC} Está AFK. Veja em /helpers", Nome(playerid));
  4855. MsgAll(AZUL_CLARO, String);
  4856. }
  4857. if(PlayerInfo[playerid][pAdmin] > 0)
  4858. {
  4859. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Está AFK. Veja em /admins", Nome(playerid));
  4860. MsgAll(AZUL_CLARO, String);
  4861. }
  4862. Msg(playerid, CINZA, "Use /sairafk para sair do Afk.");
  4863. return 1;
  4864. }
  4865.  
  4866. CMD:sairafk(playerid)
  4867. {
  4868. if((PlayerInfo[playerid][pAdmin] < 1) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin ou helper para usar este comando!");
  4869. TogglePlayerSpectating(playerid, false);
  4870. SetPlayerHealth(playerid, VidaAFK);
  4871. TogglePlayerControllable(playerid, true);
  4872. PlayerInfo[playerid][pAfk] = 0;
  4873. if(PlayerInfo[playerid][pHelper] == 1)
  4874. {
  4875. format(String, sizeof(String), "LV HELPER: O Helper {1B95E0}%s{00C2EC}não está mais AFK. Veja em /helpers", Nome(playerid));
  4876. MsgAll(AZUL_CLARO, String);
  4877. }
  4878. if(PlayerInfo[playerid][pAdmin] > 0)
  4879. {
  4880. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC}não está mais AFK. Veja em /admins", Nome(playerid));
  4881. MsgAll(AZUL_CLARO, String);
  4882. }
  4883. return 1;
  4884. }
  4885.  
  4886. CMD:particular(playerid, params[])
  4887. {
  4888. if((PlayerInfo[playerid][pAdmin] < 1) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin ou helper para usar este comando!");
  4889. new t[128];
  4890. if(sscanf(params, "us", ID, t)) return MensagemDupla(playerid, "LV ADMIN: Use /particular [ID] [texto]", "Use o comando para mandar uma mensagem particular para um jogador.");
  4891. format(String, sizeof(String), "LV: Particular de {E0D01B}%s{FFFF00}: %s", Nome(playerid), t);
  4892. Msg(ID, AMARELO, String);
  4893. format(String, sizeof(String), "Particular enviada com sucesso para %s", Nome(ID));
  4894. Msg(playerid, AMARELO, String);
  4895. return 1;
  4896. }
  4897.  
  4898. CMD:ir(playerid, params[])
  4899. {
  4900. if((PlayerInfo[playerid][pAdmin] < 2) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin nivel 2 ou helper para usar este comando!");
  4901. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /ir [ID]"), Msg(playerid, CINZA, "Use o comando para ir até um jogador");
  4902. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  4903. new Float:Pos[3];
  4904. GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
  4905. if(IsPlayerInAnyVehicle(playerid))
  4906. {
  4907. new carroid = GetPlayerVehicleID(playerid);
  4908. SetVehiclePos(carroid, Pos[0], Pos[1], Pos[2]);
  4909. format(String, sizeof(String), "LV ADMIN: O Admin %s veio até você!", Nome(playerid));
  4910. if(PlayerInfo[playerid][pHelper])
  4911. {
  4912. format(String, sizeof(String), "LV HELPER: O Helper %s veio até você!", Nome(playerid));
  4913. }
  4914. Msg(ID, AZUL_CLARO, String);
  4915. format(String, sizeof(String), "Você foi até o Jogador %s [ID: %d]", Nome(ID), ID);
  4916. Msg(playerid, AZUL_CLARO, String);
  4917. return 1;
  4918. }
  4919. SetPlayerPos(playerid, Pos[0]+2, Pos[1]+2, Pos[2]+2);
  4920. format(String, sizeof(String), "LV ADMIN: O Admin %s veio até você!", Nome(playerid));
  4921. if(PlayerInfo[playerid][pHelper])
  4922. {
  4923. format(String, sizeof(String), "LV HELPER: O Helper %s veio até você!", Nome(playerid));
  4924. }
  4925. Msg(ID, AZUL_CLARO, String);
  4926. format(String, sizeof(String), "Você foi até o Jogador %s [ID: %d]", Nome(ID), ID);
  4927. Msg(playerid, AZUL_CLARO, String);
  4928. return 1;
  4929. }
  4930.  
  4931. CMD:trazer(playerid, params[])
  4932. {
  4933. if((PlayerInfo[playerid][pAdmin] < 2) && (PlayerInfo[playerid][pHelper] == 0)) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você precisa ser admin nivel 2 ou helper para usar este comando!");
  4934. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /trazer [ID]"), Msg(playerid, CINZA, "Use o comando para trazer um jogador até você");
  4935. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  4936. new Float:Pos[3];
  4937. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  4938. if(IsPlayerInAnyVehicle(ID))
  4939. {
  4940. new carroid = GetPlayerVehicleID(ID);
  4941. SetVehiclePos(carroid, Pos[0]+2, Pos[1]+2, Pos[2]+2);
  4942. format(String, sizeof(String), "LV ADMIN: O Admin %s trouxe você até ele!", Nome(playerid));
  4943. if(PlayerInfo[playerid][pHelper])
  4944. {
  4945. format(String, sizeof(String), "LV HELPER: O Helper %s trouxe você até ele!", Nome(playerid));
  4946. }
  4947. Msg(ID, AZUL_CLARO, String);
  4948. format(String, sizeof(String), "Você trouxe o jogador %s [ID: %d] até você", Nome(ID), ID);
  4949. Msg(playerid, AZUL_CLARO, String);
  4950. return 1;
  4951. }
  4952. SetPlayerPos(ID, Pos[0]+2, Pos[1]+2, Pos[2]+2);
  4953. format(String, sizeof(String), "LV ADMIN: O Admin %s trouxe você até ele!", Nome(playerid));
  4954. if(PlayerInfo[playerid][pHelper])
  4955. {
  4956. format(String, sizeof(String), "LV HELPER: O Helper %s trouxe você até ele!", Nome(playerid));
  4957. }
  4958. Msg(ID, AZUL_CLARO, String);
  4959. format(String, sizeof(String), "Você trouxe o jogador %s [ID: %d] até você", Nome(ID), ID);
  4960. Msg(playerid, AZUL_CLARO, String);
  4961. return 1;
  4962. }
  4963.  
  4964. // ========================================================================================================
  4965.  
  4966. // Comandos admin nivel 1
  4967. CMD:pref(playerid)
  4968. {
  4969. if(!NivelRequerido(playerid, 1)) return 1;
  4970. SetPlayerInterior(playerid, 0);
  4971. SetPlayerPos(playerid,2005.4229,1545.0281,13.5859);
  4972. return 1;
  4973. }
  4974.  
  4975. CMD:ac(playerid, params[])
  4976. {
  4977. if(!NivelRequerido(playerid, 1)) return 1;
  4978. new Texto[128];
  4979. if(sscanf(params, "s", Texto)) return MensagemDupla(playerid, "Use /ac [Texto]", "Use o comando para usar o chat particular de admin.");
  4980. format(String, sizeof(String), "(CHAT-ADMIN) %s(%d) diz: %s", Nome(playerid), playerid, Texto);
  4981. ChatAdmin(LARANJA, String, 1);
  4982. WriteLog(LOG_CHAT, String);
  4983. return 1;
  4984. }
  4985.  
  4986. CMD:banir(playerid, params[])
  4987. {
  4988. if(!NivelRequerido(playerid, 1)) return 1;
  4989. new Motivo[64], string[200];
  4990. if(sscanf(params, "us", ID, Motivo)) return Msg(playerid, CINZA, "LV ADMIN: Use /banir [ID] [Motivo]");
  4991. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  4992.  
  4993. new dia, mes, ano, hora, minutos, segundos;
  4994. if(strlen(Motivo) > 64) return 0;
  4995. getdate(dia, mes, ano);
  4996. gettime(hora, minutos, segundos);
  4997. format(String, 32, "%02d/%02d/%d - %02d:%02d:%02d", dia, mes, ano, hora, minutos, segundos);
  4998.  
  4999. format(string, sizeof(string), BANIDOS, Nome(ID));
  5000. DOF2_CreateFile(string);
  5001. DOF2_SetString(string, "Admin", Nome(playerid));
  5002. DOF2_SetString(string, "Motivo", Motivo);
  5003. DOF2_SetString(string, "DataeHora", String);
  5004. DOF2_SetString(string, "IP", IP(playerid));
  5005. DOF2_SaveFile();
  5006.  
  5007. format(String, sizeof String, "LV ADMIN: O Admin %s baniu o jogador %s, Motivo: (%s)", Nome(playerid), Nome(ID), Motivo);
  5008. MsgAll(VERMELHO, String);
  5009. WriteLog(LOG_BAN, String);
  5010. SetTimerEx("Kickar", 100, false, "i", ID);
  5011. return 1;
  5012. }
  5013.  
  5014. CMD:desbanir(playerid, params[])
  5015. {
  5016. if(!NivelRequerido(playerid, 1)) return 1;
  5017. if(sscanf(params, "s", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /desbanir [Nick]");
  5018.  
  5019. new string[40];
  5020. format(string, sizeof(string), BANIDOS, Nome(ID));
  5021. if(!DOF2_FileExists(string)) return Msg(playerid, VERMELHO, "ERRO: Essa conta não esta banida.");
  5022. DOF2_RemoveFile(string);
  5023. format(String, sizeof(String), "LV ADMIN: Você desbaniu a conta {1B95E0}%s{00C2EC} com sucesso!", Nome(ID));
  5024. Msg(playerid, VERMELHO, String);
  5025.  
  5026. new Log[50];
  5027. format(Log, sizeof(Log), "LV ADMIN: %s desbaniu a conta de %s!", Nome(playerid), Nome(ID));
  5028. WriteLog(LOG_DESBAN, Log);
  5029. return 1;
  5030. }
  5031.  
  5032. CMD:banirip(playerid, params[])
  5033. {
  5034. if(!NivelRequerido(playerid, 1)) return 1;
  5035. new Motivo[64], string[100];
  5036. if(sscanf(params, "is", ID, Motivo)) return Msg(playerid, CINZA, "LV ADMIN: Use /banirip [IP] [Motivo]");
  5037.  
  5038. new dia, mes, ano, hora, minutos, segundos;
  5039. if(strlen(Motivo) > 64) return 0;
  5040. getdate(dia, mes, ano);
  5041. gettime(hora, minutos, segundos);
  5042. format(String, 32, "%02d/%02d/%d - %02d:%02d:%02d", dia, mes, ano, hora, minutos, segundos);
  5043.  
  5044. format(string, sizeof(string), IPSBANIDOS, ID);
  5045. DOF2_CreateFile(string);
  5046. DOF2_SetString(string, "Admin", Nome(playerid));
  5047. DOF2_SetString(string, "Motivo", Motivo);
  5048. DOF2_SetString(string, "DataeHora", String);
  5049. DOF2_SetInt(string, "IP", ID);
  5050. DOF2_SaveFile();
  5051.  
  5052. format(String, sizeof String, "LV ADMIN: O Admin %s baniu o IP %d, Motivo: (%s)", Nome(playerid), ID, Motivo);
  5053. MsgAll(VERMELHO, String);
  5054. WriteLog(LOG_BAN, String);
  5055. return 1;
  5056. }
  5057.  
  5058. CMD:desbanirip(playerid, params[])
  5059. {
  5060. if(!NivelRequerido(playerid, 1)) return 1;
  5061. if(sscanf(params, "i", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /desbanirip [IP]");
  5062.  
  5063. new string[40];
  5064. format(string, sizeof(string), IPSBANIDOS, ID);
  5065. if(!DOF2_FileExists(string)) return Msg(playerid, VERMELHO, "ERRO: Esse IP não esta banido.");
  5066. DOF2_RemoveFile(string);
  5067. format(String, sizeof(String), "LV ADMIN: Você desbaniu o IP {1B95E0}%d{00C2EC} com sucesso!", ID);
  5068. Msg(playerid, VERMELHO, String);
  5069.  
  5070. new Log[50];
  5071. format(Log, sizeof(Log), "LV ADMIN: %s desbaniu o IP %s!", Nome(playerid), ID);
  5072. WriteLog(LOG_DESBAN, Log);
  5073. return 1;
  5074. }
  5075.  
  5076. CMD:limparchat(playerid, params[])
  5077. {
  5078. if(!NivelRequerido(playerid, 1)) return 1;
  5079. for(new t = 0; t < 100; ++t)
  5080. {
  5081. MsgAll(-1, " ");
  5082. }
  5083. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} limpou o chat.", Nome(playerid));
  5084. MsgAll(AZUL_CLARO, String);
  5085. return 1;
  5086. }
  5087.  
  5088. CMD:verip(playerid, params[])
  5089. {
  5090. if(!NivelRequerido(playerid, 1)) return 1;
  5091. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /verip [ID]");
  5092. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5093. format(String, sizeof(String), "O IP de %s é:", Nome(ID));
  5094. Msg(playerid, AZUL_CLARO, String);
  5095. format(String, sizeof(String), "%s", IP(ID));
  5096. Msg(playerid, LARANJA, String);
  5097. return 1;
  5098. }
  5099.  
  5100. CMD:avisar(playerid, params[])
  5101. {
  5102. if(!NivelRequerido(playerid, 1)) return 1;
  5103. new Texto[128];
  5104. if(sscanf(params, "s", Texto)) return Msg(playerid, CINZA, "LV ADMIN: Use /avisar [texto]"), Msg(playerid, CINZA, "Use o comando para mandar um aviso aos jogadores");
  5105. MsgAll(-1, "");
  5106. MsgAll(-1, "");
  5107. MsgAll(AZUL, "________________________AVISO DA ADMINISTRAÇÃO________________________");
  5108. format(String, sizeof(String), "Admin %s [nivel %d]: %s", Nome(playerid), PlayerInfo[playerid][pAdmin], Texto);
  5109. MsgAll(AZUL_CLARO, String);
  5110. return 1;
  5111. }
  5112.  
  5113. CMD:destrancarcarros(playerid)
  5114. {
  5115. if(!NivelRequerido(playerid, 1)) return 1;
  5116. for(new c = 0; c < MAX_VEHICLES; c++)
  5117. {
  5118. SetVehicleParamsEx(c, 0, 0, 0, 0, 0, 0, 0);
  5119. }
  5120. Msg(playerid, LARANJA, "LV ADMIN: Todos os veiculos foram destrancados!");
  5121. return 1;
  5122. }
  5123.  
  5124. CMD:kickar(playerid, params[])
  5125. {
  5126. if(!NivelRequerido(playerid, 1)) return 1;
  5127. new Razao[128];
  5128. if(sscanf(params, "us", ID, Razao)) return Msg(playerid, CINZA, "LV ADMIN: Use /kickar [ID] [Razão]"), Msg(playerid, CINZA, "Use o comando para kickar um jogador");
  5129. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5130. if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return Msg(playerid, VERMELHO, "ERRO: Você não pode fazer nada contra um admin superior a você!");
  5131. format(String, sizeof(String), "LV ADMIN: O Admin %s Kickou o Jogador %s[ID: %d] pelo motivo: %s", Nome(playerid), Nome(ID), ID, Razao);
  5132. MsgAll(VERMELHO, String);
  5133. WriteLog(LOG_KICK, String);
  5134. SetTimerEx("Kickar", 100, false, "i", ID);
  5135. return 1;
  5136. }
  5137.  
  5138. CMD:tapa(playerid, params[])
  5139. {
  5140. if(!NivelRequerido(playerid, 1)) return 1;
  5141. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /tapa [ID]"), Msg(playerid, CINZA, "Use o comando para dar um tapa em um jogador");
  5142. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5143. if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return Msg(playerid, VERMELHO, "ERRO: Você não pode fazer nada contra um admin superior a você!");
  5144. new Float:Pos[3];
  5145. GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
  5146. SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]+20);
  5147. format(String, sizeof(String), "LV ADMIN: O Admin %s Deu um tapa em %s", Nome(playerid), Nome(ID));
  5148. MsgAll(VERMELHO, String);
  5149. return 1;
  5150. }
  5151.  
  5152. CMD:assistir(playerid, params[])
  5153. {
  5154. if(!NivelRequerido(playerid, 1)) return 1;
  5155. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /assistir [ID]"), Msg(playerid, CINZA, "Use o comando para assistir os movimentos de um jogador");
  5156. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5157. TogglePlayerSpectating(playerid, 1);
  5158. PlayerSpectatePlayer(playerid, ID);
  5159. PlayerInfo[playerid][pAssistindo] = 1;
  5160. Msg(playerid, LARANJA, "LV ADMIN: Para parar de assistir use /passistir");
  5161. return 1;
  5162. }
  5163.  
  5164. CMD:passistir(playerid)
  5165. {
  5166. if(!NivelRequerido(playerid, 1)) return 1;
  5167. if(PlayerInfo[playerid][pAssistindo] == 0) return Msg(playerid, VERMELHO, "ERRO: Você não está assistindo ninguem!");
  5168. TogglePlayerSpectating(playerid, 0);
  5169. Msg(playerid, LARANJA, "LV ADMIN: Você parou de assistir o jogador!");
  5170. PlayerInfo[playerid][pAssistindo] = 0;
  5171. return 1;
  5172. }
  5173.  
  5174. // ========================================================================================================
  5175.  
  5176. // Comandos admin nivel 2
  5177.  
  5178. CMD:blindar(playerid, params[])
  5179. {
  5180. if(!NivelRequerido(playerid, 2)) return 1;
  5181. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /blindar [playerid]", "Use o comando para deixar o carro de um jogador em god mode.");
  5182. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5183. if(!IsPlayerInAnyVehicle(ID)) return Msg(playerid, VERMELHO, "ERRO: O jogador não está em um veículo.");
  5184. SetVehicleHealth(GetPlayerVehicleID(ID), 999999);
  5185. format(String, sizeof(String), "LV ADMIN: O admin {1B95E0}%s{00C2EC} deixou deixou seu carro em God Mode.", Nome(playerid));
  5186. Msg(ID, AZUL_CLARO, String);
  5187. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5188. return 1;
  5189. }
  5190.  
  5191. CMD:desblindar(playerid, params[])
  5192. {
  5193. if(!NivelRequerido(playerid, 2)) return 1;
  5194. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /desblindar [playerid]", "Use o comando para tirar o carro de um player do God mode.");
  5195. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5196. if(!IsPlayerInAnyVehicle(ID)) return Msg(playerid, VERMELHO, "ERRO: O jogador não está em um veículo.");
  5197. SetVehicleHealth(GetPlayerVehicleID(ID), 100);
  5198. format(String, sizeof(String), "O admin {1B95E0}%s{00C2EC} tirou seu carro do God Mode.", Nome(playerid));
  5199. Msg(ID, AZUL_CLARO, String);
  5200. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5201. return 1;
  5202. }
  5203.  
  5204. CMD:moverplayer(playerid, params[])
  5205. {
  5206. new id2;
  5207. if(!NivelRequerido(playerid, 2)) return 1;
  5208. if(sscanf(params, "uu", ID, id2)) return MensagemDupla(playerid, "LV ADMIN: Use /moverplayer [ID] [ID2]", "Use o comando para mover um player até outro.");
  5209. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5210. new Float:X, Float:Y, Float:Z;
  5211. GetPlayerPos(id2, X, Y, Z);
  5212. SetPlayerPos(ID, X, Y, Z);
  5213. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te moveu ate o jogador %s.", Nome(playerid), Nome(id2));
  5214. Msg(ID, AZUL_CLARO, String);
  5215. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5216. return 1;
  5217. }
  5218.  
  5219. CMD:trazertodos(playerid)
  5220. {
  5221. if(!NivelRequerido(playerid, 2)) return 1;
  5222. new Float:X, Float:Y, Float:Z;
  5223. GetPlayerPos(playerid, X, Y, Z);
  5224. for(new i = 0; i < MAX_PLAYERS; ++i)
  5225. {
  5226. if(IsPlayerConnected(i))
  5227. {
  5228. SetPlayerPos(i, X+1, Y+1, Z);
  5229. }
  5230. }
  5231. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} puxou todos os jogadores até ele.", Nome(playerid));
  5232. MsgAll(AZUL_CLARO, String);
  5233. return 1;
  5234. }
  5235.  
  5236. CMD:jetpack(playerid, params[])
  5237. {
  5238. if(!NivelRequerido(playerid, 2)) return 1;
  5239. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /jetpack [ID]", "Use o comando para dar um jetpakc a agum jogador.");
  5240. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5241. SetPlayerSpecialAction(ID, 2);
  5242. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te deu um JetPack ", Nome(playerid));
  5243. Msg(ID, AZUL_CLARO, String);
  5244. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5245. return 1;
  5246. }
  5247.  
  5248. CMD:explodir(playerid, params[])
  5249. {
  5250. if(!NivelRequerido(playerid, 2)) return 1;
  5251. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /explodir [ID]", "Use o comando para explodir um jogador.");
  5252. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5253. new Float:X, Float:Y, Float:Z;
  5254. GetPlayerPos(ID, X, Y, Z);
  5255. CreateExplosion(X, Y, Z, 1, 5);
  5256. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} explodiu o jogador %s", Nome(playerid), Nome(ID));
  5257. MsgAll(AZUL_CLARO, String);
  5258. return 1;
  5259. }
  5260.  
  5261. CMD:tempo(playerid, params[])
  5262. {
  5263. new t[10];
  5264. if(!NivelRequerido(playerid, 2)) return 1;
  5265. if(sscanf(params, "s", t)) return MensagemDupla(playerid, "LV ADMIN: Use /tempo [Manha/Tarde/Noite]", "Use o comando para alterar o tempo do servidor");
  5266. if(strcmp(t, "manha", true) == 0)
  5267. {
  5268. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} mudou o tempo para manha", Nome(playerid));
  5269. MsgAll(AZUL_CLARO, String);
  5270. for(new i = 0; i < MAX_PLAYERS; ++i)
  5271. {
  5272. SetPlayerTime(i, 9, 0);
  5273. }
  5274. SetWorldTime(9);
  5275. return 1;
  5276. }
  5277. if(strcmp(t, "tarde", true) == 0)
  5278. {
  5279. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} mudou o tempo para tarde", Nome(playerid));
  5280. MsgAll(AZUL_CLARO, String);
  5281. for(new i = 0; i < MAX_PLAYERS; ++i)
  5282. {
  5283. SetPlayerTime(i, 14, 0);
  5284. }
  5285. SetWorldTime(14);
  5286. return 1;
  5287. }
  5288. if(strcmp(t, "noite", true) == 0)
  5289. {
  5290. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} mudou o tempo para noite", Nome(playerid));
  5291. MsgAll(AZUL_CLARO, String);
  5292. for(new i = 0; i < MAX_PLAYERS; ++i)
  5293. {
  5294. SetPlayerTime(i, 0, 0);
  5295. }
  5296. SetWorldTime(0);
  5297. return 1;
  5298. }
  5299. Msg(playerid, CINZA, "LV ADMIN: Use /tempo [Manha/Tarde/Noite]");
  5300. return 1;
  5301. }
  5302.  
  5303. CMD:dargrana(playerid, params[])
  5304. {
  5305. if(!NivelRequerido(playerid, 2)) return 1;
  5306. new q;
  5307. if(sscanf(params, "ui", ID, q)) return MensagemDupla(playerid, "LV ADMIN: Use /dargrana [ID] [quantidade]", "Use o comando para dar algum dinheiro a algum jogador");
  5308. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5309. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te deu %d reais", Nome(playerid), q);
  5310. Msg(ID, AZUL_CLARO, String);
  5311. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5312. GivePlayerCash(ID, q);
  5313.  
  5314. new Log[90];
  5315. format(Log, sizeof(Log), "LV ADMIN: O Admin %s deu %d reais para %s.", Nome(playerid), q, Nome(ID));
  5316. WriteLog(LOG_GRANA, Log);
  5317. return 1;
  5318. }
  5319.  
  5320. CMD:congelar(playerid, params[])
  5321. {
  5322. if(!NivelRequerido(playerid, 2)) return 1;
  5323. new Razao[128];
  5324. if(sscanf(params, "us", ID, Razao)) return Msg(playerid, CINZA, "LV ADMIN: Use /congelar [ID] [Motivo]"), Msg(playerid, CINZA, "Use o comando para impedir um jogador de se mover");
  5325. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5326. if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return Msg(playerid, VERMELHO, "ERRO: Você não pode fazer nada contra um admin superior a você!");
  5327. TogglePlayerControllable(ID, false);
  5328. PlayerInfo[playerid][pCongelado] = 1;
  5329. format(String, sizeof(String), "LV ADMIN: O Admin {1BA5E0}%s{00C2EC} te Congelou Pelo Motivo: %s", Nome(playerid), Nome(ID), ID, Razao);
  5330. Msg(ID, AZUL_CLARO, String);
  5331. Msg(playerid, LARANJA, "Para descongelar use /descongelar");
  5332. return 1;
  5333. }
  5334.  
  5335. CMD:descongelar(playerid, params[])
  5336. {
  5337. if(!NivelRequerido(playerid, 2)) return 1;
  5338. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /descongelar [ID]"), Msg(playerid, CINZA, "Use o comando para permitir ao jogador se movimentar");
  5339. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5340. if(PlayerInfo[ID][pCongelado] == 0) return Msg(playerid, VERMELHO, "ERRO: O Jogados não está congelado!");
  5341. TogglePlayerControllable(ID, true);
  5342. PlayerInfo[ID][pCongelado] = 0;
  5343. format(String, sizeof(String), "LV ADMIN: O Admin {1BA5E0}%s{00C2EC} te descongelou ", Nome(playerid));
  5344. Msg(ID, AZUL_CLARO, String);
  5345. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5346. return 1;
  5347. }
  5348.  
  5349. CMD:dararma(playerid, params[])
  5350. {
  5351. if(!NivelRequerido(playerid, 2)) return 1;
  5352. new Arma, Municao, NomeArma[80];
  5353. if(sscanf(params, "uii", ID, Arma, Municao)) return Msg(playerid, CINZA, "LV ADMIN: Use /dararma [ID] [Arma] [Munição]"), Msg(playerid, CINZA, "Use o comando para dar uma arma para um jogador");
  5354. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5355. if(Arma < 1 || Arma == 19 || Arma == 20 || Arma == 21 || Arma > 46) return Msg(playerid, VERMELHO, "ERRO: ID Invalido, use de 1 a 46");
  5356. if(Arma == 1) NomeArma = "Soco Inglês";
  5357. if(Arma == 2) NomeArma = "Taco de Golf";
  5358. if(Arma == 3) NomeArma = "Cacetete";
  5359. if(Arma == 4) NomeArma = "Faca";
  5360. if(Arma == 5) NomeArma = "Taco de Baseball";
  5361. if(Arma == 6) NomeArma = "Pá";
  5362. if(Arma == 7) NomeArma = "Taco de Sinuca";
  5363. if(Arma == 8) NomeArma = "Kitana";
  5364. if(Arma == 9) NomeArma = "Serra elétrica";
  5365. if(Arma == 10) NomeArma = "Pinto de Borracha";
  5366. if(Arma == 11) NomeArma = "Pinto roxo";
  5367. if(Arma == 12) NomeArma = "Vibrador";
  5368. if(Arma == 13) NomeArma = "Vibrador de Prata";
  5369. if(Arma == 14) NomeArma = "Flor";
  5370. if(Arma == 15) NomeArma = "Bengala";
  5371. if(Arma == 16) NomeArma = "Granada";
  5372. if(Arma == 17) NomeArma = "Bomba de gás";
  5373. if(Arma == 18) NomeArma = "Molotov";
  5374. if(Arma == 22) NomeArma = "Pistola 9mm";
  5375. if(Arma == 23) NomeArma = "Pistola com silenciador";
  5376. if(Arma == 24) NomeArma = "Desert Eagle";
  5377. if(Arma == 25) NomeArma = "ShotGun";
  5378. if(Arma == 26) NomeArma = "Sawnoff Shotgun";
  5379. if(Arma == 27) NomeArma = "Combat Shotgun";
  5380. if(Arma == 28) NomeArma = "Micro SMG";
  5381. if(Arma == 29) NomeArma = "MP5";
  5382. if(Arma == 30) NomeArma = "AK47";
  5383. if(Arma == 31) NomeArma = "M4";
  5384. if(Arma == 32) NomeArma = "Tec 9";
  5385. if(Arma == 33) NomeArma = "Country Rifle";
  5386. if(Arma == 34) NomeArma = "Sniper Rifle";
  5387. if(Arma == 35) NomeArma = "Bazooca RPG";
  5388. if(Arma == 36) NomeArma = "Bazooca Normal";
  5389. if(Arma == 37) NomeArma = "Lança Chamas";
  5390. if(Arma == 38) NomeArma = "Mini Gun";
  5391. if(Arma == 39) NomeArma = "C4";
  5392. if(Arma == 40) NomeArma = "Detonador";
  5393. if(Arma == 41) NomeArma = "Spray";
  5394. if(Arma == 42) NomeArma = "Extintor";
  5395. if(Arma == 43) NomeArma = "Oculos de visão noturna";
  5396. if(Arma == 45) NomeArma = "Oculos de visão de calor";
  5397. if(Arma == 46) NomeArma = "Paraquedas";
  5398. GivePlayerWeapon(ID, Arma, Municao);
  5399. format(String, sizeof(String), "LV ADMIN: O Admin {1BA5E0}%s{00C2EC} te deu um(a) {1BA5E0}%s{00C2EC} Com {1BA5E0}%d{00C2EC} Balas ", Nome(playerid), NomeArma, Municao);
  5400. Msg(ID, AZUL_CLARO, String);
  5401.  
  5402. new Log[90];
  5403. format(Log, sizeof(Log), "LV ADMIN: O Admin %s deu um(a) %s Com %d Balas para %s.", Nome(playerid), NomeArma, Municao, Nome(ID));
  5404. WriteLog(LOG_ARMA, Log);
  5405. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5406. return 1;
  5407. }
  5408.  
  5409. CMD:desarmar(playerid, params[])
  5410. {
  5411. if(!NivelRequerido(playerid, 2)) return 1;
  5412. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /desarmar [ID]"), Msg(playerid, CINZA, "Use o comando para desarmar um jogador");
  5413. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5414. if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return Msg(playerid, VERMELHO, "ERRO: Você não pode fazer nada contra um admin superior a você!");
  5415. format(String, sizeof(String), "LV ADMIN: O Admin {1BA5E0}%s{00C2EC} te desarmou", Nome(playerid));
  5416. Msg(ID, AZUL_CLARO, String);
  5417. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5418. ResetPlayerWeapons(ID);
  5419. return 1;
  5420. }
  5421.  
  5422. CMD:cv(playerid, params[])
  5423. {
  5424. if(!NivelRequerido(playerid, 2)) return 1;
  5425. new Carro, Cor1, Cor2, engine, lights, alarm, doors, bonnet, boot, objective, idcarro;
  5426. if(sscanf(params, "iii", Carro, Cor1, Cor2)) return Msg(playerid, CINZA, "LV ADMIN: Use /cv [ID] [cor1] [cor2]"), Msg(playerid, CINZA, "Use o comando para criar um veiculo, para fazer um respawn use /respawn");
  5427. new Float:X, Float:Y, Float:X1, Float:Y1, Float:Z, Float:A;
  5428. PosicaoFrentePlayer(playerid, X, Y, 3);
  5429. GetPlayerPos(playerid, X1, Y1, Z);
  5430. GetPlayerFacingAngle(playerid, A);
  5431. idcarro = AddStaticVehicle(Carro, X, Y, Z, A+90, Cor1, Cor2);
  5432. CarrosCriados[TodosCarros] = idcarro;
  5433.  
  5434. GetVehicleParamsEx(idcarro, engine, lights, alarm, doors, bonnet, boot, objective);
  5435. SetVehicleParamsEx(idcarro, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, alarm, doors, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, objective);
  5436.  
  5437. GasolinaVeiculo[idcarro] = 80;
  5438. TodosCarros ++;
  5439. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5440. return 1;
  5441. }
  5442.  
  5443. CMD:setgasolina(playerid, params[])
  5444. {
  5445. if(!NivelRequerido(playerid, 4)) return 1;
  5446. new Quantidade;
  5447. if(sscanf(params, "ui", ID, Quantidade)) return Msg(playerid, CINZA, "LV ADMIN: Use /setgasolina [ID] [Quantidade]"), Msg(playerid, CINZA, "Use o comando para por gasolina em algum carro");
  5448. if(!IsPlayerInAnyVehicle(ID)) return Msg(playerid, VERMELHO, "ERRO: Esse player não está em nenhum veículo!");
  5449. if(Quantidade < 0 || Quantidade > 100) return Msg(playerid, VERMELHO, "ERRO: Valor Inválido! Use de 0 a 100");
  5450. format(String, sizeof(String), "LV ADMIN: O Admin {1BA5E0}%s{00C2EC} setou a gasolina do seu carro para %d litros", Nome(playerid), Quantidade);
  5451. Msg(ID, AZUL_CLARO, String);
  5452. new vehicleid = GetPlayerVehicleID(ID);
  5453. GasolinaVeiculo[vehicleid] = Quantidade;
  5454. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5455. return 1;
  5456. }
  5457.  
  5458. CMD:respawn(playerid)
  5459. {
  5460. if(!NivelRequerido(playerid, 2)) return 1;
  5461. format(String, sizeof(String), "LV ADMIN: O Admin {1BA5E0}%s{00C2EC} deu Respawn nos veículos!", Nome(playerid));
  5462. MsgAll(AZUL_CLARO, String);
  5463. Msg(playerid, LARANJA, "LV ADMIN: Todos os carros criados foram destruidos!");
  5464. for(new i = 0; i < sizeof(CarrosCriados); i++)
  5465. {
  5466. DestroyVehicle(CarrosCriados[i]);
  5467. }
  5468. for(new c = 0; c < MAX_VEHICLES; c++)
  5469. {
  5470. SetVehicleToRespawn(c);
  5471. }
  5472. return 1;
  5473. }
  5474.  
  5475. CMD:idcarro(playerid)
  5476. {
  5477. if(!NivelRequerido(playerid, 2)) return 1;
  5478. if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid, VERMELHO, "ERRO: Você não está em um veículo!");
  5479. new idc;
  5480. idc = GetPlayerVehicleID(playerid);
  5481. format(String, sizeof(String), "LV ADMIN: O ID do veículo é %d", idc);
  5482. Msg(playerid, LARANJA, String);
  5483. return 1;
  5484. }
  5485.  
  5486. CMD:setarvida(playerid, params[])
  5487. {
  5488. if(!NivelRequerido(playerid, 2)) return 1;
  5489. new Vida;
  5490. if(sscanf(params, "ui", ID, Vida)) return Msg(playerid, CINZA, "LV ADMIN: Use /setarvida [ID] [VIDA]");
  5491. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5492. if(Vida < 0 || Vida > 100) return Msg(playerid, VERMELHO, "ERRO: Valor Inválido! Use de 0 a 100");
  5493. SetPlayerHealth(ID, Vida);
  5494. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te setou vida de {1B95E0}%d{00C2EC}", Nome(playerid), Vida);
  5495. Msg(ID, AZUL_CLARO, String);
  5496. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5497. return 1;
  5498. }
  5499.  
  5500. CMD:setarcolete(playerid, params[])
  5501. {
  5502. if(!NivelRequerido(playerid, 2)) return 1;
  5503. new Colete;
  5504. if(sscanf(params, "ui", ID, Colete)) return Msg(playerid, CINZA, "LV ADMIN: Use /setarcolete [ID] [COLETE]");
  5505. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5506. if(Colete < 0 || Colete > 100) return Msg(playerid, CINZA, "ERRO: Valor Inválido! Use de 0 a 100");
  5507. SetPlayerArmour(ID, Colete);
  5508. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te setou colete de {1B95E0}%d{00C2EC} ", Nome(playerid), Colete);
  5509. Msg(ID, AZUL_CLARO, String);
  5510. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5511. return 1;
  5512. }
  5513.  
  5514.  
  5515. // ========================================================================================================
  5516.  
  5517. // Comandos admin nivel 3
  5518.  
  5519. CMD:kicksecreto(playerid, params[])
  5520. {
  5521. if(!NivelRequerido(playerid, 3)) return 1;
  5522. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /kicksecreto [ID]"), Msg(playerid, CINZA, "Use o comando para kickar um jogador sem ninguem ficar sabendo.");
  5523. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5524. if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return Msg(playerid, VERMELHO, "Você não pode fazer nada contra um admin superior a você!");
  5525. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5526. Kick(ID);
  5527. return 1;
  5528. }
  5529.  
  5530. CMD:resetargrana(playerid, params[])
  5531. {
  5532. if(!NivelRequerido(playerid, 3)) return 1;
  5533. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /resetargrana [ID]", "Use o comando para resetar o dinheiro de algum jogador");
  5534. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5535. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} resetou o seu dinheiro", Nome(playerid));
  5536. Msg(ID, AZUL_CLARO, String);
  5537. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5538. ResetPlayerCash(ID);
  5539. return 1;
  5540. }
  5541.  
  5542. CMD:setargrana(playerid, params[])
  5543. {
  5544. if(!NivelRequerido(playerid, 3)) return 1;
  5545. new q;
  5546. if(sscanf(params, "ui", ID, q)) return MensagemDupla(playerid, "LV ADMIN: Use /setargrana [ID] [Quantidade]", "Use o comando para setar o dinheiro de algum jogador para a quantia desejada");
  5547. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5548. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} setou o seu dinheiro para %d", Nome(playerid), q);
  5549. Msg(ID, AZUL_CLARO, String);
  5550. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5551. ResetPlayerCash(ID);
  5552. GivePlayerCash(ID, q);
  5553. return 1;
  5554. }
  5555.  
  5556. CMD:setarskin(playerid, params[])
  5557. {
  5558. if(!NivelRequerido(playerid, 3)) return 1;
  5559. new Skin;
  5560. if(sscanf(params, "ui", ID, Skin)) return Msg(playerid, CINZA, "LV ADMIN: Use /setarskin [ID] [Skin]"), Msg(playerid, CINZA, "Use o comando para mudar a skin de um jogador");
  5561. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5562. if(Skin < 0 || Skin > 299) return Msg(playerid, VERMELHO, "ERRO: ID Inválido, use IDs de 0 a 299!");
  5563. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} setou sua Skin para a ID n°%d", Nome(playerid), Skin);
  5564. Msg(ID, AZUL_CLARO, String);
  5565. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5566. PlayerInfo[playerid][pSkin] = Skin;
  5567. SetPlayerSkin(ID, Skin);
  5568. return 1;
  5569. }
  5570.  
  5571. CMD:clima(playerid, params[])
  5572. {
  5573. if(!NivelRequerido(playerid, 3)) return 1;
  5574. new Clima;
  5575. if(sscanf(params, "i", Clima)) return Msg(playerid, CINZA, "LV ADMIN: Use /clima [ID do clima]"), Msg(playerid, CINZA, "Use o comando para alterar o clima do servidor");
  5576. if(Clima < 1 || Clima > 50) return Msg(playerid, VERMELHO, "LV ADMIN: ID Invalido, use IDs de 0 a 50, 250 ou 2009");
  5577. SetWeather(Clima);
  5578. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} mudou o Clima para o ID %d!", Nome(playerid), Clima);
  5579. MsgAll(AZUL_CLARO, String);
  5580. return 1;
  5581. }
  5582.  
  5583. CMD:godmode(playerid, params[])
  5584. {
  5585. if(!NivelRequerido(playerid, 3)) return 1;
  5586. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /godmode [ID]"), Msg(playerid, CINZA, "Use o comando para deixar um jogador imortal");
  5587. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5588. SetPlayerHealth(ID, 999999);
  5589. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te deixou em GodMode!", Nome(playerid));
  5590. Msg(ID, AZUL_CLARO, String);
  5591. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5592. return 1;
  5593. }
  5594.  
  5595. CMD:ejetar(playerid, params[])
  5596. {
  5597. if(!NivelRequerido(playerid, 3)) return 1;
  5598. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /ejetar [ID]"), Msg(playerid, CINZA, "Use o comando para tirar um jogador de seu carro");
  5599. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5600. if(!IsPlayerInAnyVehicle(ID)) return Msg(playerid, VERMELHO, "ERRO: O jogador não está em um veículo!");
  5601. RemovePlayerFromVehicle(ID);
  5602. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} te ejetou de seu carro!", Nome(playerid));
  5603. Msg(ID, AZUL_CLARO, String);
  5604. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5605. return 1;
  5606. }
  5607.  
  5608. CMD:falar(playerid, params[])
  5609. {
  5610. new Fala[128];
  5611. if(!NivelRequerido(playerid, 3)) return 1;
  5612. if(sscanf(params, "s", Fala)) return Msg(playerid, CINZA, "Use /falar [texto]"), Msg(playerid, CINZA, "Use o comando para falar usando a voz do google tradutor");
  5613. for(new i = 0; i < MAX_PLAYERS; i++)
  5614. {
  5615. format(String, sizeof(String), "http://translate.google.com/translate_tts?tl=pt&q=%s", Fala);
  5616. PlayAudioStreamForPlayer(i, String, 0, 0, 0, 0, 0);
  5617. }
  5618. format(String, sizeof(String), "LV ADMIN: Admin {1B95E0}%s{00C2EC} Falando!", Nome(playerid));
  5619. MsgAll(AZUL_CLARO, String);
  5620. return 1;
  5621. }
  5622.  
  5623. CMD:crash(playerid, params[])
  5624. {
  5625. new Motivo[100];
  5626. if(!NivelRequerido(playerid, 3)) return 1;
  5627. if(sscanf(params, "us", ID, Motivo)) return Msg(playerid, CINZA, "LV ADMIN: Use /crash [ID] [Motivo]"), Msg(playerid, CINZA, "Use o comando para crashar um jogador");
  5628. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5629. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Crashou {1B95E0}%s{00C2EC} pelo motivo: {1B95E0}%s{00C2EC}", Nome(playerid), Nome(ID), Motivo);
  5630. MsgAll(AZUL_CLARO, String);
  5631. GameTextForPlayer(ID, "~k~~INVALID_KEY~", 5000, 5);
  5632. return 1;
  5633. }
  5634.  
  5635. CMD:setarpos(playerid, params[])
  5636. {
  5637. if(!NivelRequerido(playerid, 3)) return 1;
  5638. new X, Y, Z;
  5639. if(sscanf(params, "uiii", ID, X, Y, Z)) return Msg(playerid, CINZA, "LV ADMIN: Use /setarposicao [ID] [Pos X] [Pos Y] [Pos Z]"), Msg(playerid, CINZA, "Use o comando para alterar a posição de um jogador");
  5640. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5641. SetPlayerPos(ID, X, Y, Z);
  5642. format(String, sizeof(String), "LV ADMIN: Você Teleportou o jogador {1B95E0}%s{00C2EC} para as cordenadas: %d %d %d!", Nome(ID), X, Y, Z);
  5643. Msg(playerid, AZUL_CLARO, String);
  5644. return 1;
  5645. }
  5646.  
  5647. CMD:verpos(playerid)
  5648. {
  5649. if(!NivelRequerido(playerid, 3)) return 1;
  5650. new Float: X, Float: Y, Float: Z;
  5651. GetPlayerPos(playerid, X, Y, Z);
  5652. format(String, sizeof(String), "LV ADMIN: Você está na posição %f %f %f", X, Y, Z);
  5653. Msg(playerid, AMARELO, String);
  5654. return 1;
  5655. }
  5656.  
  5657. CMD:barril(playerid)
  5658. {
  5659. if(!NivelRequerido(playerid, 3)) return 1;
  5660. new Float: X, Float: Y, Float: Z;
  5661. GetPlayerPos(playerid, X, Y, Z);
  5662. PosicaoFrentePlayer(playerid, X, Y, 5);
  5663. new barril;
  5664. barril = CreateObject(1225, X, Y, Z, 0, 0, 0, 50);
  5665. Barris[tBarris] = barril;
  5666. tBarris ++;
  5667. Msg(playerid, VERDE_CLARO, "LV ADMIN: Você criou um barril explosivo, para destrui-lo use /dbarris");
  5668. return 1;
  5669. }
  5670.  
  5671. CMD:dbarris(playerid)
  5672. {
  5673. if(!NivelRequerido(playerid, 3)) return 1;
  5674. for(new o = 0; o < sizeof(Barris); o++)
  5675. {
  5676. DestroyObject(Barris[o]);
  5677. }
  5678. Msg(playerid, VERDE_CLARO, "LV ADMIN: Todos os Barris foram destruídos");
  5679. return 1;
  5680. }
  5681.  
  5682. CMD:disfarce(playerid, params[])
  5683. {
  5684. if(!NivelRequerido(playerid, 3)) return 1;
  5685. if(PlayerInfo[playerid][pDisfarcado] == 1) return Msg(playerid, CINZA, "Você ja esta disfarçado, use /sairdisfarce.");
  5686. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /disfarce [ID]", "Use o comando para se disfarçar de algum jogador.");
  5687. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5688. new Cor = GetPlayerColor(ID);
  5689. new Skin = GetPlayerSkin(ID);
  5690. NomeOriginal[playerid] = Nome(playerid);
  5691. SetPlayerName(playerid, Nome(ID));
  5692. SetPlayerColor(playerid, Cor);
  5693. SetPlayerSkin(playerid, Skin);
  5694. PlayerInfo[playerid][pDisfarcado] = 1;
  5695. Msg(playerid, AMARELO, "Para sair do disfarce use /sairdisfarce.");
  5696. return 1;
  5697. }
  5698.  
  5699. CMD:sairdisfarce(playerid)
  5700. {
  5701. if(!NivelRequerido(playerid, 3)) return 1;
  5702. if(PlayerInfo[playerid][pDisfarcado] == 0) return Msg(playerid, CINZA, "Você não está disfarçado.");
  5703. SetPlayerName(playerid, NomeOriginal[playerid]);
  5704. SetPlayerSkin(playerid, 9);
  5705. SetPlayerColor(playerid, 0x24E9FFFF);
  5706. Msg(playerid, AMARELO, "Você saiu do disfarce com sucesso");
  5707. PlayerInfo[playerid][pDisfarcado] = 0;
  5708. return 1;
  5709. }
  5710.  
  5711. // ========================================================================================================
  5712.  
  5713. // Comandos admin nivel 4
  5714.  
  5715. CMD:kickartodos(playerid)
  5716. {
  5717. if(!NivelRequerido(playerid, 4)) return 1;
  5718. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Kickou Todos do servidor!", Nome(playerid));
  5719. MsgAll(AZUL_CLARO, String);
  5720. for(new i = 0; i < MAX_PLAYERS; i++)
  5721. {
  5722. if(PlayerInfo[i][pAdmin] < 1)
  5723. {
  5724. SetTimerEx("Kickar", 100, false, "i", i);
  5725. }
  5726. }
  5727. return 1;
  5728. }
  5729.  
  5730. CMD:desarmartodos(playerid)
  5731. {
  5732. if(!NivelRequerido(playerid, 4)) return 1;
  5733. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Tirou as armas de Todos do servidor!", Nome(playerid));
  5734. MsgAll(AZUL_CLARO, String);
  5735. for(new i = 0; i < MAX_PLAYERS; i++)
  5736. {
  5737. if(PlayerInfo[i][pAdmin] < 1)
  5738. {
  5739. ResetPlayerWeapons(i);
  5740. }
  5741. }
  5742. return 1;
  5743. }
  5744.  
  5745. CMD:gmx(playerid)
  5746. {
  5747. if(!NivelRequerido(playerid, 4)) return 1;
  5748. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Deu GMX no servidor, em alguns segundos ele será reiniciado", Nome(playerid));
  5749. MsgAll(AZUL_CLARO, String);
  5750. for(new i = 0; i < MAX_PLAYERS; i++)
  5751. {
  5752. SalvarDados(i);
  5753. }
  5754. SendRconCommand("gmx");
  5755. return 1;
  5756. }
  5757.  
  5758. CMD:invisivel(playerid)
  5759. {
  5760. if(!NivelRequerido(playerid, 4)) return 1;
  5761. if(PlayerInfo[playerid][pInvisivel] == 1) return Msg(playerid, CINZA, "LV ADMIN: Você ja está invisivel!");
  5762. SetPlayerVirtualWorld(playerid, 5);
  5763. PlayerInfo[playerid][pInvisivel] = 1;
  5764. Msg(playerid, AZUL_CLARO, "Use /visivel para ficar visivel novamente");
  5765. return 1;
  5766. }
  5767.  
  5768. CMD:visivel(playerid)
  5769. {
  5770. if(!NivelRequerido(playerid, 4)) return 1;
  5771. if(PlayerInfo[playerid][pInvisivel] == 0) return Msg(playerid, CINZA, "LV ADMIN: Você não está invisivel!");
  5772. SetPlayerVirtualWorld(playerid, 0);
  5773. PlayerInfo[playerid][pInvisivel] = 0;
  5774. Msg(playerid, AZUL_CLARO, "Você está visivel novamente!");
  5775. return 1;
  5776. }
  5777.  
  5778. CMD:congelartodos(playerid)
  5779. {
  5780. if(!NivelRequerido(playerid, 4)) return 1;
  5781. for(new i = 0; i < MAX_PLAYERS; i++)
  5782. {
  5783. TogglePlayerControllable(i, false);
  5784. PlayerInfo[i][pCongelado] = 1;
  5785. }
  5786. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Congelou todos os Jogadores", Nome(playerid));
  5787. MsgAll(AZUL_CLARO, String);
  5788. return 1;
  5789. }
  5790.  
  5791. CMD:descongelartodos(playerid)
  5792. {
  5793. if(!NivelRequerido(playerid, 4)) return 1;
  5794. for(new i = 0; i < MAX_PLAYERS; i++)
  5795. {
  5796. TogglePlayerControllable(i, true);
  5797. PlayerInfo[i][pCongelado] = 0;
  5798. }
  5799. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Descongelou todos os Jogadores", Nome(playerid));
  5800. MsgAll(AZUL_CLARO, String);
  5801. return 1;
  5802. }
  5803.  
  5804. CMD:matartodos(playerid)
  5805. {
  5806. if(!NivelRequerido(playerid, 4)) return 1;
  5807. for(new i = 0; i < MAX_PLAYERS; i++)
  5808. {
  5809. SetPlayerHealth(i, 0);
  5810. }
  5811. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} Matou todos os Jogadores", Nome(playerid));
  5812. MsgAll(AZUL_CLARO, String);
  5813. return 1;
  5814. }
  5815.  
  5816. CMD:setprof(playerid, params[])
  5817. {
  5818. new prof;
  5819. if(sscanf(params, "ui", ID, prof)) return MensagemDupla(playerid, "Use /setprof [ID] [profissao]", "Use o comando para setar uma profissão para certo ID.");
  5820. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5821. format(String, sizeof(String), "LV ADMIN: O admin %s te setou a profissão ID %d.", Nome(playerid), prof);
  5822. Msg(ID, AZUL_CLARO, String);
  5823. PlayerInfo[ID][pProfissao] = prof;
  5824. CarregarProfs(ID);
  5825. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5826. return 1;
  5827. }
  5828.  
  5829. CMD:setlevel(playerid, params[])
  5830. {
  5831. new Level;
  5832. if(sscanf(params, "ui", ID, Level)) return MensagemDupla(playerid, "Use /setlevel [ID] [Level]", "Use o comando para setar o level de um jogador.");
  5833. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5834. format(String, sizeof(String), "LV ADMIN: O admin %s te setou para o level %d.", Nome(playerid), Level);
  5835. Msg(ID, AZUL_CLARO, String);
  5836. PlayerInfo[ID][pLevel] = Level;
  5837. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5838. return 1;
  5839. }
  5840.  
  5841. CMD:darlevel(playerid, params[])
  5842. {
  5843. new Level;
  5844. if(sscanf(params, "ui", ID, Level)) return MensagemDupla(playerid, "Use /darlevel [ID] [Level]", "Use o comando para dar level a um jogador.");
  5845. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5846. format(String, sizeof(String), "LV ADMIN: O admin %s te deu %d level.", Nome(playerid), Level);
  5847. Msg(ID, AZUL_CLARO, String);
  5848. PlayerInfo[ID][pLevel] += Level;
  5849. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5850. return 1;
  5851. }
  5852.  
  5853. // ========================================================================================================
  5854.  
  5855. // Comandos admin nivel 5
  5856. CMD:daradmin(playerid, params[])
  5857. {
  5858. if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] < 5) return Msg(playerid, VERMELHO, "{FF0000}ERRO:»{FFD700} Você precisa ser admin nivel 5 para usar este comando!");
  5859. if(sscanf(params, "ud", ID, nivel)) return Msg(playerid, CINZA, "LV ADMIN: Use /daradmin [ID] [nivel]"), Msg(playerid, CINZA, "Use o comando para oferecer admin para algum jogador");
  5860. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5861. if(nivel < 1 || nivel > 5) return Msg(playerid, VERMELHO, "ERRO: Nivel invalido, use de 0 a 5");
  5862. format(String, sizeof(String), "{FFFFFF}O Admin Dono {1B95E0}%s{FFFFFF} está lhe oferencendo admin nivel {1b95E0}%d", Nome(playerid), nivel);
  5863. ShowPlayerDialog(ID, DIALOG_DADMIN, DIALOG_STYLE_MSGBOX, "Admin", String, "Aceitar", "Recusar");
  5864. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5865. return 1;
  5866. }
  5867.  
  5868. CMD:tiraradmin(playerid, params[])
  5869. {
  5870. if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] < 5) return Msg(playerid, VERMELHO, "{FF0000}ERRO:»{FFD700} Você precisa ser admin nivel 5 para usar este comando!");
  5871. if(sscanf(params, "u", ID)) return Msg(playerid, CINZA, "LV ADMIN: Use /tirar [ID]"), Msg(playerid, CINZA, "Use o comando para oferecer admin para algum jogador");
  5872. if(PlayerInfo[ID][pAdmin] == 0) return Msg(playerid, VERMELHO, "ERRO: Esse Player não e Admin!");
  5873. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5874. format(String, sizeof(String), "LV ADMIN: O Admin Dono {1B95E0}%s{00C2EC} tirou o Admin de {1B95E0}%s{00C2EC}", Nome(playerid), Nome(ID));
  5875. MsgAll(AZUL_CLARO, String);
  5876. WriteLog(LOG_ADM, String);
  5877. PlayerInfo[ID][pAdmin] = 0;
  5878. return 1;
  5879. }
  5880.  
  5881. CMD:darhelper(playerid, params[])
  5882. {
  5883. if(!NivelRequerido(playerid, 5)) return 1;
  5884. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /darhelper [ID]", "Use o comando para oferecer helper a algum jogador.");
  5885. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5886. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} está te oferecendo Helper.", Nome(playerid));
  5887. ShowPlayerDialog(ID, DIALOG_HELPER, DIALOG_STYLE_MSGBOX, "Helper", String, "Aceitar", "Recusar");
  5888. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5889. return 1;
  5890. }
  5891.  
  5892. CMD:tirarhelper(playerid, params[])
  5893. {
  5894. if(!NivelRequerido(playerid, 5)) return 1;
  5895. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /tirarhelper [ID]", "Use o comando para tirar helper de algum player.");
  5896. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} tirou o helper de {1B95E0}%s{00C2EC}", Nome(playerid), Nome(ID));
  5897. MsgAll(AZUL_CLARO, String);
  5898. WriteLog(LOG_ADM, String);
  5899. PlayerInfo[ID][pHelper] = 0;
  5900. return 1;
  5901. }
  5902.  
  5903. CMD:trancarserver(playerid, params[])
  5904. {
  5905. new senha[30];
  5906. if(!NivelRequerido(playerid, 5)) return 1;
  5907. if(sscanf(params, "s", senha)) return MensagemDupla(playerid, "LV ADMIN: Use /trancarserver [Senha]", "Use o comando para trancar seu servidor utilizando a senha desejada.");
  5908. format(String, sizeof(String), "password %s", senha);
  5909. SendRconCommand(String);
  5910. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} trancou o servidor", Nome(playerid));
  5911. MsgAll(AZUL_CLARO, String);
  5912. ServerTrancado = true;
  5913. return 1;
  5914. }
  5915.  
  5916. CMD:destrancarserver(playerid, params[])
  5917. {
  5918. if(!NivelRequerido(playerid, 5)) return 1;
  5919. if((!ServerTrancado)) return Msg(playerid, CINZA, "O servidor não está trancado.");
  5920. SendRconCommand("password 0");
  5921. format(String, sizeof(String), "LV ADMIN: O Admin {1B95E0}%s{00C2EC} destrancou o servidor", Nome(playerid));
  5922. MsgAll(AZUL_CLARO, String);
  5923. return 1;
  5924. }
  5925.  
  5926. CMD:dargalao(playerid, params[])
  5927. {
  5928. if(!NivelRequerido(playerid, 5)) return 1;
  5929. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /dargalao [ID]", "Use o comando para dar um galao de gasolina para certo player.");
  5930. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: ID invalido");
  5931. if(PlayerInfo[ID][TemGalao] == 1) return Msg(playerid, VERMELHO, "ERRO: Este jogador ja possui um galao.");
  5932. format(String, sizeof(String), "LV ADMIN: O admin %s te de um galao de gasolina.", Nome(playerid));
  5933. Msg(ID, AZUL_CLARO, String);
  5934. PlayerInfo[ID][TemGalao] = 1;
  5935. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  5936. return 1;
  5937. }
  5938.  
  5939. CMD:ircasa(playerid, params[])
  5940. {
  5941. if(!NivelRequerido(playerid, 5)) return 1;
  5942. new house;
  5943. if(sscanf(params, "i", house)) return MensagemDupla(playerid, "LV ADMIN: Use /ircasa [ID]", "Use o comando para ir a alguma casa do servidor.");
  5944.  
  5945. new filePath[150];
  5946. format(filePath, sizeof filePath, "Casas/Casas/Casa %d.ini", house);
  5947. if(!DOF2_FileExists(filePath)) return Msg(playerid, VERMELHO, "ERRO: Essa casa não existe!");
  5948.  
  5949. new string[200];
  5950. if(!IsPlayerInAnyVehicle(playerid))
  5951. {
  5952. SetPlayerPos(playerid, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  5953. SetPlayerInterior(playerid, 0);
  5954. SetPlayerVirtualWorld(playerid, -1);
  5955. } else {
  5956. new v = GetPlayerVehicleID(playerid);
  5957. SetPlayerPos(playerid, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ]);
  5958. SetVehiclePos(v, CasaInfo[house][houseX], CasaInfo[house][houseY], CasaInfo[house][houseZ] + 5);
  5959. SetPlayerInterior(playerid, 0);
  5960. LinkVehicleToInterior(v, 0);
  5961. SetPlayerVirtualWorld(playerid, -1);
  5962. SetVehicleVirtualWorld(v, -1);
  5963. PutPlayerInVehicle(playerid, v, 0);
  5964. }
  5965.  
  5966. format(string, sizeof string, "LV ADMIN: Você foi até a casa número {00E5FF}%d", house);
  5967. Msg(playerid, LARANJA, string);
  5968.  
  5969. new logString[128];
  5970. format(logString, sizeof logString, "O administrador %s[%d], foi até a casa %d.", Nome(playerid), playerid, house);
  5971. WriteLog(LOG_ADMIN, logString);
  5972.  
  5973. return 1;
  5974. }
  5975.  
  5976. CMD:criarcasa(playerid, params[])
  5977. {
  5978. ShowCreateHouseDialog(playerid);
  5979. return 1;
  5980. }
  5981.  
  5982. CMD:criarradar(playerid, params[])
  5983. {
  5984. if(!NivelRequerido(playerid, 5)) return 1;
  5985. if(CriandoRadar == 1) return Msg(playerid, VERMELHO, "ERRO: Já tem alguém criando um radar, aguarde por favor!");
  5986. new velocidade, Dialog[250];
  5987. if(sscanf(params, "i", velocidade)) return MensagemDupla(playerid, "LV ADMIN: Use /criarradar [velocidade]", "Use o comando para criar um radar do servidor.");
  5988.  
  5989. new Float:PosX, Float:PosY, Float:PosZ, Float:Angulo;
  5990. GetPlayerPos(playerid, PosX, PosY, PosZ);
  5991. GetPlayerFacingAngle(playerid, Angulo);
  5992. VelocidadeRADAR = velocidade;
  5993.  
  5994. format(Dialog, sizeof(Dialog),"{FFFFFF}Você deseja mesmo criar um radar neste local?\n\n");
  5995. format(Dialog, sizeof(Dialog),"%s{00B4FF}Posição X: {FFFFFF}%0.4f\n{00B4FF}Posição Y: {FFFFFF} %0.4f\n{00B4FF}Posição Z: {FFFFFF} %0.4f\n{00B4FF}Angulo: {FFFFFF}%0.4f\n{00B4FF}Velocidade: {FFFFFF}%d", Dialog, PosX, PosY, PosZ, Angulo, velocidade);
  5996.  
  5997. CriandoRadar = 1;
  5998. ShowPlayerDialog(playerid, DIALOG_CRIAR_RADAR, DIALOG_STYLE_MSGBOX, "LIFE VIRTUAL RPG - RADAR", Dialog, "Criar", "Cancelar");
  5999. return 1;
  6000. }
  6001.  
  6002. CMD:deletarradar(playerid, params[])
  6003. {
  6004. if(!NivelRequerido(playerid, 5)) return 1;
  6005. if(sscanf(params, "i", ID)) return MensagemDupla(playerid, "LV ADMIN: Use /deletarradar [ID]", "Use o comando para deletar um radar do servidor.");
  6006. new string[40];
  6007. format(string, sizeof(string), RADARES, ID);
  6008. if(!DOF2_FileExists(string)) return Msg(playerid, VERMELHO, "ERRO: ID do radar inexistente.");
  6009.  
  6010. DOF2_RemoveFile(string);
  6011. format(String, sizeof(String), "INFO: Você deletou o radar de ID: %d.", ID);
  6012. Msg(playerid, LARANJA, String);
  6013.  
  6014. DestroyObject(ObjetoRadar[0][ID]);
  6015. DestroyObject(ObjetoRadar[1][ID]);
  6016. Delete3DTextLabel(TRadar[ID]);
  6017. DestroyDynamicMapIcon(IconeRadar[ID]);
  6018. RadarInfo[ID][rPosX] = 0;
  6019. RadarInfo[ID][rPosY] = 0;
  6020. RadarInfo[ID][rPosZ] = 0;
  6021. RadarInfo[ID][rAngulo] = 0;
  6022. RadarInfo[ID][rVelocidade] = 999999;
  6023. return 1;
  6024. }
  6025.  
  6026. CMD:criarkey(playerid, params[])
  6027. {
  6028. if(!NivelRequerido(playerid, 5)) return 1;
  6029. ShowPlayerDialog(playerid, DIALOG_NOVA_KEY, DIALOG_STYLE_INPUT, "LV RPG - KEY VIP", "\nDigite uma nova key válida:\n\n", "Criar", "Cancelar");
  6030. return 1;
  6031. }
  6032.  
  6033. CMD:removerkey(playerid, params[])
  6034. {
  6035. if(!NivelRequerido(playerid, 5)) return 1;
  6036. new Key[25];
  6037. if(sscanf(params, "s", Key))return MensagemDupla(playerid, "LV ADMIN: Use /removerkey [Key]", "Use o comando para remover uma key VIP.");
  6038.  
  6039. new string[40];
  6040. format(string, sizeof string, VIP_KEYS, Key);
  6041. if(!DOF2_FileExists(string)) return Msg(playerid, VERMELHO, "ERRO: Key inexistente.");
  6042. DOF2_RemoveFile(string);
  6043.  
  6044. format(String, sizeof String, "KEY: A key %s foi removida com sucesso.", Key);
  6045. Msg(playerid, LARANJA, String);
  6046. return 1;
  6047. }
  6048.  
  6049. CMD:darvip(playerid, params[])
  6050. {
  6051. if(!NivelRequerido(playerid, 5)) return 1;
  6052. new Leveis;
  6053. if(sscanf(params, "ud", ID, Leveis)) return MensagemDupla(playerid, "LV ADMIN: Use /darvip [ID] [Leveis]", "Use o comando para dar VIP diretamente.");
  6054. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: Jogador não conectado.");
  6055. SetarVip(ID, Leveis);
  6056. return 1;
  6057. }
  6058.  
  6059. CMD:tirarvip(playerid, params[])
  6060. {
  6061. if(!NivelRequerido(playerid, 5)) return 1;
  6062. new Motivo[128];
  6063. if(sscanf(params, "us", ID, Motivo)) return MensagemDupla(playerid, "LV ADMIN: Use /tirarvip [ID] [MOTIVO]", "Use o comando para tirar VIP de um jogador.");
  6064. if(!IsPlayerConnected(ID)) return Msg(playerid, VERMELHO, "ERRO: Jogador não conectado.");
  6065. format(String, sizeof String, "LV VIP: O admin %s retirou seu VIP. Motivo: %s.", Nome(playerid), Motivo);
  6066. Msg(ID, COR_VIP, String);
  6067. Msg(playerid, LARANJA, "LV ADMIN: Comando efetuado com sucesso !");
  6068. return 1;
  6069. }
  6070.  
  6071. // ========================================================================================================
  6072.  
  6073. // Comandos Players
  6074. CMD:admins(playerid)
  6075. {
  6076. new Online[10], IsAdmin, AdminNivel[15];
  6077. for(new i = 0; i < MAX_PLAYERS; i++)
  6078. {
  6079. if(IsPlayerConnected(i))
  6080. {
  6081. if(PlayerInfo[i][pAdmin] > 0)
  6082. {
  6083. Msg(playerid, ROSA, "Admin Online:");
  6084. if(PlayerInfo[i][pAdmin] == 1) AdminNivel = "Moderador";
  6085. if(PlayerInfo[i][pAdmin] == 2) AdminNivel = "Admin";
  6086. if(PlayerInfo[i][pAdmin] == 3) AdminNivel = "Admin";
  6087. if(PlayerInfo[i][pAdmin] == 4) AdminNivel = "Admin Sub Dono";
  6088. if(PlayerInfo[i][pAdmin] == 5) AdminNivel = "Admin Dono";
  6089. if(PlayerInfo[i][pAfk] == 1) Online = "AFK";
  6090. if(PlayerInfo[i][pAfk] == 0) Online = "Online";
  6091. format(String, sizeof(String), "%s | %s | %s ", Nome(i), AdminNivel, Online);
  6092. Msg(playerid, LARANJA, String);
  6093. IsAdmin ++;
  6094. }
  6095. }
  6096. }
  6097. if(IsAdmin == 0)
  6098. {
  6099. Msg(playerid, CINZA, "LV: Nenhum Admin Online!");
  6100. }
  6101. IsAdmin = 0;
  6102. Msg(playerid, CINZA, "LV: Use /helpers");
  6103. return 1;
  6104. }
  6105.  
  6106. CMD:helpers(playerid)
  6107. {
  6108. new Online[10], IsHelper;
  6109. for(new i = 0; i < MAX_PLAYERS; i++)
  6110. {
  6111. if(PlayerInfo[i][pHelper])
  6112. {
  6113. Msg(playerid, VERDE, "Helpers Online:");
  6114. if(PlayerInfo[i][pAfk] == 1) Online = "AFK";
  6115. if(PlayerInfo[i][pAfk] == 0) Online = "Online";
  6116. format(String, sizeof(String), "Helper | %s | %s", Nome(i), Online);
  6117. Msg(playerid, VERDE_CLARO, String);
  6118. IsHelper ++;
  6119. }
  6120. }
  6121. if(IsHelper == 0)
  6122. {
  6123. Msg(playerid, CINZA, "LV: Nenhum Helper Online!");
  6124. }
  6125. IsHelper = 0;
  6126. return 1;
  6127. }
  6128.  
  6129. CMD:vips(playerid)
  6130. {
  6131. new Online[10], IsVip;
  6132. for(new i = 0; i < MAX_PLAYERS; i++)
  6133. {
  6134. if(PlayerInfo[i][pVip])
  6135. {
  6136. Msg(playerid, COR_VIP, "Vips Online:");
  6137. if(PlayerInfo[i][pAfk] == 1) Online = "AFK";
  6138. if(PlayerInfo[i][pAfk] == 0) Online = "Online";
  6139. format(String, sizeof(String), "VIP | %s | %s", Nome(i), Online);
  6140. Msg(playerid, COR_VIP, String);
  6141. IsVip ++;
  6142. }
  6143. }
  6144. if(IsVip == 0)
  6145. {
  6146. Msg(playerid, CINZA, "LV: Nenhum VIP Online!");
  6147. }
  6148. IsVip = 0;
  6149. return 1;
  6150. }
  6151.  
  6152. CMD:duvida(playerid, params[])
  6153. {
  6154. new texto[128];
  6155. if(sscanf(params, "s", texto)) return MensagemDupla(playerid, "Use /duvida [pergunta]", "Use o comando para enviar uma duvida aos Helpers online.");
  6156. Pergunta[playerid] = texto;
  6157.  
  6158. format(String, sizeof(String), "{FFA500}[ATENÇÃO] Duvida de %s: %s. Use /responder", Nome(playerid), texto);
  6159. ChatHelper(-1, String, 1);
  6160. return 1;
  6161. }
  6162.  
  6163. CMD:taxi(playerid, params[])
  6164. {
  6165. new Local[128];
  6166. if(sscanf(params, "s", Local)) return MensagemDupla(playerid, "Use /taxi [LOCAL]", "Use o comando para pedir um taxi em determinado local.");
  6167.  
  6168. Msg(playerid, AMARELO, "TAXI: Os taxistas foram informados, aguarde uma resposta.");
  6169. format(String, sizeof(String), "[ATENÇÃO] %s pediu um taxi. Local: %s. Atenda-o e não esqueça de ligar o taximetro.", Nome(playerid), Local);
  6170. AvisarTaxista(AMARELO, String, 1);
  6171. return 1;
  6172. }
  6173.  
  6174. CMD:taximetro(playerid, params[])
  6175. {
  6176. if(PlayerInfo[playerid][pProfissao] != TAXISTA) return Msg(playerid, -1, "{FF0000}ERRO:»{FFD700} Você não trabalha como taxista!");
  6177. new modelo = GetVehicleModel(GetPlayerVehicleID(playerid));
  6178. if(modelo != 420 && modelo != 438) return Msg(playerid, VERMELHO, "ERRO: Você não esta em um taxi!");
  6179. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return Msg(playerid, VERMELHO, "ERRO: Você não esta dirigindo um taxi!");
  6180. if(sscanf(params, "u", ID)) return MensagemDupla(playerid, "Use /taximetro [ID]", "Use o comando para ligar o taximetro para determinado id.");
  6181. if(GetPlayerVehicleID(ID) != GetPlayerVehicleID(ID)) return Msg(playerid, VERMELHO, "ERRO: Esse player não está em seu taxi!");
  6182. SetTimerEx("Taximetro", 5000, true, "i", ID);
  6183. format(String, sizeof(String), "TAXI: %s ligou o taximetro, serão cobrados R$1 por metro.", Nome(playerid));
  6184. Msg(ID, AMARELO, String);
  6185. return 1;
  6186. }
  6187.  
  6188. CMD:abastecer(playerid)
  6189. {
  6190. if(AreaPosto[playerid] == 0) return Msg(playerid, VERMELHO, "ERRO: Você não está em um posto de combustivel!");
  6191. if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid, VERMELHO, "ERRO: Você não está em nenhum veículo!");
  6192. new Dialog[230];
  6193. format(Dialog, sizeof(Dialog),"{F8F8FF}Olá {058AFF}%s{F8F8FF}.\nObrigado pela preferência.\nO valor do litro de gasolina custa R$ 3.\n\nInforme a baixo a quantidade de litros:\nAbasteça sempre gasolina adtivada para melhor desempenho!\n", Nome(playerid));
  6194. ShowPlayerDialog(playerid, DIALOG_ABASTECER, DIALOG_STYLE_PASSWORD, "~ ABASTECENDO ~", Dialog, "Abastecer", "Cancelar");
  6195. return 1;
  6196. }
  6197.  
  6198. CMD:enchergalao(playerid)
  6199. {
  6200. if(AreaPosto[playerid] == 0) return Msg(playerid, VERMELHO, "ERRO: Você não está em um posto de combustivel!");
  6201. if(PlayerInfo[playerid][TemGalao] == 0) return Msg(playerid, VERMELHO, "ERRO: Você não tem um galão de gasolina, digite /comprargalao para adquirir!");
  6202. if(PlayerInfo[playerid][GalaoGasolina] >= 20) return Msg(playerid, VERMELHO, "ERRO: Seu galão de gasolina ja está cheio!");
  6203. new Dialog[260];
  6204. format(Dialog, sizeof(Dialog),"{F8F8FF}Olá {058AFF}%s{F8F8FF}.\nObrigado pela preferência.\nO valor do litro de gasolina custa R$ 3.\n\nInforme a baixo a quantidade de litros no galão:\n{058AFF}Obs:{F8F8FF} O galão suporta somente 20 litros de gasolina.\nAbasteça sempre gasolina adtivada para melhor desempenho!\n", Nome(playerid));
  6205. ShowPlayerDialog(playerid, DIALOG_GALAOABAST, DIALOG_STYLE_PASSWORD, "~ ABASTECENDO GALÃO ~", Dialog, "Abastecer", "Cancelar");
  6206. return 1;
  6207. }
  6208.  
  6209. CMD:comprargalao(playerid)
  6210. {
  6211. if(AreaPosto[playerid] == 0) return Msg(playerid, VERMELHO, "ERRO: Você não está em um posto de combustivel!");
  6212. if(PlayerInfo[playerid][TemGalao] == 1) return Msg(playerid, VERMELHO, "ERRO: Você ja possue um galão de gasolina!");
  6213. if(GetPlayerCash(playerid) < 1000) return Msg(playerid, VERMELHO, "ERRO: Saldo insuficiente, o valor do galão é de R$ 1000.");
  6214. GivePlayerCash(playerid, -1000);
  6215. PlayerInfo[playerid][TemGalao] = 1;
  6216. PlayerInfo[playerid][GalaoGasolina] = 20;
  6217. Msg(playerid, AZUL_CLARO, "LV: Obrigado, você comprou um galão de 20 litros ja cheio por R$ 1000.");
  6218. Msg(playerid, AZUL_CLARO, "LV: Para abastece-lo entre em seu veiculo e use /abastecergalao [litros].");
  6219. return 1;
  6220. }
  6221.  
  6222. CMD:abastecergalao(playerid, params[])
  6223. {
  6224. if(PlayerInfo[playerid][TemGalao] == 0) return Msg(playerid, VERMELHO, "ERRO: Você não tem um galão de gasolina, vá a um posto e digite /comprargalao para adquirir!");
  6225. if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid, VERMELHO, "ERRO: Você não está em nenhum veículo!");
  6226. if(PlayerInfo[playerid][GalaoGasolina] == 0) return Msg(playerid, VERMELHO, "ERRO: Seu galão de gasolina está vazio!");
  6227.  
  6228. if(sscanf(params, "i", ID)) return MensagemDupla(playerid, "Use /abastecergalao [litros]", "Use o comando para abastecer seu carro com o galão.");
  6229. if(ID > PlayerInfo[playerid][GalaoGasolina]) return Msg(playerid, VERMELHO, "ERRO: Seu galão não possue essa quantidade de litros.");
  6230.  
  6231. new vehicleid = GetPlayerVehicleID(playerid);
  6232. if(ID + GasolinaVeiculo[vehicleid] < 100)
  6233. {
  6234. GasolinaVeiculo[vehicleid] += ID;
  6235. PlayerInfo[playerid][GalaoGasolina] -= ID;
  6236. format(String, sizeof(String), "LV: Foram abastecidos %d litros em seu veiculo.", ID);
  6237. Msg(playerid, AZUL_CLARO, String);
  6238. return 1;
  6239. }
  6240.  
  6241. if(ID + GasolinaVeiculo[vehicleid])
  6242. {
  6243. new quantia = 100 - GasolinaVeiculo[vehicleid];
  6244. GasolinaVeiculo[vehicleid] = 100;
  6245. PlayerInfo[playerid][GalaoGasolina] -= ID;
  6246. format(String, sizeof(String), "LV: Foram abastecidos %d litros em seu veiculo.", quantia);
  6247. Msg(playerid, AZUL_CLARO, String);
  6248. return 1;
  6249. }
  6250. return 1;
  6251. }
  6252.  
  6253. CMD:quantidadegalao(playerid)
  6254. {
  6255. if(PlayerInfo[playerid][TemGalao] == 0) return Msg(playerid, VERMELHO, "ERRO: Você não tem um galão de gasolina, vá a um posto e digite /comprargalao para adquirir!");
  6256. if(PlayerInfo[playerid][GalaoGasolina] == 0) return Msg(playerid, VERMELHO, "ERRO: Seu galão de gasolina está vazio!");
  6257.  
  6258. format(String, sizeof(String), "LV: O seu galao possue %d litros de gasolina. Para usá-los, digite /abastecergalao em um carro.", PlayerInfo[playerid][GalaoGasolina]);
  6259. Msg(playerid, AZUL_CLARO, String);
  6260. return 1;
  6261. }
  6262.  
  6263. CMD:radiohunter(playerid)
  6264. {
  6265. PlayAudioStreamForPlayer(playerid, "http://live.hunterfm.com/live");
  6266. Msg(playerid, -1, "{FF0000}Radio Hunter ligada!{FFFFFF}, Espere algums segundos para tocar.");
  6267. return 1;
  6268. }
  6269.  
  6270. CMD:radiooff(playerid)
  6271. {
  6272. StopAudioStreamForPlayer(playerid);
  6273. Msg(playerid, -1, "{FF0000}Radio desligada com sucesso!");
  6274. return 1;
  6275. }
  6276.  
  6277. CMD:banco(playerid)
  6278. {
  6279. Msg(playerid, -1, "Banco San Andreas.");
  6280. SelectTextDraw(playerid, 0xFF0000FF);
  6281. for(new i = 0; i < sizeof(Banco); i++) TextDrawShowForPlayer(playerid, Banco[i]);
  6282. return 1;
  6283. }
Add Comment
Please, Sign In to add comment