Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <victor>
- #include <a_mysql>
- #include <streamer>
- #include <zcmd>
- #include <sscanf2>
- /*
- _ _ _ _ ______ _
- | | | (_) | | | ___| (_)
- | | | |_ ___| |_ ___ _ __ | |_ ___ _ __ _ __ __ _ _ __ ___ ___ _
- | | | | |/ __| __/ _ \| '__| | _/ _ \ '__| '__/ _` | '__/ _ \/ __| |
- \ \_/ / | (__| || (_) | | | || __/ | | | | (_| | | | __/\__ \ |
- \___/|_|\___|\__\___/|_| \_| \___|_| |_| \__,_|_| \___||___/_|
- ___ _ __ ___ _ _ _
- / _ \ | | / / / _ \ | | | | | |
- / /_\ \ | |/ / / /_\ \ | |_| | __ _ ___| |__
- | _ | | \ | _ | | _ |/ _` / __| '_ \
- | | | |_| |\ \_| | | | | | | | (_| \__ \ | | |
- \_| |_(_)_| \_(_)_| |_/ \_| |_/\__,_|___/_| |_|
- Respeitem o meu release e meus créditos. Gamemode feito do Scratch, não terminei por que saí do servidor e acabei indo para outro. Espero que façam bom uso da base.
- Antes que perguntem, SIM, existem sistemas incompletos como o de armas: Ele funciona perfeitamente, mas vocês deverão adicionar as armas à gosto.
- Chequem a tabela na database de se diz respeito as armas, chequem a função OnPlayerGiveDamage e também a função FriskPlayer assim como o comando de comprar armas na warehouse.
- O Sistema de veículos precisa de alguns toques finais como criar uma tunadora para modificar o veículo e fazer edições à gosto.
- Se possível, na aba "Mode" do samp, deixem o nome do gamemode (SC-RP) para eu saber os servidores que estão utilizando isto.
- Estou dando release por vontade própria, então, desconsidero críticas e reclamações, afinal, não estou cobrando ninguém por nada ;)
- Cheers.
- */
- /*
- Faction Types: 1 = Police
- 2 = Medical
- 3 = Governamental
- 4 = Gang
- 5 = Máfia
- 6 = Motorcycle Club
- 7 = Facção Legal Independente
- Jail Types: 1 = Los Santos Prison
- 2 = Department Jail
- 3 = Admin Jail (Ajail)
- Bizzes Types: 0 = Null Biz
- 1 = 24/7
- 2 = Bar
- 3 = Club
- 4 = Weapon House
- */
- main()
- {
- print("\n**********************************************************");
- print("* ______________________________________________________ *");
- print("* ==========Scarlett (Roleplay) Gamemode============ *");
- print("* Owner/Scripter: Victor Ferraresi (Viiih / Hash) *");
- print("* This gamemode has been written from ZERO lines *");
- print("* Nothing is pasted from the web or another gamemodes *");
- print("* So, be careful with my credits. Cheers. *");
- print("* ______________________________________________________ *");
- print("**********************************************************\n");
- DisableInteriorEnterExits();
- }
- public OnGameModeInit()
- {
- SetGameModeText(SCRIPT_VERSION);
- format(string, sizeof(string), "hostname %s", SERVER_NAME);
- SendRconCommand(string);
- format(string, sizeof(string), "weburl %s", WEBSITE_URL);
- SendRconCommand(string);
- format(string, sizeof(string), "mapname %s", MAP_NAME);
- SendRconCommand(string);
- ShowPlayerMarkers(0);
- AddPlayerClass(0,1683.3234,-2286.5359,-1.2353,83.2267,0,0,0,0,0,0);
- MYSQLConnection = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
- LoadHouses();
- LoadFactions();
- LoadBizzes();
- LoadVehicles();
- LoadWeaponData();
- SaveWeaponData();
- TimerSegundos = SetTimer("TimerSeconds", 1000, true);
- r@TimerSegundos = SetTimer("r@TimerSeconds", 1000, true);
- TimerUpdate = SetTimer("UpdatePlayerEx", 100, true);
- TimerPayday = SetTimer("PaydayTimer", 5000, true);
- TimerMinutos = SetTimer("TimerMinutes", 300000, true);
- gettime(ghour, gminute, gsecond);
- return 1;
- }
- stock GetVehicleParameters(vehicleid, paramid)
- {
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- switch(paramid) {
- case 0: {
- if(engine == 1) return 0x01;
- return 0;
- }
- case 1:
- {
- if(lights == 1) return 0x01;
- return 0;
- }
- case 2:
- {
- if(alarm == 1) return 0x01;
- return 0;
- }
- case 3:
- {
- if(doors == 1) return 0x01;
- return 0;
- }
- case 4:
- {
- if(bonnet == 1) return 0x01;
- return 0;
- }
- case 5:
- {
- if(boot == 1) return 0x01;
- return 0;
- }
- case 6:
- {
- if(objective == 1) return 0x01;
- return 0;
- }
- }
- return 0;
- }
- stock GetName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- for(new i = 0; i < MAX_PLAYER_NAME; i++)
- {
- if (name[i] == '_') name[i] = ' ';
- }
- return name;
- }
- stock GetRankName(playerid)
- {
- new faction = playerinfo[playerid][pFaction];
- new rankname[128];
- if(playerinfo[playerid][pRank] == 1)
- {
- strmid(rankname, factioninfo[faction-1][fRank1], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 2)
- {
- strmid(rankname, factioninfo[faction-1][fRank2], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 3)
- {
- strmid(rankname, factioninfo[faction-1][fRank3], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 4)
- {
- strmid(rankname, factioninfo[faction-1][fRank4], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 5)
- {
- strmid(rankname, factioninfo[faction-1][fRank5], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 6)
- {
- strmid(rankname, factioninfo[faction-1][fRank6], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 7)
- {
- strmid(rankname, factioninfo[faction-1][fRank7], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 8)
- {
- strmid(rankname, factioninfo[faction-1][fRank8], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 9)
- {
- strmid(rankname, factioninfo[faction-1][fRank9], 0, sizeof(rankname), 255);
- }
- if(playerinfo[playerid][pRank] == 10)
- {
- strmid(rankname, factioninfo[faction-1][fRank10], 0, sizeof(rankname), 255);
- }
- return rankname;
- }
- stock GetMaskID(playerid)
- {
- new MaskID[128];
- format(MaskID, sizeof(MaskID), "[Desconhecido %s]", playerinfo[playerid][pMaskID]);
- return MaskID;
- }
- stock param_cutleft(str[])
- {
- new len = strlen(str),
- index = -1;
- if(!len)
- return 0;
- new
- ignorespaces = 1;
- while(++index < len)
- {
- if(str[index] == ' ')
- {
- if(ignorespaces)
- continue;
- strdel(str, 0, index + 1);
- return 1;
- }
- else
- if(ignorespaces)
- ignorespaces = 0;
- }
- str[0] = 0;
- return 1;
- }
- stock GetInsurancePrice(vehmodel, insurances)
- {
- if(vehmodel == 400) return 100 * insurances;
- else if(vehmodel == 401) return 100 * insurances;
- else if(vehmodel == 402) return 100 * insurances;
- else if(vehmodel == 403) return 100 * insurances;
- else if(vehmodel == 404) return 100 * insurances;
- else if(vehmodel == 405) return 100 * insurances;
- else if(vehmodel == 406) return 100 * insurances;
- else if(vehmodel == 407) return 100 * insurances;
- else if(vehmodel == 408) return 100 * insurances;
- else if(vehmodel == 409) return 100 * insurances;
- else if(vehmodel == 410) return 100 * insurances;
- else if(vehmodel == 411) return 100 * insurances;
- else if(vehmodel == 412) return 100 * insurances;
- else if(vehmodel == 413) return 100 * insurances;
- else if(vehmodel == 414) return 100 * insurances;
- else if(vehmodel == 415) return 100 * insurances;
- else if(vehmodel == 417) return 100 * insurances;
- else if(vehmodel == 418) return 100 * insurances;
- else if(vehmodel == 419) return 100 * insurances;
- else if(vehmodel == 420) return 100 * insurances;
- else if(vehmodel == 421) return 100 * insurances;
- else if(vehmodel == 422) return 100 * insurances;
- else if(vehmodel == 423) return 100 * insurances;
- else if(vehmodel == 424) return 100 * insurances;
- else if(vehmodel == 426) return 100 * insurances;
- else if(vehmodel == 428) return 100 * insurances;
- else if(vehmodel == 429) return 100 * insurances;
- else if(vehmodel == 434) return 100 * insurances;
- else if(vehmodel == 436) return 100 * insurances;
- else if(vehmodel == 439) return 100 * insurances;
- else if(vehmodel == 443) return 100 * insurances;
- else if(vehmodel == 444) return 100 * insurances;
- else if(vehmodel == 445) return 100 * insurances;
- else if(vehmodel == 446) return 100 * insurances;
- else if(vehmodel == 451) return 100 * insurances;
- else if(vehmodel == 452) return 100 * insurances;
- else if(vehmodel == 453) return 100 * insurances;
- else if(vehmodel == 454) return 100 * insurances;
- else if(vehmodel == 455) return 100 * insurances;
- else if(vehmodel == 456) return 100 * insurances;
- else if(vehmodel == 457) return 100 * insurances;
- else if(vehmodel == 458) return 100 * insurances;
- else if(vehmodel == 459) return 100 * insurances;
- else if(vehmodel == 460) return 100 * insurances;
- else if(vehmodel == 461) return 100 * insurances;
- else if(vehmodel == 462) return 100 * insurances;
- else if(vehmodel == 463) return 100 * insurances;
- else if(vehmodel == 466) return 100 * insurances;
- else if(vehmodel == 467) return 100 * insurances;
- else if(vehmodel == 468) return 100 * insurances;
- else if(vehmodel == 469) return 100 * insurances;
- else if(vehmodel == 471) return 100 * insurances;
- else if(vehmodel == 473) return 100 * insurances;
- else if(vehmodel == 474) return 100 * insurances;
- else if(vehmodel == 475) return 100 * insurances;
- else if(vehmodel == 477) return 100 * insurances;
- else if(vehmodel == 478) return 100 * insurances;
- else if(vehmodel == 479) return 100 * insurances;
- else if(vehmodel == 480) return 100 * insurances;
- else if(vehmodel == 481) return 100 * insurances;
- else if(vehmodel == 482) return 100 * insurances;
- else if(vehmodel == 483) return 100 * insurances;
- else if(vehmodel == 484) return 100 * insurances;
- else if(vehmodel == 485) return 100 * insurances;
- else if(vehmodel == 486) return 100 * insurances;
- else if(vehmodel == 487) return 100 * insurances;
- else if(vehmodel == 489) return 100 * insurances;
- else if(vehmodel == 491) return 100 * insurances;
- else if(vehmodel == 492) return 100 * insurances;
- else if(vehmodel == 493) return 100 * insurances;
- else if(vehmodel == 494) return 100 * insurances;
- else if(vehmodel == 495) return 100 * insurances;
- else if(vehmodel == 496) return 100 * insurances;
- else if(vehmodel == 498) return 100 * insurances;
- else if(vehmodel == 499) return 100 * insurances;
- else if(vehmodel == 500) return 100 * insurances;
- else if(vehmodel == 502) return 100 * insurances;
- else if(vehmodel == 503) return 100 * insurances;
- else if(vehmodel == 504) return 100 * insurances;
- else if(vehmodel == 505) return 100 * insurances;
- else if(vehmodel == 506) return 100 * insurances;
- else if(vehmodel == 507) return 100 * insurances;
- else if(vehmodel == 508) return 100 * insurances;
- else if(vehmodel == 509) return 100 * insurances;
- else if(vehmodel == 510) return 100 * insurances;
- else if(vehmodel == 511) return 100 * insurances;
- else if(vehmodel == 512) return 100 * insurances;
- else if(vehmodel == 513) return 100 * insurances;
- else if(vehmodel == 514) return 100 * insurances;
- else if(vehmodel == 515) return 100 * insurances;
- else if(vehmodel == 516) return 100 * insurances;
- else if(vehmodel == 517) return 100 * insurances;
- else if(vehmodel == 518) return 100 * insurances;
- else if(vehmodel == 519) return 100 * insurances;
- else if(vehmodel == 521) return 100 * insurances;
- else if(vehmodel == 522) return 100 * insurances;
- else if(vehmodel == 524) return 100 * insurances;
- else if(vehmodel == 525) return 100 * insurances;
- else if(vehmodel == 526) return 100 * insurances;
- else if(vehmodel == 527) return 100 * insurances;
- else if(vehmodel == 529) return 100 * insurances;
- else if(vehmodel == 530) return 100 * insurances;
- else if(vehmodel == 531) return 100 * insurances;
- else if(vehmodel == 532) return 100 * insurances;
- else if(vehmodel == 533) return 100 * insurances;
- else if(vehmodel == 534) return 100 * insurances;
- else if(vehmodel == 535) return 100 * insurances;
- else if(vehmodel == 536) return 100 * insurances;
- else if(vehmodel == 539) return 100 * insurances;
- else if(vehmodel == 540) return 100 * insurances;
- else if(vehmodel == 541) return 100 * insurances;
- else if(vehmodel == 542) return 100 * insurances;
- else if(vehmodel == 543) return 100 * insurances;
- else if(vehmodel == 544) return 100 * insurances;
- else if(vehmodel == 545) return 100 * insurances;
- else if(vehmodel == 546) return 100 * insurances;
- else if(vehmodel == 547) return 100 * insurances;
- else if(vehmodel == 549) return 100 * insurances;
- else if(vehmodel == 550) return 100 * insurances;
- else if(vehmodel == 551) return 100 * insurances;
- else if(vehmodel == 552) return 100 * insurances;
- else if(vehmodel == 553) return 100 * insurances;
- else if(vehmodel == 554) return 100 * insurances;
- else if(vehmodel == 555) return 100 * insurances;
- else if(vehmodel == 556) return 100 * insurances;
- else if(vehmodel == 557) return 100 * insurances;
- else if(vehmodel == 558) return 100 * insurances;
- else if(vehmodel == 559) return 100 * insurances;
- else if(vehmodel == 560) return 100 * insurances;
- else if(vehmodel == 561) return 100 * insurances;
- else if(vehmodel == 562) return 100 * insurances;
- else if(vehmodel == 563) return 100 * insurances;
- else if(vehmodel == 565) return 100 * insurances;
- else if(vehmodel == 566) return 100 * insurances;
- else if(vehmodel == 567) return 100 * insurances;
- else if(vehmodel == 568) return 100 * insurances;
- else if(vehmodel == 571) return 100 * insurances;
- else if(vehmodel == 572) return 100 * insurances;
- else if(vehmodel == 573) return 100 * insurances;
- else if(vehmodel == 575) return 100 * insurances;
- else if(vehmodel == 576) return 100 * insurances;
- else if(vehmodel == 578) return 100 * insurances;
- else if(vehmodel == 579) return 100 * insurances;
- else if(vehmodel == 580) return 100 * insurances;
- else if(vehmodel == 581) return 100 * insurances;
- else if(vehmodel == 583) return 100 * insurances;
- else if(vehmodel == 585) return 100 * insurances;
- else if(vehmodel == 586) return 100 * insurances;
- else if(vehmodel == 587) return 100 * insurances;
- else if(vehmodel == 588) return 100 * insurances;
- else if(vehmodel == 589) return 100 * insurances;
- else if(vehmodel == 592) return 100 * insurances;
- else if(vehmodel == 593) return 100 * insurances;
- else if(vehmodel == 600) return 100 * insurances;
- else if(vehmodel == 602) return 100 * insurances;
- else if(vehmodel == 603) return 100 * insurances;
- else if(vehmodel == 609) return 100 * insurances;
- return 0;
- }
- stock DealershipPrice(model)
- {
- if(model == 400) return 40000;
- else if(model == 401) return 16000;
- else if(model == 402) return 46000;
- else if(model == 403) return 25000;
- else if(model == 404) return 12000;
- else if(model == 405) return 32000;
- else if(model == 406) return 200000;
- else if(model == 407) return 50000;
- else if(model == 408) return 80000;
- else if(model == 409) return 110000;
- else if(model == 410) return 9000;
- else if(model == 411) return 500000;
- else if(model == 412) return 23000;
- else if(model == 413) return 20000;
- else if(model == 414) return 45000;
- else if(model == 415) return 475000;
- else if(model == 417) return 250000;
- else if(model == 418) return 10000;
- else if(model == 419) return 18000;
- else if(model == 420) return 12000;
- else if(model == 421) return 36000;
- else if(model == 422) return 14000;
- else if(model == 423) return 25000;
- else if(model == 424) return 85000;
- else if(model == 426) return 40000;
- else if(model == 428) return 40000;
- else if(model == 429) return 57000;
- else if(model == 434) return 49000;
- else if(model == 436) return 11000;
- else if(model == 439) return 17000;
- else if(model == 443) return 100000;
- else if(model == 444) return 175000;
- else if(model == 445) return 31500;
- else if(model == 446) return 275000;
- else if(model == 451) return 625000;
- else if(model == 452) return 175000;
- else if(model == 453) return 22000;
- else if(model == 454) return 20000;
- else if(model == 455) return 80000;
- else if(model == 456) return 22000;
- else if(model == 457) return 10000;
- else if(model == 458) return 13500;
- else if(model == 459) return 21000;
- else if(model == 460) return 215000;
- else if(model == 461) return 50000;
- else if(model == 462) return 7000;
- else if(model == 463) return 13000;
- else if(model == 466) return 19500;
- else if(model == 467) return 22500;
- else if(model == 468) return 37500;
- else if(model == 469) return 175000;
- else if(model == 471) return 15000;
- else if(model == 473) return 30000;
- else if(model == 474) return 16200;
- else if(model == 475) return 24500;
- else if(model == 477) return 125000;
- else if(model == 478) return 17500;
- else if(model == 479) return 12000;
- else if(model == 480) return 72000;
- else if(model == 481) return 4500;
- else if(model == 482) return 20500;
- else if(model == 483) return 19500;
- else if(model == 484) return 50000;
- else if(model == 485) return 30000;
- else if(model == 486) return 150000;
- else if(model == 487) return 200000;
- else if(model == 489) return 25999;
- else if(model == 491) return 28000;
- else if(model == 492) return 25000;
- else if(model == 493) return 60000;
- else if(model == 494) return 100000;
- else if(model == 495) return 90000;
- else if(model == 496) return 19000;
- else if(model == 498) return 50000;
- else if(model == 499) return 45000;
- else if(model == 500) return 22500;
- else if(model == 502) return 100000;
- else if(model == 503) return 100000;
- else if(model == 504) return 100000;
- else if(model == 505) return 75000;
- else if(model == 506) return 700000;
- else if(model == 507) return 34000;
- else if(model == 508) return 50000;
- else if(model == 509) return 4500;
- else if(model == 510) return 10000;
- else if(model == 511) return 215000;
- else if(model == 512) return 200000;
- else if(model == 513) return 220000;
- else if(model == 514) return 35000;
- else if(model == 515) return 40000;
- else if(model == 516) return 16200;
- else if(model == 517) return 20000;
- else if(model == 518) return 24000;
- else if(model == 519) return 300000;
- else if(model == 521) return 80000;
- else if(model == 522) return 100000;
- else if(model == 524) return 80000;
- else if(model == 525) return 12000;
- else if(model == 526) return 14000;
- else if(model == 527) return 14000;
- else if(model == 529) return 14500;
- else if(model == 530) return 90000;
- else if(model == 531) return 40000;
- else if(model == 532) return 200000;
- else if(model == 533) return 50000;
- else if(model == 534) return 27000;
- else if(model == 535) return 36000;
- else if(model == 536) return 24000;
- else if(model == 539) return 150000;
- else if(model == 540) return 29000;
- else if(model == 541) return 550000;
- else if(model == 542) return 17500;
- else if(model == 543) return 13500;
- else if(model == 544) return 50000;
- else if(model == 545) return 34500;
- else if(model == 546) return 15000;
- else if(model == 547) return 18000;
- else if(model == 549) return 17500;
- else if(model == 550) return 50000;
- else if(model == 551) return 42000;
- else if(model == 552) return 30000;
- else if(model == 553) return 250000;
- else if(model == 554) return 27000;
- else if(model == 555) return 60000;
- else if(model == 556) return 200000;
- else if(model == 557) return 200000;
- else if(model == 558) return 56000;
- else if(model == 559) return 66000;
- else if(model == 560) return 375000;
- else if(model == 561) return 50000;
- else if(model == 562) return 105000;
- else if(model == 563) return 50000;
- else if(model == 565) return 48000;
- else if(model == 566) return 27000;
- else if(model == 567) return 28000;
- else if(model == 568) return 50000;
- else if(model == 571) return 85000;
- else if(model == 572) return 15000;
- else if(model == 573) return 90000;
- else if(model == 575) return 23000;
- else if(model == 576) return 17500;
- else if(model == 578) return 90000;
- else if(model == 579) return 40000;
- else if(model == 580) return 41500;
- else if(model == 581) return 40000;
- else if(model == 583) return 25000;
- else if(model == 585) return 15000;
- else if(model == 586) return 11000;
- else if(model == 587) return 20000;
- else if(model == 588) return 36000;
- else if(model == 589) return 16000;
- else if(model == 592) return 350000;
- else if(model == 593) return 225000;
- else if(model == 600) return 13500;
- else if(model == 602) return 34000;
- else if(model == 603) return 43000;
- else if(model == 609) return 62000;
- return 0;
- }
- stock DealershipValid(id, dealerid)
- {
- if(dealerid == 1)
- {
- switch(id) {
- case 400, 401, 402, 404 , 405, 409, 410, 411, 412, 415, 418,
- 419, 421, 422, 426, 429, 436, 439, 445, 451, 461, 463, 458, 466, 467, 468, 474, 475,
- 477, 479, 480, 481, 482, 483, 489, 491, 492, 496, 500, 506, 507,
- 509, 516: return 1;
- }
- }
- if(dealerid == 2)
- {
- switch(id)
- {
- case 517, 518, 521, 526, 527, 529, 533, 534, 535,
- 536, 540, 541, 542, 543, 545, 546, 547, 549, 550,
- 551, 554, 555, 558, 559, 560, 561, 562, 565, 566,
- 567, 575, 576, 579, 580, 585, 586, 587, 589, 600,
- 602, 603,413,456,498,499,414,525, 420, 462: return 1;
- }
- }
- if(dealerid == 3)
- {
- switch(id)
- {
- case 473, 453, 454, 446, 499: return 1;
- }
- }
- return 0;
- }
- stock GetBizType(bizid)
- {
- new typename[24];
- switch(bizid) {
- case 0: format(typename, sizeof(typename), "NULL");
- case 1: format(typename, sizeof(typename), "24/7");
- case 2: format(typename, sizeof(typename), "Bar");
- case 3: format(typename, sizeof(typename), "Club");
- case 4: format(typename, sizeof(typename), "Weapon House");
- case 5: format(typename, sizeof(typename), "Clothes");
- case 6: format(typename, sizeof(typename), "Donut");
- case 7: format(typename, sizeof(typename), "Bar");
- case 8: format(typename, sizeof(typename), "Sex Shop");
- case 9: format(typename, sizeof(typename), "WeapMake");
- case 10: format(typename, sizeof(typename), "DrugMake");
- case 11: format(typename, sizeof(typename), "Complex");
- case 12: format(typename, sizeof(typename), "Club");
- }
- return typename;
- }
- stock timec(timestamp, compare = -1) {
- if (compare == -1) {
- compare = gettime();
- }
- new
- n,
- Float:d = (timestamp > compare) ? timestamp - compare : compare - timestamp,
- returnstr[32];
- if (d < 60) {
- format(returnstr, sizeof(returnstr), "< 1 minuto");
- return returnstr;
- } else if (d < 3600) { // 3600 = 1 hour
- n = floatround(floatdiv(d, 60.0), floatround_floor);
- format(returnstr, sizeof(returnstr), "minuto");
- } else if (d < 86400) { // 86400 = 1 day
- n = floatround(floatdiv(d, 3600.0), floatround_floor);
- format(returnstr, sizeof(returnstr), "hora");
- } else if (d < 2592000) { // 2592000 = 1 month
- n = floatround(floatdiv(d, 86400.0), floatround_floor);
- format(returnstr, sizeof(returnstr), "dia");
- } else if (d < 31536000) { // 31536000 = 1 year
- n = floatround(floatdiv(d, 2592000.0), floatround_floor);
- format(returnstr, sizeof(returnstr), "mês");
- } else {
- n = floatround(floatdiv(d, 31536000.0), floatround_floor);
- format(returnstr, sizeof(returnstr), "ano");
- }
- if (n == 1) {
- format(returnstr, sizeof(returnstr), "1 %s", returnstr);
- } else {
- format(returnstr, sizeof(returnstr), "%d %ss", n, returnstr);
- }
- return returnstr;
- }
- stock GetRespect(level)
- {
- new nextlevel = level+1;
- new expamount = nextlevel*levelexp;
- return expamount;
- }
- public OnGameModeExit()
- {
- SaveHouses();
- SaveFactions();
- SaveWeaponData();
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pLogado] == 1)
- {
- SaveUser(i);
- }
- }
- KillTimer(TimerSegundos);
- KillTimer(r@TimerSegundos);
- KillTimer(TimerUpdate);
- KillTimer(TimerPayday);
- KillTimer(TimerMinutos);
- mysql_close(MYSQLConnection);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- format(query, sizeof(query), "SELECT * FROM `playerinfo` WHERE `Name` = '%s' AND `Accepted` = '1' LIMIT 1", GetName(playerid));
- mysql_function_query(MYSQLConnection, query, true, "CheckAccount", "d", playerid);
- MaskText[playerid] = Create3DTextLabel(" ", 0xD8D8D8AA, 30.0,40.0,50.0,15.0,0);
- SetPlayerColor(playerid, -1);
- return 1;
- }
- function:RemovePlayerWeapon(playerid, weaponid)
- {
- new plyWeapons[12] = 0;
- new plyAmmo[12] = 0;
- for(new slot = 0; slot != 12; slot++)
- {
- new wep, ammo;
- GetPlayerWeaponData(playerid, slot, wep, ammo);
- if(wep != weaponid && ammo != 0)
- {
- GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
- }
- }
- ResetPlayerWeapons(playerid);
- for(new slot = 0; slot != 12; slot++)
- {
- if(plyAmmo[slot] != 0)
- {
- GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
- }
- }
- return 0x01;
- }
- function:PaydayTimer()
- {
- new tmphour;
- new tmpminute;
- new tmpsecond;
- gettime(tmphour, tmpminute, tmpsecond);
- if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
- {
- format(string, sizeof(string), "* [Horário] São %d:00 horas",tmphour);
- SendClientMessageToAll(COLOR_SOS, string);
- ghour = tmphour;
- Payday();
- new hour, minute, second;
- gettime(hour, minute, second);
- }
- }
- function:Payday()
- {
- for(new i = 0; i <= MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && playerinfo[i][pLogado] == 1)
- {
- new cash = 50;
- switch(playerinfo[i][pJob])
- {
- //To be done
- }
- switch(playerinfo[i][pRank])
- {
- case 0 .. 10: cash = (cash + playerinfo[i][pRank]*50);
- }
- new vipgold;
- vipgold = (playerinfo[i][pDonate] == 1 ? 50 : playerinfo[i][pDonate] == 2 ? 100 : playerinfo[i][pDonate] == 3 ? 200 : playerinfo[i][pDonate] == 4 ? 325 : 0);
- SendClientMessage(i, COLOR_SOS, "_______________________[Payday]_______________________");
- format(string, 128, "Pagamento diário: $%d ", cash);
- SendClientMessage(i, -1, string);
- format(string, 128, "Saldo antigo: $%d", playerinfo[i][pBank]);
- SendClientMessage(i, -1, string);
- playerinfo[i][pBank] = playerinfo[i][pBank]+cash;
- playerinfo[i][pBank] = playerinfo[i][pBank]+vipgold;
- format(string, 128, "Novo saldo: $%d", playerinfo[i][pBank]);
- SendClientMessage(i, -1, string);
- GameTextForAll("Payday", 3000, 1);
- SendClientMessage(i, COLOR_SOS, "-------------------------------------------------");
- playerinfo[i][pRespeitos] ++ ;
- playerinfo[i][pPlayingTime] = 0;
- SaveUser(i);
- }
- }
- return 1;
- }
- function:ShowStats(playerid, targetid)
- {
- new string1[512];
- new cash = playerinfo[playerid][pMoney];
- new account = playerinfo[playerid][pBank];
- new level = playerinfo[playerid][pLevel];
- new exp = playerinfo[playerid][pRespeitos];
- new cellphone = playerinfo[playerid][pCellphone];
- new expamount = GetRespect(playerinfo[playerid][pLevel]);
- format(string, sizeof(string), " [%s] ", GetName(playerid));
- format(string1, sizeof(string1), " Nome: %s | Dinheiro: [$%d] | Banco: [$%d] | Tel: [%d] | Level: [%d] | Respeito: [%d/%d] ", GetName(playerid), cash,account, cellphone, level, exp, expamount);
- SendClientMessage(targetid, COLOR_SOS, string);
- SendClientMessage(targetid, COLOR_SOS, string1);
- return 1;
- }
- function:FriskPlayer(playerid, targetid)
- {
- new ammo[12],weapon[12], name[50];
- for(new i = 0; i < 12; i++)
- {
- GetPlayerWeaponData(targetid, i+1, weapon[i], ammo[i]);
- }
- format(string, sizeof(string), "Corpo de %s", GetName(targetid));
- SendClientMessage(playerid, COLOR_NEUTRAL2, string);
- if(weapon[1] == 22)
- {
- if(playerinfo[targetid][pPistolType] == 4)
- {
- strmid(name, weapondata[3][wName], 0, 128, 255);
- format(string, sizeof(string), "%s (%d)", name, ammo[1]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- if(playerinfo[targetid][pPistolType] == 5)
- {
- strmid(name, weapondata[4][wName], 0, 128, 255);
- format(string, sizeof(string), "%s (%d)", name, ammo[1]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- }
- if(weapon[1] == 24)
- {
- if(playerinfo[targetid][pPistolType] == 1)
- {
- strmid(name, weapondata[0][wName], 0, 128, 255);
- format(string, sizeof(string), "%s (%d)", name, ammo[1]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- if(playerinfo[targetid][pPistolType] == 2)
- {
- strmid(name, weapondata[1][wName], 0, 128, 255);
- format(string, sizeof(string), "%s (%d)", name, ammo[1]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- if(playerinfo[targetid][pPistolType] == 3)
- {
- strmid(name, weapondata[2][wName], 0, 128, 255);
- format(string, sizeof(string), "%s (%d)", name, ammo[1]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- }
- if(weapon[4] == 31)
- {
- if(playerinfo[targetid][pRifleType] == 1)
- {
- strmid(name, weapondata[5][wName], 0, 128, 255);
- format(string, sizeof(string), "%s (%d)", name, ammo[4]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- }
- if(weapon[3] == 29)
- {
- if(playerinfo[targetid][pSubType] == 1)
- {
- strmid(name, weapondata[6][wName], 0, 128, 255);
- format(string, sizeof(string), "%s (%d)", name, ammo[3]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- }
- return 1;
- }
- function:TimerSeconds()
- {
- for(new i = 0; i < MAX_PLAYERS; ++i)
- {
- for(new a = 0; a < MAX_HOUSES; a++)
- {
- if(IsPlayerInRangeOfPoint(i, 2.0, houseinfo[a][hEntranceX], houseinfo[a][hEntranceY], houseinfo[a][hEntranceZ]) && houseinfo[a][hOwned] == 1)
- {
- new houseid = a;
- if(HouseMarker[i] == 0)
- {
- DisablePlayerCheckpoint(i);
- if(!IsPlayerInRangeOfPoint(i, 2.0, houseinfo[houseid][hEntranceX], houseinfo[houseid][hEntranceY], houseinfo[houseid][hEntranceZ]))
- {
- HouseMarked[i] = 9999;
- }
- if(HouseMarked[i] == a) return 1;
- format(string, sizeof(string), "Nº %d Dono: %s.", a, houseinfo[a][hOwner]);
- SendClientMessage(i, COLOR_NEUTRAL, string);
- format(string, sizeof(string), "Os comandos são /entrar, /casa alugar.");
- SendClientMessage(i, COLOR_NEUTRAL2, string);
- SetPlayerCheckpoint(i, houseinfo[houseid][hEntranceX], houseinfo[houseid][hEntranceY], houseinfo[houseid][hEntranceZ], 1.0);
- HouseMarker[i] = 2;
- HouseMarked[i] = a;
- }
- }
- }
- if(playerinfo[i][pRinging] == 1)
- {
- if(RingingTime[i] == 0)
- {
- format(string, sizeof(string), "* O celular de %s está tocando.", GetName(i));
- ProxDetector(20.0, i, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);
- RingingTime[i] = 5;
- }
- }
- if(playerinfo[i][pCameraInterpol] == 1)
- {
- InterpolateCameraPos(i, 0.0, 0.0, 0.0, 1958, 1343, 15, 3000, 1);
- playerinfo[i][pCameraInterpol] ++;
- }
- if(playerinfo[i][pCameraInterpol] >= 2)
- {
- playerinfo[i][pCameraInterpol] ++;
- }
- if(playerinfo[i][pCameraInterpol] == 7)
- {
- InterpolateCameraPos(i, 1958, 1343, 15, 500, 500, 500, 3000, 2);
- }
- if(playerinfo[i][pCameraInterpol] == 12)
- {
- InterpolateCameraPos(i, 500, 500, 500, 400, 400, 400, 3000,2);
- playerinfo[i][pCameraInterpol] = 1;
- }
- if(playerinfo[i][pCameraInterpol] == 17)
- {
- InterpolateCameraPos(i, 400, 400, 400, 0, 0, 0, 3000,2);
- playerinfo[i][pCameraInterpol] = 1;
- }
- }
- return 1;
- }
- function:r@TimerSeconds()
- {
- for( new i = 0; i < MAX_PLAYERS; i++)
- {
- if(HouseMarker[i] > 0)
- {
- HouseMarker[i]--;
- }
- if(RingingTime[i] > 0)
- {
- RingingTime[i]--;
- }
- if(playerinfo[i][pLogado] == 1)
- {
- playerinfo[i][pPlayingTime] ++;
- }
- if(playerinfo[i][pJailTime] > 0)
- {
- playerinfo[i][pJailTime] --;
- if(playerinfo[i][pJailTime] == 0)
- {
- playerinfo[i][pJailed] = 0;
- SetPlayerPos(i, 1515.6228,-1673.2925,14.0469);
- SetPlayerVirtualWorld(i, 0);
- SetPlayerInterior(i, 0);
- SetPlayerFacingAngle(i, 87.9105);
- playerinfo[i][pJailType] = 0;
- SaveUser(i);
- }
- }
- if(TowingCar[i] > 0)
- {
- TowingCar[i] --;
- format(string, sizeof(string), "Aguarde %d segundos para o carro ser rebocado", TowingCar[i]);
- GameTextForPlayer(i, string, 1000, 5);
- if(TowingCar[i] == 0)
- {
- SetVehicleToRespawn(TowedCar[i]);
- SetVehiclePos(TowedCar[i], vehicleinfo[TowedCar[i]][vParkPos1], vehicleinfo[TowedCar[i]][vParkPos2], vehicleinfo[TowedCar[i]][vParkPos3]);
- SetVehicleZAngle(TowedCar[i], vehicleinfo[TowedCar[i]][vParkPos4]);
- TowedCar[i] = 0;
- playerinfo[i][pMoney] -= 1000;
- GivePlayerMoney(i, -1000);
- }
- }
- }
- return 1;
- }
- function:UpdatePlayerEx(playerid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pLogado] == 1)
- {
- if(playerinfo[playerid][pMascarado] == 0)
- {
- ShowPlayerNameTagForPlayer(i,playerid,1);
- }
- else
- {
- Attach3DTextLabelToPlayer(MaskText[playerid], playerid, 0,0,0);
- ShowPlayerNameTagForPlayer(i,playerid,0);
- }
- }
- }
- return 1;
- }
- function:TimerMinutes()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pLogado] == 1 && playerinfo[i][pAdmin] < 1)
- {
- if(playerinfo[i][pJailType] != 3)
- {
- GetPlayerPos(i, playerinfo[i][pPlayerPos][0], playerinfo[i][pPlayerPos][1], playerinfo[i][pPlayerPos][2]);
- if(playerinfo[i][pPlayerPos][0] == playerinfo[i][pPlayerPos][3] && playerinfo[i][pPlayerPos][1] == playerinfo[i][pPlayerPos][4] && playerinfo[i][pPlayerPos][2] == playerinfo[i][pPlayerPos][5])
- {
- format(string, sizeof(string), "AdmCmd: Você foi kickado automaticamente por ficar AFK!", GetName(i));
- SendClientMessage(i,COLOR_BAN,string);
- Kick(i);
- }
- playerinfo[i][pPlayerPos][3] = playerinfo[i][pPlayerPos][0];
- playerinfo[i][pPlayerPos][4] = playerinfo[i][pPlayerPos][1];
- playerinfo[i][pPlayerPos][5] = playerinfo[i][pPlayerPos][2];
- Idle[i] = 0;
- }
- }
- }
- return 1;
- }
- function:Log(const File[], lstr[])
- {
- if(!fexist(File))
- {
- new File:Arquivo = fopen(File, io_write);
- fclose(Arquivo);
- }
- new cells[300];
- new a, m, d, h, mi, s;
- getdate(a, m, d);
- gettime(h,mi,s);
- format(cells, sizeof(cells), "%s\r\n", lstr);
- new File:Arquivo = fopen(File, io_append);
- fwrite(Arquivo, cells);
- fclose(Arquivo);
- return 1;
- }
- function:CheckAccount(playerid)
- {
- new rows, fields;
- cache_get_data(rows, fields);
- if(!rows)
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_MSGBOX, "Scarlett Roleplay", "Você não está registrado em nosso UCP (www.site.com.br)\nRegistre-se antes de logar!", "Ok", "Ok");
- return Kick(playerid);
- }
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Scarlett Roleplay (Login)", "Digite sua senha abaixo para logar-se!", "Login", "Logout");
- playerinfo[playerid][pCameraInterpol] = 1;
- return 1;
- }
- function:Login(playerid, password[])
- {
- format(query, sizeof(query), "SELECT * FROM `playerinfo` WHERE `Name` = '%s' AND `Password` = md5('%s')", GetName(playerid), password);
- mysql_function_query(MYSQLConnection, query, true, "r@Login", "ds[24]", playerid, GetName(playerid));
- return 1;
- }
- function:r@Login(playerid, name[32])
- {
- new rows, fields;
- cache_get_data(rows, fields);
- if(!rows)
- {
- if(Tentatives[playerid] == 2)
- {
- Tentatives[playerid] = 0;
- return Kick(playerid);
- }
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Scarlett Roleplay (Login)", "Senha Incorreta! Digite sua senha abaixo para logar-se!", "Login", "Logout");
- Tentatives[playerid] ++;
- }
- else
- {
- CleanChat(playerid);
- SendClientMessage(playerid, 0x97CBFFAA, "------------------------------------------------");
- SendClientMessage(playerid, 0xE8E8E8AA, "Programadores: Victor Ferraresi");
- SendClientMessage(playerid, 0xE8E8E8AA, "Versão: 1.4.5 Alpha");
- SendClientMessage(playerid, 0xE8E8E8AA, "Site: NONE");
- SendClientMessage(playerid, 0x97CBFFAA, "------------------------------------------------");
- SendClientMessage(playerid, 0xE8E8E8AA, "[SC-RP]: É sempre um prazer ter você de volta !");
- new IP[24];
- GetPlayerIp(playerid, IP, 24);
- format(string, sizeof(string), "[%s] %s - %s", getDateEx(), GetName(playerid), IP);
- Log("Logins.log", string);
- playerinfo[playerid][pLogado] = 1;
- new valor[128];
- cache_get_field_content(0, "Name", playerinfo[playerid][pName], MYSQLConnection);
- cache_get_field_content(0, "Password", playerinfo[playerid][pPassword], MYSQLConnection);
- cache_get_field_content(0, "Level", valor, MYSQLConnection);
- playerinfo[playerid][pLevel] = strval(valor);
- cache_get_field_content(0, "Money", valor, MYSQLConnection);
- playerinfo[playerid][pMoney] = strval(valor);
- cache_get_field_content(0, "Bank", valor, MYSQLConnection);
- playerinfo[playerid][pBank] = strval(valor);
- cache_get_field_content(0, "Skin", valor, MYSQLConnection);
- playerinfo[playerid][pSkin] = strval(valor);
- cache_get_field_content(0, "SpawnType", valor, MYSQLConnection);
- playerinfo[playerid][pSpawnType] = strval(valor);
- cache_get_field_content(0, "Faction", valor, MYSQLConnection);
- playerinfo[playerid][pFaction] = strval(valor);
- cache_get_field_content(0, "Rank", valor, MYSQLConnection);
- playerinfo[playerid][pRank] = strval(valor);
- cache_get_field_content(0, "Ferido", valor, MYSQLConnection);
- playerinfo[playerid][pFerido] = strval(valor);
- cache_get_field_content(0, "MaskID", playerinfo[playerid][pMaskID], MYSQLConnection);
- cache_get_field_content(0, "Admin", valor, MYSQLConnection);
- playerinfo[playerid][pAdmin] = strval(valor);
- cache_get_field_content(0, "Tester", valor, MYSQLConnection);
- playerinfo[playerid][pTester] = strval(valor);
- cache_get_field_content(0, "Casa1", valor, MYSQLConnection);
- playerinfo[playerid][pCasa1] = strval(valor);
- cache_get_field_content(0, "Casa2", valor, MYSQLConnection);
- playerinfo[playerid][pCasa2] = strval(valor);
- cache_get_field_content(0, "JailTime", valor, MYSQLConnection);
- playerinfo[playerid][pJailTime] = strval(valor);
- cache_get_field_content(0, "JailType", valor, MYSQLConnection);
- playerinfo[playerid][pJailType] = strval(valor);
- cache_get_field_content(0, "Jailed", valor, MYSQLConnection);
- playerinfo[playerid][pJailed] = strval(valor);
- cache_get_field_content(0, "Mask", valor, MYSQLConnection);
- playerinfo[playerid][pMask] = strval(valor);
- cache_get_field_content(0, "Donate", valor, MYSQLConnection);
- playerinfo[playerid][pDonate] = strval(valor);
- cache_get_field_content(0, "Biz", valor, MYSQLConnection);
- playerinfo[playerid][pEmpresa] = strval(valor);
- cache_get_field_content(0, "PlayingTime", valor, MYSQLConnection);
- playerinfo[playerid][pPlayingTime] = strval(valor);
- cache_get_field_content(0, "DonatorExpire", valor, MYSQLConnection);
- playerinfo[playerid][pDonatorExpire] = strval(valor);
- cache_get_field_content(0, "Respeito", valor, MYSQLConnection);
- playerinfo[playerid][pRespeitos] = strval(valor);
- cache_get_field_content(0, "PistolType", valor, MYSQLConnection);
- playerinfo[playerid][pPistolType] = strval(valor);
- cache_get_field_content(0, "RifleType", valor, MYSQLConnection);
- playerinfo[playerid][pRifleType] = strval(valor);
- cache_get_field_content(0, "SubType", valor, MYSQLConnection);
- playerinfo[playerid][pSubType] = strval(valor);
- cache_get_field_content(0, "Cellphone", valor, MYSQLConnection);
- playerinfo[playerid][pCellphone] = strval(valor);
- cache_get_field_content(0, "Tutorial", valor, MYSQLConnection);
- playerinfo[playerid][pTutorial] = strval(valor);
- if(playerinfo[playerid][pDonatorExpire] > 0)
- {
- if(playerinfo[playerid][pDonatorExpire] < gettime())
- {
- SendClientMessage(playerid, COLOR_SOS, " O seu tempo de Donate expirou! Obrigado por doar para o Scarlett Roleplay. ");
- playerinfo[playerid][pDonatorExpire] = 0;
- playerinfo[playerid][pDonate] = 0;
- }
- else
- {
- new expiresin = playerinfo[playerid][pDonatorExpire];
- new iRandomTime = (expiresin-gettime())+gettime();
- format(string, sizeof(string), "O seu Donate irá expirar em %s", timec(iRandomTime));
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- }
- playerinfo[playerid][pBlockUser] = -1;
- playerinfo[playerid][pPmAllowed] = -1;
- playerinfo[playerid][pTesterDuty] = 0;
- playerinfo[playerid][pAdminDuty] = 0;
- playerinfo[playerid][pMascarado] = 0;
- SetPlayerColor(playerid, -1);
- if(playerinfo[playerid][pDonate] < 1)
- {
- playerinfo[playerid][pMask] = 0;
- }
- SetSpawnInfo(playerid, 1, 264, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid, playerinfo[playerid][pMoney]);
- SetPlayerScore(playerid, playerinfo[playerid][pLevel]);
- SetPlayerSkin(playerid, playerinfo[playerid][pSkin]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
- LoadPlayerDrugs(playerid);
- if(playerinfo[playerid][pSpawnType] == 0) //Normal
- {
- SetPlayerPos(playerid, 1036.9316, -1850.9518, 13.5703); //Spawn Civil
- return 1;
- }
- if(playerinfo[playerid][pSpawnType] == 1) //Casa 1
- {
- new id;
- id = playerinfo[playerid][pCasa1];
- SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);
- return 1;
- }
- if(playerinfo[playerid][pSpawnType] == 2) //Casa 2
- {
- new id;
- id = playerinfo[playerid][pCasa2];
- SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);
- return 1;
- }
- if(playerinfo[playerid][pSpawnType] == 3) //Faction
- {
- new id;
- id = strval(playerinfo[playerid][pFaction]);
- SetPlayerPos(playerid, factioninfo[id][fSpawnX], factioninfo[id][fSpawnY], factioninfo[id][fSpawnZ]);
- return 1;
- }
- if(playerinfo[playerid][pJailed] == 1)
- {
- if(playerinfo[playerid][pJailType] == 1) //County Jail
- {
- SetPlayerPos(playerid, 30, 30, 30);
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");
- return 1;
- }
- if(playerinfo[playerid][pJailType] == 2) //LSP
- {
- SetPlayerPos(playerid, 7, 7, 7);
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");
- return 1;
- }
- if(playerinfo[playerid][pJailType] == 3) //AJAIL
- {
- SetPlayerInterior(playerid, 5);
- SetPlayerPos(playerid, 322.197998, 302.497985, 999.148437);
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena (OOCly)");
- return 1;
- }
- }
- if(playerinfo[playerid][pTutorial] == 0)
- {
- new number = 111111 + random(999999);
- playerinfo[playerid][pCellphone] = number;
- playerinfo[playerid][pTutorial] = 1;
- }
- }
- return 1;
- }
- function:CleanChat(playerid)
- {
- for(new i = 0; i < 100; i++)
- {
- SendClientMessage(playerid, -1, "");
- }
- return 1;
- }
- function:IsPlayerNearPlayer(Float:radi, playerid, targetid)
- {
- if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- GetPlayerPos(targetid, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid))
- {
- return 1;
- }
- }
- }
- return 0;
- }
- function:ProxDetector(Float:radi, playerid, strings[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) // If the player is within 16 meters
- {
- SendClientMessage(i, col1, strings);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
- {
- SendClientMessage(i, col2, strings);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
- {
- SendClientMessage(i, col3, strings);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
- {
- SendClientMessage(i, col4, strings);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
- {
- SendClientMessage(i, col5, strings);
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- return 1;
- }
- function:ProxDetectorAction(Float:radi, playerid, message[],col1,col2,col3,col4,col5)
- {
- if(!IsPlayerConnected(playerid)) return 1;
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i <= MAX_PLAYERS; ++i) {
- if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))) {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/15) && (tempposx > -radi/15)) && ((tempposy < radi/16) && (tempposy > -radi/17)) && ((tempposz < radi/18) && (tempposz > -radi/18)))
- {
- LongAction(i,col1,message);
- }
- else if (((tempposx < radi/6) && (tempposx > -radi/6)) && ((tempposy < radi/6) && (tempposy > -radi/6)) && ((tempposz < radi/6) && (tempposz > -radi/6)))
- {
- LongAction(i, col2, message);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- LongAction(i, col3, message);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- LongAction(i, col4, message);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- LongAction(i, col5, message);
- }
- }
- }
- return 1;
- }
- function:LongAction(playerid, color, const strings[])
- {
- if(strlen(string) > 90)
- {
- new
- string1[210], string2[210], string3[210];
- format(string1, sizeof(string1), strings);
- format(string2, sizeof(string2), strings);
- strdel(string1, 90, 256);
- strdel(string2, 0, 90);
- format(string3, sizeof(string3), "%s ...", string1);
- SendClientMessage(playerid,color, string3);
- format(string3, sizeof(string3), "... %s", string2);
- SendClientMessage(playerid,color, string3);
- return true;
- }
- else {
- SendClientMessage(playerid,color, strings);
- return true;
- }
- }
- function:LongMessage(playerid, color, const strings[])
- {
- if(strlen(string) > 90)
- {
- new
- string1[210], string2[210], string3[210];
- format(string1, sizeof(string1), strings);
- format(string2, sizeof(string2), strings);
- strdel(string1, 90, 256);
- strdel(string2, 0, 90);
- format(string3, sizeof(string3), "%s ...", string1);
- SendClientMessage(playerid,color, string3);
- format(string3, sizeof(string3), "... %s", string2);
- SendClientMessage(playerid,color, string3);
- return true;
- }
- else {
- SendClientMessage(playerid,color, strings);
- return true;
- }
- }
- function:SaveUser(playerid)
- {
- format(query, sizeof(query), "UPDATE `playerinfo` SET Name = '%s', Password = '%s', Level = '%d', Money = '%d', Bank = '%d', Skin = '%d', SpawnType = '%d', Faction = '%d', Rank = '%d', Ferido = '%d', \
- MaskID = '%d', Admin = '%d', Tester = '%d', Casa1 = '%d', Casa2 = '%d', JailTime = '%d', JailType = '%d', Jailed = '%d', Mask = '%d', Donate = '%d', Biz = '%d',\
- PlayingTime = '%d', Job = '%d', DonatorExpire = '%d', Respeito = '%d', Cellphone = '%d', Tutorial = '%d' WHERE `Name` = '%s'",
- playerinfo[playerid][pName], playerinfo[playerid][pPassword], playerinfo[playerid][pLevel], playerinfo[playerid][pMoney], playerinfo[playerid][pBank], playerinfo[playerid][pSkin],
- playerinfo[playerid][pSpawnType], playerinfo[playerid][pFaction], playerinfo[playerid][pRank], playerinfo[playerid][pFerido], playerinfo[playerid][pMaskID], playerinfo[playerid][pAdmin],
- playerinfo[playerid][pTester], playerinfo[playerid][pCasa1], playerinfo[playerid][pCasa2], playerinfo[playerid][pJailTime], playerinfo[playerid][pJailType], playerinfo[playerid][pJailed],
- playerinfo[playerid][pMask], playerinfo[playerid][pDonate], playerinfo[playerid][pEmpresa], playerinfo[playerid][pPlayingTime], playerinfo[playerid][pJob], playerinfo[playerid][pDonatorExpire],
- playerinfo[playerid][pRespeitos], playerinfo[playerid][pCellphone], playerinfo[playerid][pTutorial], GetName(playerid));
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", playerid);
- format(query, sizeof(query), "UPDATE `playerinfo` SET PistolType = '%d', RifleType = '%d', SubType = '%d' WHERE `Name` = '%s'", playerinfo[playerid][pPistolType], playerinfo[playerid][pRifleType], playerinfo[playerid][pSubType],
- GetName(playerid));
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", playerid);
- format(query, sizeof(query), "UPDATE `druginfo` SET \
- `Cocaina` = '%d', `Crack` = '%d', `Heroina` = '%d', `Cachimbo` = '%d', `LSD` = '%d', \
- `Maconha` = '%d', `Haxixe` = '%d', `Agulhas` = '%d' \
- WHERE `Name` = '%s'",
- druginfo[playerid][pCocaina],druginfo[playerid][pCrack],druginfo[playerid][pHeroina],druginfo[playerid][pCachimbo],druginfo[playerid][pLSD],druginfo[playerid][pMaconha],druginfo[playerid][pHaxixe],
- druginfo[playerid][pAgulhas], GetName(playerid));
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 13);
- return 1;
- }
- function:LoadPlayerDrugs(playerid)
- {
- format(query, sizeof(query), "SELECT * FROM `druginfo` WHERE `Name` = '%s'", GetName(playerid));
- mysql_function_query(MYSQLConnection, query, true, "r@LoadPlayerDrugs", "ds[24]", playerid, GetName(playerid));
- return 1;
- }
- function:r@LoadPlayerDrugs(playerid, name[24])
- {
- new rows, fields;
- cache_get_data(rows, fields);
- new valores[128];
- cache_get_field_content(playerid, "Cocaina", valores, MYSQLConnection);
- druginfo[playerid][pCocaina] = strval(valores);
- cache_get_field_content(playerid, "Crack", valores, MYSQLConnection);
- druginfo[playerid][pCrack] = strval(valores);
- cache_get_field_content(playerid, "Heroina", valores, MYSQLConnection);
- druginfo[playerid][pHeroina] = strval(valores);
- cache_get_field_content(playerid, "Cachimbo", valores, MYSQLConnection);
- druginfo[playerid][pCachimbo] = strval(valores);
- cache_get_field_content(playerid, "LSD", valores, MYSQLConnection);
- druginfo[playerid][pLSD] = strval(valores);
- cache_get_field_content(playerid, "Maconha", valores, MYSQLConnection);
- druginfo[playerid][pMaconha] = strval(valores);
- cache_get_field_content(playerid, "Haxixe", valores, MYSQLConnection);
- druginfo[playerid][pHaxixe] = strval(valores);
- cache_get_field_content(playerid, "Agulhas", valores, MYSQLConnection);
- druginfo[playerid][pAgulhas] = strval(valores);
- return 1;
- }
- function:SaveHouses()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM `houseinfo`", true, "r@SaveHouses", "d", 0);
- return 1;
- }
- function:r@SaveHouses()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i = 1; i <= rows; i++)
- {
- format(query, sizeof(query), "UPDATE `houseinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
- Owner = '%s', Owned = '%d', Price = '%d', Locked = '%d' WHERE `ID` = '%d'", houseinfo[i][hEntranceX], houseinfo[i][hEntranceY], houseinfo[i][hEntranceZ], houseinfo[i][hExitX],
- houseinfo[i][hExitY], houseinfo[i][hExitZ], houseinfo[i][hInterior], houseinfo[i][hOwner], houseinfo[i][hOwned], houseinfo[i][hPrice],
- houseinfo[i][hLocked], i);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i);
- }
- return 1;
- }
- function:LoadHouses()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM `houseinfo`", true, "r@LoadHouses", "d", 0);
- return 1;
- }
- function:r@LoadHouses()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i; i < rows; i++)
- {
- new valores[128];
- cache_get_field_content(i, "ID", valores, MYSQLConnection);
- houseinfo[i][hID] = strval(valores);
- cache_get_field_content(i, "EntranceX", valores, MYSQLConnection);
- houseinfo[i][hEntranceX] = floatstr(valores);
- cache_get_field_content(i, "EntranceY", valores, MYSQLConnection);
- houseinfo[i][hEntranceY] = floatstr(valores);
- cache_get_field_content(i, "EntranceZ", valores, MYSQLConnection);
- houseinfo[i][hEntranceZ] = floatstr(valores);
- cache_get_field_content(i, "ExitX", valores, MYSQLConnection);
- houseinfo[i][hExitX] = floatstr(valores);
- cache_get_field_content(i, "ExitY", valores, MYSQLConnection);
- houseinfo[i][hExitY] = floatstr(valores);
- cache_get_field_content(i, "ExitZ", valores, MYSQLConnection);
- houseinfo[i][hExitZ] = floatstr(valores);
- cache_get_field_content(i, "Interior", valores, MYSQLConnection);
- houseinfo[i][hInterior] = strval(valores);
- cache_get_field_content(i, "Owner", houseinfo[i][hOwner], MYSQLConnection);
- cache_get_field_content(i, "Owned", valores, MYSQLConnection);
- houseinfo[i][hOwned] = strval(valores);
- cache_get_field_content(i, "Price", valores, MYSQLConnection);
- houseinfo[i][hPrice] = strval(valores);
- cache_get_field_content(i, "Locked", valores, MYSQLConnection);
- houseinfo[i][hLocked] = strval(valores);
- if(houseinfo[i][hOwned] == 0)
- {
- format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por: $%i", houseinfo[i][hPrice]);
- HouseEstrutura2[i] = CreateDynamicPickup(1239, 1, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ],0, 0, -1, 15.0);
- HouseEstrutura[i] = CreateDynamic3DTextLabel(string,0x008080FF,houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- }
- }
- printf("[SC-RP] Loaded %i Houses.", rows);
- return 1;
- }
- function:SaveHouse(houseid)
- {
- format(query, sizeof(query), "UPDATE `houseinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
- Owner = '%s', Owned = '%d', Price = '%d', Locked = '%d' WHERE `ID` = '%d'", houseinfo[houseid][hEntranceX], houseinfo[houseid][hEntranceY], houseinfo[houseid][hEntranceZ], houseinfo[houseid][hExitX],
- houseinfo[houseid][hExitY], houseinfo[houseid][hExitZ], houseinfo[houseid][hInterior], houseinfo[houseid][hOwner], houseinfo[houseid][hOwned], houseinfo[houseid][hPrice],
- houseinfo[houseid][hLocked], houseid);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 4);
- return 1;
- }
- function:CreateNewHouse(Float:X, Float:Y, Float:Z, price, interior)
- {
- format(string, sizeof(string), "INSERT INTO houseinfo (EntranceX, EntranceY, EntranceZ, Price, Owner) VALUES('%f', '%f', '%f', %i, 'None')",
- X, Y, Z, price);
- mysql_function_query(MYSQLConnection, string, false, "NewHouseCreated", "fffii", X,Y,Z,price,interior);
- return 1;
- }
- function:NewHouseCreated(Float:X, Float:Y, Float:Z, price, interior)
- {
- mysql_store_result();
- new sqlid = mysql_insert_id();
- mysql_free_result();
- printf("House Created: %i", sqlid);
- houseinfo[sqlid][hPrice] = price;
- houseinfo[sqlid][hEntranceX] = X;
- houseinfo[sqlid][hEntranceY] = Y;
- houseinfo[sqlid][hEntranceZ] = Z;
- houseinfo[sqlid][hLocked] = 1;
- strmid(houseinfo[sqlid][hOwner], "", 0, strlen(""), 255);
- format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por: $%i", houseinfo[sqlid][hPrice]);
- HouseEstrutura2[sqlid] = CreateDynamicPickup(1239, 1, houseinfo[sqlid][hEntranceX],houseinfo[sqlid][hEntranceY],houseinfo[sqlid][hEntranceZ],0, 0, -1, 15.0);
- HouseEstrutura[sqlid] = CreateDynamic3DTextLabel(string,0x008080FF,houseinfo[sqlid][hEntranceX],houseinfo[sqlid][hEntranceY],houseinfo[sqlid][hEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- switch(interior) {
- case 1: { // Jefferson Motel
- houseinfo[sqlid][hExitX] = 2220.26;
- houseinfo[sqlid][hExitY] = -1148.01;
- houseinfo[sqlid][hExitZ] = 1025.80;
- houseinfo[sqlid][hInterior] = 15;
- }
- case 2: { // House Large 1
- SetHouseExit(sqlid, 3 ,235.508994, 1189.169897 ,1080.339966);
- }
- case 3: { // House Medium
- SetHouseExit(sqlid,2, 225.756989, 1240.000000, 1082.149902);
- }
- case 4: { // House Small
- SetHouseExit(sqlid, 1, 223.043991, 1289.259888, 1082.199951);
- }
- case 5: {
- SetHouseExit(sqlid, 7, 225.630997, 1022.479980, 1084.069946);
- }
- case 6: {
- SetHouseExit(sqlid, 15, 295.138977, 1474.469971, 1080.519897);
- }
- case 7: {
- SetHouseExit(sqlid, 15, 328.493988, 1480.589966, 1084.449951);
- }
- case 8: {
- SetHouseExit(sqlid, 15, 385.803986, 1471.769897, 1080.209961);
- }
- case 9: {
- SetHouseExit(sqlid, 8, 2807.63, -1170.15, 1025.57);
- }
- case 10: {
- SetHouseExit(sqlid, 9, 2251.85, -1138.16, 1050.63);
- }
- case 11: {
- SetHouseExit(sqlid, 10, 2260.76, -1210.45, 1049.02);
- }
- case 12: {
- SetHouseExit(sqlid, 3, 2496.65, -1696.55, 1014.74);
- }
- case 13: {
- SetHouseExit(sqlid, 5, 1299.14, -794.77, 1084.00);
- }
- case 14: {
- SetHouseExit(sqlid, 10, 2262.83, -1137.71, 1050.63);
- }
- case 15: {
- SetHouseExit(sqlid, 9, 2365.42, -1131.85, 1050.88);
- }
- }
- SaveHouse(sqlid);
- return 1;
- }
- function:SetHouseExit(id, interiorid, Float:X, Float:Y, Float:Z)
- {
- houseinfo[id][hExitX] = X;
- houseinfo[id][hExitY] = Y;
- houseinfo[id][hExitZ] = Z;
- houseinfo[id][hInterior] = interiorid;
- return 1;
- }
- function:CreateNewBiz(Float:X, Float:Y, Float:Z, price, interior, tipo)
- {
- format(query, sizeof(query), "INSERT INTO businessinfo (EntranceX, EntranceY, EntranceZ, Price, Owner) VALUES('%f', '%f', '%f', %i, 'None')",
- X, Y, Z, price);
- mysql_function_query(MYSQLConnection, query, false, "NewBizCreated", "fffiii", X,Y,Z,price,interior,tipo);
- return 1;
- }
- function:NewBizCreated(Float:X, Float:Y, Float:Z, price, interior, tipo)
- {
- mysql_store_result();
- new sqlid = mysql_insert_id();
- mysql_free_result();
- printf("Business created: %s", sqlid);
- bizinfo[sqlid][bPrice] = price;
- bizinfo[sqlid][bEntranceX] = X;
- bizinfo[sqlid][bEntranceY] = Y;
- bizinfo[sqlid][bEntranceZ] = Z;
- bizinfo[sqlid][bType] = tipo;
- strmid(bizinfo[sqlid][bOwner], "None", 0, strlen("None"), 255);
- bizEstrutura2[sqlid] = CreateDynamicPickup(1239, 1, X,Y,Z,-1, -1, -1, 15.0);
- format(string, sizeof(string), "[Empresa a venda %s]\n$%i", GetBizType(bizinfo[sqlid][bType]), bizinfo[sqlid][bPrice]);
- bizEstrutura[sqlid] = CreateDynamic3DTextLabel(string,0x008080FF,X,Y,Z,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID);
- switch(interior) {
- case 1: {
- SetBizExitCoordinates(sqlid, 17, -25.884498,-185.868988,1003.546875);
- }
- case 2: {
- SetBizExitCoordinates(sqlid, 6, 296.919982,-108.071998,1001.515625);
- }
- case 3: {
- SetBizExitCoordinates(sqlid, 10, 375.962463,-65.816848,1001.507812);
- }
- case 4: {
- SetBizExitCoordinates(sqlid, 9, 364.9181,-10.5893,1001.8516);
- }
- case 5: {
- SetBizExitCoordinates(sqlid, 5, 372.5956,-133.2348,1001.4922);
- }
- case 6: {
- SetBizExitCoordinates(sqlid, 17, -204.439987,-8.469599,1002.273437);
- }
- case 7: {
- SetBizExitCoordinates(sqlid, 17, 381.169189,-188.803024,1000.632812);
- }
- case 8: {
- SetBizExitCoordinates(sqlid, 12, 1118.8878, -10.2737 , 1002.0859);
- }
- case 9: {
- SetBizExitCoordinates(sqlid, 3, 833.269775,10.588416,1004.179687);
- }
- case 10: {
- SetBizExitCoordinates(sqlid,3, -103.559165,-24.225606,1000.718750);
- }
- case 11: {
- SetBizExitCoordinates(sqlid, 6, -2240.468505,137.060440,1035.414062);
- }
- case 12: {
- SetBizExitCoordinates(sqlid,3, 207.054992,-138.804992,1003.507812);
- }
- case 13: {
- SetBizExitCoordinates(sqlid, 15, 207.737991,-109.019996,1005.132812);
- }
- case 14: {
- SetBizExitCoordinates(sqlid, 5, 226.293991,-7.431529,1002.210937);
- }
- case 15: {
- SetBizExitCoordinates(sqlid, 1, 203.777999,-48.492397,1001.804687);
- }
- case 16: {
- SetBizExitCoordinates(sqlid,18, 161.391006,-93.159156,1001.804687);
- }
- case 17: {
- SetBizExitCoordinates(sqlid,11, 501.980987,-69.150199,998.757812);
- }
- case 18: {
- SetBizExitCoordinates(sqlid, 2, 1204.809936,-11.586799,1000.921875);
- }
- case 19: {
- SetBizExitCoordinates(sqlid, 1, -794.806396,497.738037,1376.195312);
- }
- case 20: {
- SetBizExitCoordinates(sqlid, 3, 418.652984,-82.639793,1001.804687);
- }
- case 21,22: {
- SetBizExitCoordinates(sqlid, 1, 963.418762,2108.292480,1011.030273);
- }
- case 23: {
- SetBizExitCoordinates(sqlid, 0, 2019.8438,-1660.0923,2135.6104);
- }
- case 24: {
- SetBizExitCoordinates(sqlid, 1, 2269.7439,1628.5479,1084.2455);
- }
- case 25: {
- SetBizExitCoordinates(sqlid, 3, 950.0336,-7.6499,1001.1484);
- }
- case 26: {
- SetBizExitCoordinates(sqlid, 0, 2008.6963,-1709.8448,1806.4431);
- }
- case 27: { //jizzy
- SetBizExitCoordinates(sqlid, 3, -2637.69,1404.24,906.46);
- }
- case 28: { //alhamba
- SetBizExitCoordinates(sqlid, 17, 493.390991,-22.722799,1000.679687);
- }
- case 29: { //bar pequeno
- SetBizExitCoordinates(sqlid, 18, -227.027999,1401.229980,27.765625);
- }
- }
- SaveBiz(sqlid);
- }
- function:SetBizExitCoordinates(id, interiorid, Float:X, Float:Y, Float:Z)
- {
- bizinfo[id][bExitX] = X;
- bizinfo[id][bExitY] = Y;
- bizinfo[id][bExitZ] = Z;
- bizinfo[id][bInterior] = interiorid;
- SaveBiz(id);
- return 1;
- }
- function:SaveFactions()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM `factioninfo`", true, "r@SaveFactions", "d", 0);
- return 1;
- }
- function:r@SaveFactions()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i = 0; i < rows; i++)
- {
- format(query, sizeof(query), "UPDATE `factioninfo`\
- SET Name = '%s',\
- Type = '%i',\
- Members = '%i',\
- Rank1 = '%s',\
- Rank2 = '%s',\
- Rank3 = '%s',\
- Rank4 = '%s',\
- Rank5 = '%s',\
- Rank6 = '%s',\
- Rank7 = '%s',\
- Rank8 = '%s',\
- Rank9 = '%s',\
- Rank10 = '%s',\
- Bank = '%i',\
- SpawnX = '%f',\
- SpawnY = '%f',\
- SpawnZ = '%f'\
- WHERE `id` = '%d'", factioninfo[i][fName], factioninfo[i][fType], factioninfo[i][fMembers], factioninfo[i][fRank1], factioninfo[i][fRank2], factioninfo[i][fRank3],
- factioninfo[i][fRank4], factioninfo[i][fRank5], factioninfo[i][fRank6], factioninfo[i][fRank7], factioninfo[i][fRank8], factioninfo[i][fRank9], factioninfo[i][fRank10],
- factioninfo[i][fBank], factioninfo[i][fSpawnX], factioninfo[i][fSpawnY], factioninfo[i][fSpawnZ], i+1);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i);
- }
- return 1;
- }
- function:LoadFactions()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM `factioninfo`", true, "r@LoadFactions", "d", 0);
- return 1;
- }
- function:r@LoadFactions()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i = 0; i < rows; i++)
- {
- new valores[128];
- cache_get_field_content(i, "Name", factioninfo[i][fName], MYSQLConnection);
- cache_get_field_content(i, "Type", valores, MYSQLConnection);
- factioninfo[i][fType] = strval(valores);
- cache_get_field_content(i, "Rank1", factioninfo[i][fRank1], MYSQLConnection);
- cache_get_field_content(i, "Rank2", factioninfo[i][fRank2], MYSQLConnection);
- cache_get_field_content(i, "Rank3", factioninfo[i][fRank3], MYSQLConnection);
- cache_get_field_content(i, "Rank4", factioninfo[i][fRank4], MYSQLConnection);
- cache_get_field_content(i, "Rank5", factioninfo[i][fRank5], MYSQLConnection);
- cache_get_field_content(i, "Rank6", factioninfo[i][fRank6], MYSQLConnection);
- cache_get_field_content(i, "Rank7", factioninfo[i][fRank7], MYSQLConnection);
- cache_get_field_content(i, "Rank8", factioninfo[i][fRank8], MYSQLConnection);
- cache_get_field_content(i, "Rank9", factioninfo[i][fRank9], MYSQLConnection);
- cache_get_field_content(i, "Rank10", factioninfo[i][fRank10], MYSQLConnection);
- cache_get_field_content(i, "Bank", valores, MYSQLConnection);
- factioninfo[i][fBank] = strval(valores);
- cache_get_field_content(i, "SpawnX", valores, MYSQLConnection);
- factioninfo[i][fSpawnX] = floatstr(valores);
- cache_get_field_content(i, "SpawnY", valores, MYSQLConnection);
- factioninfo[i][fSpawnY] = floatstr(valores);
- cache_get_field_content(i, "SpawnZ", valores, MYSQLConnection);
- factioninfo[i][fSpawnZ] = floatstr(valores);
- }
- printf("[SC-RP] Loaded %i Factions.", rows);
- return 1;
- }
- function:LoadBizzes()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM `businessinfo`", true, "r@LoadBizzes", "d", 0);
- return 1;
- }
- function:r@LoadBizzes()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i; i < rows; i++)
- {
- new valores[128];
- cache_get_field_content(i, "ID", valores, MYSQLConnection);
- bizinfo[i][bID] = strval(valores);
- cache_get_field_content(i, "Name", bizinfo[i][bName], MYSQLConnection);
- cache_get_field_content(i, "EntranceX", valores, MYSQLConnection);
- bizinfo[i][bEntranceX] = floatstr(valores);
- cache_get_field_content(i, "EntranceY", valores, MYSQLConnection);
- bizinfo[i][bEntranceY] = floatstr(valores);
- cache_get_field_content(i, "EntranceZ", valores, MYSQLConnection);
- bizinfo[i][bEntranceZ] = floatstr(valores);
- cache_get_field_content(i, "ExitX", valores, MYSQLConnection);
- bizinfo[i][bExitX] = floatstr(valores);
- cache_get_field_content(i, "ExitY", valores, MYSQLConnection);
- bizinfo[i][bExitY] = floatstr(valores);
- cache_get_field_content(i, "ExitZ", valores, MYSQLConnection);
- bizinfo[i][bExitZ] = floatstr(valores);
- cache_get_field_content(i, "Interior", valores, MYSQLConnection);
- bizinfo[i][bInterior] = strval(valores);
- cache_get_field_content(i, "Owner", bizinfo[i][bOwner], MYSQLConnection);
- cache_get_field_content(i, "Owned", valores, MYSQLConnection);
- bizinfo[i][bOwned] = strval(valores);
- cache_get_field_content(i, "Price", valores, MYSQLConnection);
- bizinfo[i][bPrice] = strval(valores);
- cache_get_field_content(i, "Locked", valores, MYSQLConnection);
- bizinfo[i][bLocked] = strval(valores);
- cache_get_field_content(i, "Fee", valores, MYSQLConnection);
- bizinfo[i][bFee] = strval(valores);
- cache_get_field_content(i, "Type", valores, MYSQLConnection);
- bizinfo[i][bType] = strval(valores);
- cache_get_field_content(i, "Safe", valores, MYSQLConnection);
- bizinfo[i][bSafe] = strval(valores);
- if(bizinfo[i][bOwned] == 1)
- {
- format(string, sizeof(string), "[Empresa]\n[%s]\nEntrada: %d", bizinfo[i][bName], bizinfo[i][bFee]);
- }
- if(bizinfo[i][bOwned] == 0)
- {
- format(string, sizeof(string), "[Empresa]\n{FFF000}Vende-se por: $%i", bizinfo[i][bPrice]);
- }
- bizEstrutura2[i] = CreateDynamicPickup(1239, 1, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ],0, 0, -1, 15.0);
- bizEstrutura[i] = CreateDynamic3DTextLabel(string,0x008080FF,bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- }
- printf("[SC-RP] Loaded %i Businesses.", rows);
- return 1;
- }
- function:SaveBizzes()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM `businessinfo`", true, "r@SaveBizzes", "d", 0);
- return 1;
- }
- function:r@SaveBizzes()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i = 1; i <= rows; i++)
- {
- format(query, sizeof(query), "UPDATE `businessinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
- Owner = '%s', Owned = '%d', Price = '%d', Locked = '%d', Fee = '%d', Type = '%d', Name = '%s', Safe = '%d' WHERE `ID` = '%d'", bizinfo[i][bEntranceX], bizinfo[i][bEntranceY], bizinfo[i][bEntranceZ],
- bizinfo[i][bExitX], bizinfo[i][bExitY], bizinfo[i][bExitZ], bizinfo[i][bInterior], bizinfo[i][bOwner], bizinfo[i][bOwned], bizinfo[i][bPrice], bizinfo[i][bLocked], bizinfo[i][bFee],
- bizinfo[i][bType], bizinfo[i][bName], bizinfo[i][bSafe], i);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i);
- }
- return 1;
- }
- function:SaveBiz(bizid)
- {
- format(query, sizeof(query), "UPDATE `businessinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
- Owner = '%s', Owned = '%d', Price = '%d', Locked = '%d', Fee = '%d', Type = '%d', Name = '%s', Safe = '%d' WHERE `ID` = '%d'", bizinfo[bizid][bEntranceX], bizinfo[bizid][bEntranceY], bizinfo[bizid][bEntranceZ],
- bizinfo[bizid][bExitX], bizinfo[bizid][bExitY], bizinfo[bizid][bExitZ], bizinfo[bizid][bInterior], bizinfo[bizid][bOwner], bizinfo[bizid][bOwned], bizinfo[bizid][bPrice], bizinfo[bizid][bLocked], bizinfo[bizid][bFee],
- bizinfo[bizid][bType], bizinfo[bizid][bName], bizinfo[bizid][bSafe], bizid);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", bizid);
- return 1;
- }
- function:LoadVehicles()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM vehicleinfo LIMIT 2000", true, "r@LoadVehicles", "d", 11);
- return 1;
- }
- function:r@LoadVehicles()
- {
- new values[32], rows, fields;
- cache_get_data(rows, fields);
- new i = 1;
- for( ; i < rows; i++)
- {
- cache_get_field_content(i, "ID", values, MYSQLConnection);
- vehicleinfo[i][vSQLID] = strval(values);
- cache_get_field_content(i, "Model", values, MYSQLConnection);
- vehicleinfo[i][vModel] = strval(values);
- cache_get_field_content(i, "Color1", values, MYSQLConnection);
- vehicleinfo[i][vColors1] = strval(values);
- cache_get_field_content(i, "Color2", values, MYSQLConnection);
- vehicleinfo[i][vColors2] = strval(values);
- cache_get_field_content(i, "Mod1", values, MYSQLConnection);
- vehicleinfo[i][vMod][0] = strval(values);
- cache_get_field_content(i, "Mod2", values, MYSQLConnection);
- vehicleinfo[i][vMod][1] = strval(values);
- cache_get_field_content(i, "Mod3", values, MYSQLConnection);
- vehicleinfo[i][vMod][2] = strval(values);
- cache_get_field_content(i, "Mod4", values, MYSQLConnection);
- vehicleinfo[i][vMod][3] = strval(values);
- cache_get_field_content(i, "Mod5", values, MYSQLConnection);
- vehicleinfo[i][vMod][4] = strval(values);
- cache_get_field_content(i, "Mod6", values, MYSQLConnection);
- vehicleinfo[i][vMod][5] = strval(values);
- cache_get_field_content(i, "Mod7", values, MYSQLConnection);
- vehicleinfo[i][vMod][6] = strval(values);
- cache_get_field_content(i, "Mod8", values, MYSQLConnection);
- vehicleinfo[i][vMod][7] = strval(values);
- cache_get_field_content(i, "Mod9", values, MYSQLConnection);
- vehicleinfo[i][vMod][8] = strval(values);
- cache_get_field_content(i, "Mod10", values, MYSQLConnection);
- vehicleinfo[i][vMod][9] = strval(values);
- cache_get_field_content(i, "Mod11", values, MYSQLConnection);
- vehicleinfo[i][vMod][10] = strval(values);
- cache_get_field_content(i, "Mod12", values, MYSQLConnection);
- vehicleinfo[i][vMod][11] = strval(values);
- cache_get_field_content(i, "Mod13", values, MYSQLConnection);
- vehicleinfo[i][vMod][12] = strval(values);
- cache_get_field_content(i, "Health", values, MYSQLConnection);
- vehicleinfo[i][vHealth] = floatstr(values);
- cache_get_field_content(i, "Owner", vehicleinfo[i][vOwner], MYSQLConnection);
- cache_get_field_content(i, "Type", values, MYSQLConnection);
- vehicleinfo[i][vType] = strval(values);
- cache_get_field_content(i, "RentPrice", values, MYSQLConnection);
- vehicleinfo[i][vRentPrice] = strval(values);
- cache_get_field_content(i, "Price", values, MYSQLConnection);
- vehicleinfo[i][vPrice] = strval(values);
- cache_get_field_content(i, "Fuel", values, MYSQLConnection);
- vehicleinfo[i][vFuel] = strval(values);
- cache_get_field_content(i, "Job", values, MYSQLConnection);
- vehicleinfo[i][vJob] = strval(values);
- cache_get_field_content(i, "Buyable", values, MYSQLConnection);
- vehicleinfo[i][vBuyable] = strval(values);
- cache_get_field_content(i, "Locked", values, MYSQLConnection);
- vehicleinfo[i][vLocked] = strval(values);
- cache_get_field_content(i, "Rentable", values, MYSQLConnection);
- vehicleinfo[i][vRentable] = strval(values);
- cache_get_field_content(i, "ParkX", values, MYSQLConnection);
- vehicleinfo[i][vParkPos1] = floatstr(values);
- cache_get_field_content(i, "ParkY", values, MYSQLConnection);
- vehicleinfo[i][vParkPos2] = floatstr(values);
- cache_get_field_content(i, "ParkZ", values, MYSQLConnection);
- vehicleinfo[i][vParkPos3] = floatstr(values);
- cache_get_field_content(i, "ParkAngle", values, MYSQLConnection);
- vehicleinfo[i][vParkPos4] = floatstr(values);
- cache_get_field_content(i, "fCarID", values, MYSQLConnection);
- vehicleinfo[i][vFCarID] = strval(values);
- cache_get_field_content(i, "Alarm", values, MYSQLConnection);
- vehicleinfo[i][vAlarm] = strval(values);
- cache_get_field_content(i, "Locks", values, MYSQLConnection);
- vehicleinfo[i][vLock] = strval(values);
- cache_get_field_content(i, "Immobiliser", values, MYSQLConnection);
- vehicleinfo[i][vImmobiliser] = strval(values);
- cache_get_field_content(i, "Bought", values, MYSQLConnection);
- vehicleinfo[i][vBought] = strval(values);
- cache_get_field_content(i, "World", values, MYSQLConnection);
- vehicleinfo[i][vWorld] = strval(values);
- cache_get_field_content(i, "Weapon1", values, MYSQLConnection);
- vehicleinfo[i][vWeapons1] = strval(values);
- cache_get_field_content(i, "Weapon2", values, MYSQLConnection);
- vehicleinfo[i][vWeapons2] = strval(values);
- cache_get_field_content(i, "Weapon3", values, MYSQLConnection);
- vehicleinfo[i][vWeapons3] = strval(values);
- cache_get_field_content(i, "Ammo1", values, MYSQLConnection);
- vehicleinfo[i][vAmmo1] = strval(values);
- cache_get_field_content(i, "Ammo2", values, MYSQLConnection);
- vehicleinfo[i][vAmmo2] = strval(values);
- cache_get_field_content(i, "Ammo3", values, MYSQLConnection);
- vehicleinfo[i][vAmmo3] = strval(values);
- cache_get_field_content(i, "XMRadio", values, MYSQLConnection);
- vehicleinfo[i][vXMRadio] = strval(values);
- cache_get_field_content(i, "Insurance", values, MYSQLConnection);
- vehicleinfo[i][vInsurance] = strval(values);
- new vehicleadd = AddStaticVehicleEx(vehicleinfo[i][vModel], vehicleinfo[i][vParkPos1],vehicleinfo[i][vParkPos2],vehicleinfo[i][vParkPos3],vehicleinfo[i][vParkPos4],vehicleinfo[i][vColors1],vehicleinfo[i][vColors2], -1);
- SetVehicleZAngle(vehicleadd, vehicleinfo[i][vParkPos4]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][0]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][1]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][2]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][3]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][4]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][5]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][6]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][7]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][8]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][9]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][10]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][11]);
- AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][12]);
- SetVehicleHealth(vehicleadd, vehicleinfo[i][vHealth]);
- for(new b = 0; b < MAX_PLAYERS; b ++)
- {
- if(vehicleinfo[i][vLocked] == 1) SetVehicleParamsForPlayer(vehicleadd,b,0,1);
- if(vehicleinfo[i][vFCarID] != -1 && playerinfo[b][pFaction] != vehicleinfo[i][vFCarID]) SetVehicleParamsForPlayer(vehicleadd,b,0,1);
- if(vehicleinfo[i][vJob] != -1 && playerinfo[b][pJob] != vehicleinfo[i][vJob]) SetVehicleParamsForPlayer(vehicleadd,b,0,1);
- }
- SetVehicleToRespawn(vehicleadd);
- if(!strcmp(vehicleinfo[i][vOwner], "Faction", true))
- {
- SetVehicleVirtualWorld(vehicleadd, 0);
- }
- else
- {
- SetVehicleVirtualWorld(vehicleadd, i+1);
- }
- }
- printf("[SC-RP] Loaded %d Vehicles.", rows);
- return 1;
- }
- function:SaveVehicle(sqlid, id)
- {
- if(!IsValidVehicle(id)) return 1;
- if(vehicleinfo[id][vModel] == 0) return 1;
- if(vehicleinfo[id][vCreated] == 1) return 1;
- format(query, sizeof(query), "UPDATE vehicleinfo SET Model=%i,\
- ParkX='%f',\
- ParkY='%f',\
- ParkZ='%f',\
- ParkAngle='%f',\
- Color1=%i,\
- Color2=%i,\
- Mod1=%i,\
- Mod2=%i,\
- Mod3=%i,\
- Mod4=%i,\
- Mod5=%i,\
- Mod6=%i,\
- Mod7=%i,\
- Mod8=%i,\
- Mod9=%i,\
- Mod10=%i,\
- Mod11=%i,\
- Mod12=%i,\
- Mod13=%i,\
- Health='%f',\
- Owner='%s',\
- Type=%i,\
- RentPrice=%i,\
- Price=%i,\
- Fuel=%i,\
- Job=%i,\
- Buyable=%i,\
- Locked=%i,\
- Rentable=%i,\
- fCarID=%d,\
- Alarm=%i,\
- Locks=%i,\
- Destroyed=%i,\
- TimesDestroyed=%i WHERE ID = %i",
- vehicleinfo[id][vModel],vehicleinfo[id][vParkPos1],vehicleinfo[id][vParkPos2],vehicleinfo[id][vParkPos3],vehicleinfo[id][vParkPos4],
- vehicleinfo[id][vColors1],vehicleinfo[id][vColors2],vehicleinfo[id][vMod][0],vehicleinfo[id][vMod][1],vehicleinfo[id][vMod][2],vehicleinfo[id][vMod][3],
- vehicleinfo[id][vMod][4],vehicleinfo[id][vMod][5],vehicleinfo[id][vMod][6],vehicleinfo[id][vMod][7],vehicleinfo[id][vMod][8],
- vehicleinfo[id][vMod][9],vehicleinfo[id][vMod][10],vehicleinfo[id][vMod][11],vehicleinfo[id][vMod][12], vehicleinfo[id][vHealth],vehicleinfo[id][vOwner],
- vehicleinfo[id][vType],vehicleinfo[id][vRentPrice],vehicleinfo[id][vPrice], vehicleinfo[id][vFuel],vehicleinfo[id][vJob],
- vehicleinfo[id][vBuyable],vehicleinfo[id][vLocked], vehicleinfo[id][vRentable],vehicleinfo[id][vFCarID], vehicleinfo[id][vAlarm],vehicleinfo[id][vLock],
- vehicleinfo[id][vDestroyed], vehicleinfo[id][vTimesDestroyed], sqlid);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 5);
- format(query, sizeof(query), "UPDATE vehicleinfo SET Immobiliser=%i,\
- Bought=%i,\
- Insurance=%i,\
- World=%i,\
- Weapon1=%i,\
- Weapon2=%i,\
- Weapon3=%i,\
- Ammo1=%i,\
- Ammo2=%i,\
- Ammo3=%i,\
- XMRadio=%i WHERE ID =%i",
- vehicleinfo[id][vImmobiliser], vehicleinfo[id][vBought], vehicleinfo[id][vInsurance], vehicleinfo[id][vWorld], \
- vehicleinfo[id][vWeapons1],vehicleinfo[id][vWeapons2],vehicleinfo[id][vWeapons3],vehicleinfo[id][vAmmo1],vehicleinfo[id][vAmmo2],vehicleinfo[id][vAmmo3],vehicleinfo[id][vXMRadio], sqlid);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 5);
- return 1;
- }
- function:AddForSaleVehicle(playerid, model, Float: X, Float: Y, Float: Z, Float:Angle, price)
- {
- format(query, sizeof(query), "INSERT INTO vehicleinfo (Owner) VALUES('%s')", GetName(playerid));
- mysql_function_query(MYSQLConnection, query, false, "onSaleVehicleAdded", "ddffffd", playerid, model, X, Y, Z, Angle, price);
- return 1;
- }
- function:onSaleVehicleAdded(playerid, model, Float: X, Float: Y, Float: Z, Float: Angle, price)
- {
- new CarID;
- CarID = CreateVehicle(model, X,Y,Z,Angle, -1, -1, -1);
- new id = mysql_insert_id();
- vehicleinfo[CarID][vModel] = model;
- vehicleinfo[CarID][vParkPos1] = X;
- vehicleinfo[CarID][vParkPos2] = Y;
- vehicleinfo[CarID][vParkPos3] = Z;
- vehicleinfo[CarID][vParkPos4] = Angle;
- vehicleinfo[CarID][vColors1] = -1;
- vehicleinfo[CarID][vColors2] = -1;
- vehicleinfo[CarID][vHealth] = 1000.0;
- vehicleinfo[CarID][vFuel] = 100;
- vehicleinfo[CarID][vFCarID] = -1;
- vehicleinfo[CarID][vJob] = -1;
- vehicleinfo[CarID][vLock] = 0;
- vehicleinfo[CarID][vSpawned] = 1;
- vehicleinfo[CarID][vAlarm] = 0;
- vehicleinfo[CarID][vImmobiliser] = 0;
- vehicleinfo[CarID][vOwnerID] = playerid;
- vehicleinfo[CarID][vWeapons1] = 0;
- vehicleinfo[CarID][vWeapons2] = 0;
- vehicleinfo[CarID][vWeapons3] = 0;
- vehicleinfo[CarID][vAmmo1] = 0;
- vehicleinfo[CarID][vAmmo2] = 0;
- vehicleinfo[CarID][vAmmo3] = 0;
- vehicleinfo[CarID][vXMRadio] = 0;
- vehicleinfo[CarID][vType] = 0;
- vehicleinfo[CarID][vInsurance] = 3;
- playerinfo[playerid][pMoney] -= price;
- GivePlayerMoney(playerid, -price);
- vehicleinfo[CarID][vBuyable] = 0;
- strmid(vehicleinfo[CarID][vOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);
- vehicleinfo[CarID][vSQLID] = id;
- vehicleinfo[CarID][vBought] = 1;
- vehicleinfo[CarID][vInsurance] = 3;
- SaveVehicle(id, CarID);
- return 1;
- }
- function:ResetVariables(playerid)
- {
- invite[playerid] = 0;
- playerinfo[playerid][pLogado] = 0;
- playerinfo[playerid][pMuted] = 0;
- playerinfo[playerid][pBlockPm] = 0;
- playerinfo[playerid][pSpectating] = 0;
- playerinfo[playerid][pHelp] = 0;
- strmid(playerinfo[playerid][pHelpStr],"",0,strlen(""),255);
- playerinfo[playerid][pAdminDuty] = 0;
- playerinfo[playerid][pTesterDuty] = 0;
- Delete3DTextLabel(MaskText[playerid]);
- playerinfo[playerid][pBizEnteredType] = 0;
- SendClientMessage(callinfo[playerid][Caller], COLOR_ERROR, "A ligação foi encerrada!");
- callinfo[playerid][Caller] = 0;
- callinfo[playerid][Calling] = 0;
- callinfo[playerid][InaCall] = 0;
- playerinfo[playerid][pRinging] = 0;
- RingingTime[playerid] = 0;
- playerinfo[playerid][pCuffed] = 0;
- return 1;
- }
- function:SendAdminMessage(color, messages[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pAdmin] > 0)
- {
- SendClientMessage(i, color, messages);
- }
- }
- return 1;
- }
- function:SendTesterMessage(color, messages[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pTester] > 0)
- {
- SendClientMessage(i, color, messages);
- }
- }
- return 1;
- }
- function:GetVehicleName(modelid,name[],namesize)
- {
- if(modelid < 400 || modelid > 611) return 0;
- modelid -= 400;
- for(new sxt, len = strlen(VehicleNames[modelid]); sxt < len && sxt < namesize; sxt++)
- name[sxt] = VehicleNames[modelid][sxt];
- return 1;
- }
- function:LoadWeaponData()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM weapondata", true, "r@LoadWeaponData", "d", 11);
- return 1;
- }
- function:r@LoadWeaponData()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i; i < rows; i++)
- {
- new valores[128];
- cache_get_field_content(i, "ID", valores, MYSQLConnection);
- weapondata[i][wSQLID] = strval(valores);
- cache_get_field_content(i, "Name", weapondata[i][wName], MYSQLConnection);
- cache_get_field_content(i, "Price", valores, MYSQLConnection);
- weapondata[i][wPrice] = strval(valores);
- cache_get_field_content(i, "Damage", valores, MYSQLConnection);
- weapondata[i][wDamage] = strval(valores);
- cache_get_field_content(i, "Ammo", valores, MYSQLConnection);
- weapondata[i][wAmmo] = strval(valores);
- cache_get_field_content(i, "Weight", valores, MYSQLConnection);
- weapondata[i][wWeight] = strval(valores);
- cache_get_field_content(i, "Type", valores, MYSQLConnection);
- weapondata[i][wType] = strval(valores);
- }
- printf("[SC-RP] Loaded %i WeaponDatas.", rows);
- return 1;
- }
- function:SaveWeaponData()
- {
- mysql_function_query(MYSQLConnection, "SELECT * FROM `weapondata`", true, "r@SaveWeaponData", "d", 0);
- return 1;
- }
- function:r@SaveWeaponData()
- {
- new rows, fields;
- cache_get_data(rows, fields);
- for(new i = 0; i < rows; i++)
- {
- format(query, sizeof(query), "UPDATE `weapondata` SET Name = '%s', Price = '%d', Damage = '%f', Ammo = '%d', Weight = '%d', Type = '%d' WHERE `ID` = '%d'",
- weapondata[i][wName], weapondata[i][wPrice], weapondata[i][wDamage], weapondata[i][wAmmo], weapondata[i][wWeight], weapondata[i][wType], i+1);
- mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i+1);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(playerinfo[playerid][pLogado] == 1)
- {
- playerinfo[playerid][pLogado] = 0;
- new dmsg[128];
- if(reason == 0)
- {
- format(dmsg, sizeof(dmsg), "%s foi desconectado. [Crashed]", GetName(playerid));
- }
- if(reason == 1)
- {
- format(dmsg, sizeof(dmsg), "%s foi desconectado. [Quit]", GetName(playerid));
- }
- if(reason == 2)
- {
- format(dmsg, sizeof(dmsg), "%s foi desconectado. [Kick/Ban]", GetName(playerid));
- }
- ProxDetector(20.0, playerid, dmsg, COLOR_FADE4, COLOR_FADE4, COLOR_FADE4, COLOR_FADE4, COLOR_FADE5);
- SaveUser(playerid);
- ResetVariables(playerid);
- format(string, sizeof(string), "[%s] %s", getDateEx(), dmsg);
- Log("Disconnect.log", string);
- return 1;
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerColor(playerid, -1);
- if(playerinfo[playerid][pMorto] == 1)
- {
- SetPlayerCameraPos(playerid,dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]+5);
- SetPlayerCameraLookAt(playerid, dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]);
- SetPlayerPos(playerid, dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]);
- ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
- SendClientMessage(playerid, COLOR_ERROR, "Você está gravemente ferido!");
- SendClientMessage(playerid, COLOR_SOS, "Contudo, você pode aguardar por ajuda médica ou digitar /aceitarmorte!");
- SendClientMessage(playerid, COLOR_SOS, "Ao utilizar o comando, você irá perder $350");
- SetPlayerSkin(playerid, playerinfo[playerid][pSkin]);
- return 1;
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- format(string, sizeof(string), "[KILL] %s matou %s (%d)", GetName(killerid), GetName(playerid), reason);
- Log("Mortes.log", string);
- playerinfo[playerid][pMorto] = 1;
- GetPlayerPos(playerid, dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]);
- TogglePlayerControllable(playerid, false);
- SetTimerEx("DeathPlayer", 3000, 0, "d", playerid);
- return 1;
- }
- function:DeathPlayer(playerid)
- {
- SpawnPlayer(playerid);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- format(string, sizeof(string), "[%s] %s - %i (%i insurances) [Explodiu]", getDateEx(), vehicleinfo[vehicleid][vOwner], vehicleinfo[vehicleid][vSQLID], vehicleinfo[vehicleid][vInsurance]);
- new log[45];
- format(log, 45, "%s Explosions.log", vehicleinfo[vehicleid][vOwner]);
- Log(log, string);
- if(vehicleinfo[vehicleid][vCreated] == 1) return 1;
- if(!strcmp(vehicleinfo[vehicleid][vOwner], "Faction", true))
- {
- SetVehicleToRespawn(vehicleid);
- }
- else
- {
- if(vehicleinfo[vehicleid][vInsurance] <= 3)
- {
- vehicleinfo[vehicleid][vInsurance]--;
- vehicleinfo[vehicleid][vTimesDestroyed]++;
- if(vehicleinfo[vehicleid][vInsurance] == 0)
- {
- vehicleinfo[vehicleid][vDestroyed] = 1;
- }
- for(new i = 0; i < 12; ++i) {
- if(vehicleinfo[vehicleid][vMod][i] > 0)
- {
- vehicleinfo[vehicleid][vMod][i] = 0;
- }
- }
- vehicleinfo[vehicleid][vXMRadio] = 0;
- SetVehicleVirtualWorld(vehicleid, vehicleid+1);
- SaveVehicle(vehicleinfo[vehicleid][vSQLID], vehicleid);
- SetVehicleToRespawn(vehicleid);
- return 1;
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pFerido] == 1) return SendClientMessage(playerid, COLOR_ERROR, FERIDO_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(callinfo[playerid][InaCall] == 1)
- {
- if(playerinfo[playerid][pMascarado] == 0)
- {
- new string2[128];
- format(string, sizeof(string), "%s diz (Celular): %s", GetName(playerid), text);
- Log("Chat.log", string2);
- SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);
- format(string, sizeof(string), "[Ligação] %s diz: %s", GetName(playerid), text);
- SendClientMessage(callinfo[playerid][Caller], COLOR_FADE1, string);
- }
- else
- {
- new string2[128];
- format(string, sizeof(string), "%s diz (Celular): %s", GetMaskID(playerid), text);
- format(string2, sizeof(string2), "%s (Mask) diz (Celular): %s", GetName(playerid), text);
- Log("Chat.log", string2);
- SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);
- format(string, sizeof(string), "[Ligação] %s diz: %s", GetMaskID(playerid), text);
- SendClientMessage(callinfo[playerid][Caller], COLOR_FADE1, string);
- }
- return 0;
- }
- if(GetPlayerState(playerid) == 2 || GetPlayerState(playerid) == 3)
- {
- new VehicleID = GetPlayerVehicleID(playerid);
- if(vehicleinfo[VehicleID][vWindows] == 1)
- {
- new string2[128];
- if(playerinfo[playerid][pMascarado] == 1)
- {
- format(string, sizeof(string), "(Janela Fechada) %s diz: %s", GetMaskID(playerid), text);
- format(string2, sizeof(string2), "[%s] (Mask)%s - %s", getDateEx(), GetName(playerid), text);
- Log("Chat.log", string2);
- ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else
- {
- format(string, sizeof(string), "(Janela Fechada) %s diz: %s", GetName(playerid), text);
- format(string2, sizeof(string2), "[%s] %s", getDateEx(), string);
- Log("Chat.log", string2);
- ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- }
- else
- {
- new string2[128];
- if(playerinfo[playerid][pMascarado] == 1)
- {
- format(string, sizeof(string), "(Janela Aberta) %s diz: %s", GetMaskID(playerid), text);
- format(string2, sizeof(string2), "[%s] (Mask)%s - %s", getDateEx(), GetName(playerid), text);
- Log("Chat.log", string2);
- ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else
- {
- format(string, sizeof(string), "(Janela Aberta) %s diz: %s", GetName(playerid), text);
- format(string2, sizeof(string2), "[%s] %s", getDateEx(), string);
- Log("Chat.log", string2);
- ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- }
- return 0;
- }
- new string2[128];
- if(playerinfo[playerid][pMascarado] == 1)
- {
- format(string, sizeof(string), "%s diz: %s", GetMaskID(playerid), text);
- format(string2, sizeof(string2), "[%s] (Mask)%s - %s", getDateEx(), GetName(playerid), text);
- Log("Chat.log", string2);
- ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else
- {
- format(string, sizeof(string), "%s diz: %s", GetName(playerid), text);
- format(string2, sizeof(string2), "[%s] %s", getDateEx(), string);
- Log("Chat.log", string2);
- ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- return 0;
- }
- CMD:entrar(playerid, params[])
- {
- if(playerinfo[playerid][pFerido] == 1) return SendClientMessage(playerid, COLOR_ERROR, FERIDO_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ]))
- {
- if(houseinfo[i][hLocked] == 0 && houseinfo[i][hOwned] == 1)
- {
- SetPlayerPos(playerid, houseinfo[i][hExitX], houseinfo[i][hExitY], houseinfo[i][hExitZ]);
- SetPlayerInterior(playerid, houseinfo[i][hInterior]);
- playerinfo[playerid][pVW] = i;
- SetPlayerVirtualWorld(playerid, i);
- playerinfo[playerid][pHouseEntered] = GetPlayerVirtualWorld(playerid);
- format(string, sizeof(string), "[%s] %s entrou na casa %d (Dono: %s)", getDateEx(), GetName(playerid), i, houseinfo[i][hOwner]);
- Log("Entrar.log", string);
- return 1;
- }
- else {
- GameTextForPlayer(playerid, "~b~A casa esta trancada", 3000, 5);
- return 1;
- }
- }
- }
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ]))
- {
- if(bizinfo[i][bLocked] == 0 && bizinfo[i][bOwned] == 1)
- {
- if(playerinfo[playerid][pMoney] < bizinfo[i][bFee]) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pMoney] -= bizinfo[i][bFee];
- bizinfo[i][bSafe] += bizinfo[i][bFee];
- GivePlayerMoney(playerid, -bizinfo[i][bFee]);
- SetPlayerPos(playerid, bizinfo[i][bExitX], bizinfo[i][bExitY], bizinfo[i][bExitZ]);
- SetPlayerInterior(playerid, bizinfo[i][bInterior]);
- playerinfo[playerid][pVW] = i;
- SetPlayerVirtualWorld(playerid, i);
- playerinfo[playerid][pBizEnteredType] = bizinfo[i][bType];
- playerinfo[playerid][pBizEntered] = GetPlayerVirtualWorld(playerid);
- format(string, sizeof(string), "[%s] %s entrou na empresa %d (Dono: %s)", getDateEx(), GetName(playerid), i, bizinfo[i][bOwner]);
- Log("Entrar.log", string);
- return 1;
- }
- else {
- GameTextForPlayer(playerid, "~b~A empresa esta trancada", 3000, 5);
- return 1;
- }
- }
- }
- return 1;
- }
- CMD:sair(playerid, params[])
- {
- if(playerinfo[playerid][pFerido] == 1) return SendClientMessage(playerid, COLOR_ERROR, FERIDO_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- new vw = GetPlayerVirtualWorld(playerid);
- if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hExitX],houseinfo[i][hExitY],houseinfo[i][hExitZ]) && vw == playerinfo[playerid][pVW])
- {
- SetPlayerPos(playerid, houseinfo[i][hEntranceX], houseinfo[i][hEntranceY], houseinfo[i][hEntranceZ]);
- SetPlayerInterior(playerid, 0);
- playerinfo[playerid][pHouseEntered] = 0;
- playerinfo[playerid][pVW] = 0;
- SetPlayerVirtualWorld(playerid, 0);
- format(string, sizeof(string), "[%s] %s saiu da casa %d (Dono: %s)", getDateEx(), GetName(playerid), i, houseinfo[i][hOwner]);
- Log("Entrar.log", string);
- return 1;
- }
- }
- for(new i = 1; i < MAX_BUSINESSES; i++)
- {
- new vw = GetPlayerVirtualWorld(playerid);
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bExitX],bizinfo[i][bExitY],bizinfo[i][bExitZ]) && vw == playerinfo[playerid][pVW])
- {
- playerinfo[playerid][pBizEntered] = 0;
- SetPlayerPos(playerid, bizinfo[i][bEntranceX], bizinfo[i][bEntranceY], bizinfo[i][bEntranceZ]);
- SetPlayerInterior(playerid, 0);
- playerinfo[playerid][pVW] = 0;
- SetPlayerVirtualWorld(playerid, 0);
- playerinfo[playerid][pBizEnteredType] = 0;
- format(string, sizeof(string), "[%s] %s saiu da empresa %d (Dono: %s)", getDateEx(), GetName(playerid), i, bizinfo[i][bOwner]);
- Log("Entrar.log", string);
- return 1;
- }
- }
- return 1;
- }
- CMD:casa(playerid, params[])
- {
- new subcmd[32], interior, preco;
- if(sscanf(params, "s[32]D(-1)D(-1)", subcmd, interior, preco))
- {
- if(playerinfo[playerid][pAdmin] < 5)
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa [comprar | vender | info | trancar]");
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa [comprar | vender | info | trancar]");
- SendClientMessage(playerid, COLOR_ERROR, "ADMIN: /casa [criar | avender | ir]");
- }
- return 1;
- }
- if(!strcmp(subcmd, "comprar", true))
- {
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ]))
- {
- if(houseinfo[i][hOwned] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Esta casa não está a venda!");
- if(playerinfo[playerid][pMoney] < houseinfo[i][hPrice]) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- houseinfo[i][hOwned] = 1;
- playerinfo[playerid][pMoney] -= houseinfo[i][hPrice];
- GivePlayerMoney(playerid, -houseinfo[i][hPrice]);
- strmid(houseinfo[i][hOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);
- SendClientMessage(playerid, COLOR_SUCESS, "Parabéns por sua nova aquisição!");
- DestroyPickup(HouseEstrutura2[i]);
- Delete3DTextLabel(HouseEstrutura[i]);
- SaveHouse(i);
- if(playerinfo[playerid][pCasa1] == 9999 || playerinfo[playerid][pCasa2] == 9999)
- {
- }
- else return SendClientMessage(playerid, COLOR_ERROR, "Você já possui duas casas!");
- if(playerinfo[playerid][pCasa1] != 9999) { playerinfo[playerid][pCasa2] = houseinfo[i][hID]; }
- else { playerinfo[playerid][pCasa1] = houseinfo[i][hID]; }
- format(string, sizeof(string), "[%s] %s comprou a propriedade [Casa] ID %d.", getDateEx(), GetName(playerid), i);
- Log("Propriedades.log", string);
- }
- }
- return 1;
- }
- if(!strcmp(subcmd, "info", true))
- {
- if(playerinfo[playerid][pCasa1] == 9999 && playerinfo[playerid][pCasa2] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma casa!");
- new hstats1[15];
- if(houseinfo[playerinfo[playerid][pCasa1]][hLocked] == 1)
- {
- hstats1 = "Trancada";
- }
- else
- {
- hstats1 = "Aberta";
- }
- format(string, sizeof(string), "Slot: Casa 1 | ID: %i | Porta: %s | Preço: $%d", playerinfo[playerid][pCasa1], hstats1, houseinfo[playerinfo[playerid][pCasa1]][hPrice]);
- SendClientMessage(playerid, COLOR_NEUTRAL, string);
- if(playerinfo[playerid][pCasa2] != 9999)
- {
- if(houseinfo[playerinfo[playerid][pCasa2]][hLocked] == 1)
- {
- hstats1 = "Trancada";
- }
- else
- {
- hstats1 = "Aberta";
- }
- format(string, sizeof(string), "Slot: Casa 2 | ID: %i | Porta: %s | Preço: $%d", playerinfo[playerid][pCasa2], hstats1, houseinfo[playerinfo[playerid][pCasa2]][hPrice]);
- SendClientMessage(playerid, COLOR_NEUTRAL, string);
- }
- return 1;
- }
- if(!strcmp(subcmd, "trancar", true))
- {
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ]))
- {
- if(playerinfo[playerid][pRent] == i || !strcmp(GetName(playerid), houseinfo[i][hOwner], true))
- {
- if(houseinfo[i][hLocked] == 0)
- {
- SendClientMessage(playerid, COLOR_SUCESS, "Porta trancada!");
- houseinfo[i][hLocked] = 1;
- SaveHouse(i);
- }
- else
- {
- houseinfo[i][hLocked] = 0;
- SendClientMessage(playerid, COLOR_SUCESS, "Porta destrancada!");
- SaveHouse(i);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Você não possui as chaves desta casa!");
- }
- }
- }
- return 1;
- }
- if(!strcmp(subcmd, "criar", true))
- {
- if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
- if(interior == -1 || preco == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa criar [InteriorID] [Preço] (/casa interiores)");
- new Float: x,
- Float: y,
- Float: z;
- GetPlayerPos(playerid, x, y, z);
- CreateNewHouse(x, y, z, preco, interior);
- SendClientMessage(playerid, COLOR_SUCESS, "Você criou uma nova casa com sucesso!");
- format(query, sizeof(query), "Preço: %d | Interior: %d | Posição: %f, %f, %f", preco, interior, x, y, z);
- SendClientMessage(playerid, COLOR_NEUTRAL, query);
- format(string, sizeof(string), "[%s] Admin %s criou uma casa de valor %d | Interior %d | Posiçao: %f, %f, %f.", getDateEx(), GetName(playerid), preco, interior, x, y, z);
- Log("AdminCMD.log", string);
- return 1;
- }
- if(!strcmp(subcmd, "vender", true))
- {
- if(playerinfo[playerid][pCasa1] == 9999 && playerinfo[playerid][pCasa2] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma casa!");
- if(playerinfo[playerid][pCasa2] == 9999)
- {
- new houseid = playerinfo[playerid][pCasa1];
- SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a única casa que você possuia!");
- playerinfo[playerid][pMoney] += houseinfo[houseid][hPrice] - 3000;
- format(string, sizeof(string), "Lucros obtidos: $%d", houseinfo[houseid][hPrice] - 3000);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- GivePlayerMoney(playerid, houseinfo[houseid][hPrice] - 3000);
- playerinfo[playerid][pCasa1] = 9999;
- strmid(houseinfo[houseid][hOwner], "0", 0, strlen("0"), 255);
- format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por: $%i", houseinfo[houseid][hPrice]);
- HouseEstrutura2[houseid] = CreateDynamicPickup(1239, 1, houseinfo[houseid][hEntranceX],houseinfo[houseid][hEntranceY],houseinfo[houseid][hEntranceZ],0, 0, -1, 15.0);
- HouseEstrutura[houseid] = CreateDynamic3DTextLabel(string,0x008080FF,houseinfo[houseid][hEntranceX],houseinfo[houseid][hEntranceY],houseinfo[houseid][hEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- houseinfo[houseid][hOwned] = 0;
- SendClientMessageToAll(-1, houseinfo[houseid][hOwned]);
- SendClientMessageToAll(-1, houseinfo[houseid][hOwner]);
- SaveHouse(houseid);
- }
- else
- {
- if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "Por possuir duas casas, digite o ID da casa que deseja vender. (/casa vender <1/2>)");
- if(interior != 1 && interior != 2) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam entre 1 e 2 (/casa info para checar)");
- if(interior == 1)
- {
- new houseid4 = strval(playerinfo[playerid][pCasa1]);
- SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a sua casa primária (ID 1)!");
- playerinfo[playerid][pMoney] += houseinfo[houseid4][hPrice] - 3000;
- format(string, sizeof(string), "Lucros obtidos: $%d", houseinfo[houseid4][hPrice] - 3000);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- GivePlayerMoney(playerid, houseinfo[houseid4][hPrice] - 3000);
- strmid(houseinfo[houseid4][hOwner], "", 0, strlen(""), 255);
- format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por: $%i", houseinfo[houseid4][hPrice]);
- HouseEstrutura2[houseid4] = CreateDynamicPickup(1239, 1, houseinfo[houseid4][hEntranceX],houseinfo[houseid4][hEntranceY],houseinfo[houseid4][hEntranceZ],0, 0, -1, 15.0);
- HouseEstrutura[houseid4] = CreateDynamic3DTextLabel(string,0x008080FF,houseinfo[houseid4][hEntranceX],houseinfo[houseid4][hEntranceY],houseinfo[houseid4][hEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- houseinfo[houseid4][hOwned] = 0;
- new houseid3 = strval(playerinfo[playerid][pCasa2]);
- playerinfo[playerid][pCasa1] = houseid3;
- playerinfo[playerid][pCasa2] = 9999;
- SendClientMessage(playerid, COLOR_SUCESS, "Automaticamente, sua casa secundária tornou-se sua casa primária !");
- SaveHouse(interior);
- return 1;
- }
- if(interior == 2)
- {
- new houseid3 = strval(playerinfo[playerid][pCasa2]);
- SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a sua casa secundária (ID 2)!");
- playerinfo[playerid][pMoney] += houseinfo[houseid3][hPrice] - 3000;
- format(string, sizeof(string), "Lucros obtidos: $%d", houseinfo[houseid3][hPrice] - 3000);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- GivePlayerMoney(playerid, houseinfo[houseid3][hPrice] - 3000);
- strmid(houseinfo[houseid3][hOwner], "", 0, strlen(""), 255);
- format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por: $%i", houseinfo[houseid3][hPrice]);
- HouseEstrutura2[houseid3] = CreateDynamicPickup(1239, 1, houseinfo[houseid3][hEntranceX],houseinfo[houseid3][hEntranceY],houseinfo[houseid3][hEntranceZ],0, 0, -1, 15.0);
- HouseEstrutura[houseid3] = CreateDynamic3DTextLabel(string,0x008080FF,houseinfo[houseid3][hEntranceX],houseinfo[houseid3][hEntranceY],houseinfo[houseid3][hEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- houseinfo[houseid3][hOwned] = 0;
- playerinfo[playerid][pCasa2] = 9999;
- SaveHouse(interior);
- return 1;
- }
- }
- return 1;
- }
- if(!strcmp(subcmd, "avender", true))
- {
- if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
- if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa avender [ID da Casa]");
- if(interior < 0 || interior > MAX_HOUSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam de 1 à 500!");
- if(houseinfo[interior][hOwned] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Esta casa não tem um dono!");
- houseinfo[interior][hOwned] = 0;
- strmid(houseinfo[interior][hOwner], "", 0, strlen(""), 255);
- format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por: $%i", houseinfo[interior][hPrice]);
- HouseEstrutura2[interior] = CreateDynamicPickup(1239, 1, houseinfo[interior][hEntranceX],houseinfo[interior][hEntranceY],houseinfo[interior][hEntranceZ],0, 0, -1, 15.0);
- HouseEstrutura[interior] = CreateDynamic3DTextLabel(string,0x008080FF,houseinfo[interior][hEntranceX],houseinfo[interior][hEntranceY],houseinfo[interior][hEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- format(string, sizeof(string), "Você vendeu com sucesso a casa ID %i!", interior);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "[AVender] O administrador %s vendeu a casa ID %d!", GetName(playerid), interior);
- Log("AdminCMD.log", string);
- SaveHouse(interior);
- return 1;
- }
- if(!strcmp(subcmd, "ir", true))
- {
- if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
- if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa ir [ID da Casa]");
- if(interior < 0 || interior > MAX_HOUSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam de 1 à 100!");
- SetPlayerPos(playerid, houseinfo[interior][hEntranceX], houseinfo[interior][hEntranceY], houseinfo[interior][hEntranceZ]);
- format(string, sizeof(string), "Você teleportou-se com sucesso para a entrada da casa %i!", interior);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "[Teleport] O administrador %s teleportou-se para a entrada da casa %i!", GetName(playerid), interior);
- Log("AdminCMD.log", string);
- return 1;
- }
- return 1;
- }
- CMD:empresa(playerid, params[])
- {
- new subcmd[32], interior, preco, tipo;
- if(sscanf(params, "s[32]D(-1)D(-1)D(-1)", subcmd, interior, preco, tipo))
- {
- if(playerinfo[playerid][pAdmin] < 5)
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa [comprar | vender | info | trancar]");
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa [comprar | vender | info | trancar]");
- SendClientMessage(playerid, COLOR_ERROR, "ADMIN: /empresa [criar | avender]");
- }
- return 1;
- }
- if(!strcmp(subcmd, "comprar", true))
- {
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ]))
- {
- if(bizinfo[i][bOwned] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Esta empresa não está a venda!");
- if(playerinfo[playerid][pMoney] < bizinfo[i][bPrice]) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- if(playerinfo[playerid][pEmpresa] != 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você já possui uma empresa!");
- playerinfo[playerid][pEmpresa] = bizinfo[i][bID];
- bizinfo[i][bOwned] = 1;
- playerinfo[playerid][pMoney] -= bizinfo[i][bPrice];
- GivePlayerMoney(playerid, -bizinfo[i][bPrice]);
- strmid(bizinfo[i][bOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);
- SendClientMessage(playerid, COLOR_SUCESS, "Parabéns por sua nova aquisição!");
- DestroyPickup(bizEstrutura2[i]);
- Delete3DTextLabel(bizEstrutura[i]);
- SaveBiz(i);
- format(string, sizeof(string), "[%s] %s comprou a propriedade [Empresa] ID %d.", getDateEx(), GetName(playerid), i);
- Log("Propriedades.log", string);
- }
- }
- return 1;
- }
- if(!strcmp(subcmd, "info", true))
- {
- if(playerinfo[playerid][pEmpresa] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma empresa!");
- new hstats1[15];
- if(bizinfo[playerinfo[playerid][pEmpresa]][bLocked] == 1)
- {
- hstats1 = "Trancada";
- }
- else
- {
- hstats1 = "Aberta";
- }
- new id = playerinfo[playerid][pEmpresa];
- format(string, sizeof(string), "Empresa | ID: %i | Porta: %s | Preço: $%d", id, hstats1, bizinfo[id][bPrice]);
- SendClientMessage(playerid, COLOR_NEUTRAL, string);
- return 1;
- }
- if(!strcmp(subcmd, "trancar", true))
- {
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ]))
- {
- if(!strcmp(GetName(playerid), bizinfo[i][bOwner], true))
- {
- if(bizinfo[i][bLocked] == 0)
- {
- SendClientMessage(playerid, COLOR_SUCESS, "Porta trancada!");
- bizinfo[i][bLocked] = 1;
- SaveBiz(i);
- }
- else
- {
- bizinfo[i][bLocked] = 0;
- SendClientMessage(playerid, COLOR_SUCESS, "Porta destrancada!");
- SaveBiz(i);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Você não possui as chaves desta empresa!");
- }
- }
- }
- return 1;
- }
- if(!strcmp(subcmd, "criar", true))
- {
- if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
- if(interior == -1 || preco == -1 || tipo == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa criar [InteriorID] [Preço] [Tipo] (/empresa interiores)");
- new Float: x,
- Float: y,
- Float: z;
- GetPlayerPos(playerid, x, y, z);
- CreateNewBiz(x, y, z, preco, interior, tipo);
- SendClientMessage(playerid, COLOR_SUCESS, "Você criou uma nova empresa com sucesso!");
- format(query, sizeof(query), "Preço: %d | Interior: %d | Posição: %f, %f, %f | Tipo: %d", preco, interior, x, y, z, tipo);
- SendClientMessage(playerid, COLOR_NEUTRAL, query);
- format(string, sizeof(string), "[%s] Admin %s criou uma empresa de valor %d | Interior %d | Posiçao: %f, %f, %f | Tipo: %d.", getDateEx(), GetName(playerid), preco, interior, x, y, z, tipo);
- Log("AdminCMD.log", string);
- return 1;
- }
- if(!strcmp(subcmd, "vender", true))
- {
- if(playerinfo[playerid][pEmpresa] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma empresa!");
- new houseid = playerinfo[playerid][pEmpresa];
- SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a única empresa que você possuia!");
- playerinfo[playerid][pMoney] += bizinfo[houseid][bPrice]-3000;
- format(string, sizeof(string), "Lucros obtidos: $%d", bizinfo[houseid][bPrice]-3000);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- GivePlayerMoney(playerid, bizinfo[houseid][bPrice]-3000);
- playerinfo[playerid][pEmpresa] = 9999;
- strmid(bizinfo[houseid][bOwner], "0", 0, strlen("0"), 255);
- format(string, sizeof(string), "[Empresa]\n{FFF000}Vende-se por: $%i", bizinfo[houseid][bPrice]);
- bizEstrutura2[houseid] = CreateDynamicPickup(1239, 1, bizinfo[houseid][bEntranceX],bizinfo[houseid][bEntranceY],bizinfo[houseid][bEntranceZ],0, 0, -1, 15.0);
- Delete3DTextLabel(bizEstrutura[houseid]);
- bizEstrutura[houseid] = CreateDynamic3DTextLabel(string,0x008080FF,bizinfo[houseid][bEntranceX],bizinfo[houseid][bEntranceY],bizinfo[houseid][bEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- bizinfo[houseid][bOwned] = 0;
- SaveBiz(houseid);
- }
- if(!strcmp(subcmd, "avender", true))
- {
- if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
- if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa avender [ID da Empresa]");
- if(interior < 0 || interior > MAX_BUSINESSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das empresas alternam de 1 à 100!");
- if(bizinfo[interior][bOwned] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Esta empresa não tem um dono!");
- bizinfo[interior][bOwned] = 0;
- strmid(bizinfo[interior][bOwner], "", 0, strlen(""), 255);
- bizEstrutura2[interior] = CreateDynamicPickup(1239, 1, bizinfo[interior][bEntranceX],bizinfo[interior][bEntranceY],bizinfo[interior][bEntranceZ],0, 0, -1, 15.0);
- format(string, sizeof(string), "[Empresa a venda %s]\n$%i", GetBizType(bizinfo[interior][bType]), bizinfo[interior][bPrice]);
- bizEstrutura[interior] = CreateDynamic3DTextLabel(string,0x008080FF,bizinfo[interior][bEntranceX],bizinfo[interior][bEntranceY],bizinfo[interior][bEntranceZ]-0.25,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID, 0, 0, 0, -1);
- format(string, sizeof(string), "Você vendeu com sucesso a empresa ID %i!", interior);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "[AVender] O administrador %s vendeu a empresa ID %d!", GetName(playerid), interior);
- Log("AdminCMD.log", string);
- SaveBiz(interior);
- return 1;
- }
- if(!strcmp(subcmd, "ir", true))
- {
- if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
- if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa ir [ID da Empresa]");
- if(interior < 0 || interior > MAX_BUSINESSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam de 1 à 100!");
- SetPlayerPos(playerid, bizinfo[interior][bEntranceX], bizinfo[interior][bEntranceY], bizinfo[interior][bEntranceZ]);
- format(string, sizeof(string), "Você teleportou-se com sucesso para a entrada da empresa %i!", interior);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "[Teleport] O administrador %s teleportou-se para a entrada da empresa %i!", GetName(playerid), interior);
- Log("AdminCMD.log", string);
- return 1;
- }
- return 1;
- }
- CMD:ajuda(playerid,params[])
- {
- if(playerinfo[playerid][pAdmin] > 0)
- {
- format(string, sizeof(string), "Comandos Gerais\nComandos Veiculares\nComandos de Faction\nComandos de Líder\nComandos de Donaters\nComandos de Tester\nComandos de Adminsitrador");
- }
- ShowPlayerDialog(playerid, DIALOG_AJUDA, DIALOG_STYLE_LIST, "Central de Comandos", string, "Ok", "Cancelar");
- return 1;
- }
- CMD:pm(playerid, params[])
- {
- new id, message[128];
- if(sscanf(params, "us[128]", id, message)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /pm [PlayerID] [Mensagem]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[id][pBlockPm] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador está com as PM's bloqueadas!");
- if(playerinfo[id][pBlockUser] == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador está bloqueando suas PM's no momento!");
- //if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode enviar PM's para si mesmo!");
- if(playerinfo[id][pAdmin] > 0)
- {
- if(playerinfo[playerid][pPmAllowed] != id)
- {
- new string2[128];
- format(string2, sizeof(string2), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);
- strmid(playerinfo[playerid][pString], string2, 0, strlen(string2), 255);
- format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);
- strmid(playerinfo[playerid][pString2], string, 0, strlen(string), 255);
- SendingPM[playerid] = id;
- ShowPlayerDialog(playerid, DIALOG_ADMPM, DIALOG_STYLE_MSGBOX, "Relembrando!", "Pela regra XXX, Enviar PM para administradores fora de trabalho com assuntos administrativos...\npodem levá-lo à uma severa punição.\
- \nVocê realmente deseja proceder e enviar a mensagem?", "Sim", "Não");
- }
- else
- {
- format(string, sizeof(string), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);
- SendClientMessage(id, COLOR_PM, string);
- format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);
- SendClientMessage(playerid, COLOR_PM, string);
- format(string, sizeof(string), "[%s] [PM] De %s para %s: %s", getDateEx(), GetName(playerid), GetName(id), message);
- Log("PM.log", string);
- }
- return 1;
- }
- if(playerinfo[playerid][pAdmin] > 0)
- {
- playerinfo[playerid][pPmAllowed] = id;
- format(string, sizeof(string), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);
- SendClientMessage(id, COLOR_PM, string);
- format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);
- SendClientMessage(playerid, COLOR_PM, string);
- format(string, sizeof(string), "[%s] [PM] De %s para %s: %s", getDateEx(), GetName(playerid), GetName(id), message);
- Log("PM.log", string);
- }
- format(string, sizeof(string), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);
- SendClientMessage(id, COLOR_PM, string);
- format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);
- SendClientMessage(playerid, COLOR_PM, string);
- format(string, sizeof(string), "[%s] [PM] De %s para %s: %s", getDateEx(), GetName(playerid), GetName(id), message);
- Log("PM.log", string);
- return 1;
- }
- CMD:togpm(playerid, params[])
- {
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pDonate] < 1) return SendClientMessage(playerid, COLOR_ERROR, " Você não é um donate Bronze+!");
- if(playerinfo[playerid][pBlockPm] == 0)
- {
- playerinfo[playerid][pBlockPm] = 1;
- SendClientMessage(playerid, COLOR_SUCESS, "Você agora está bloqueando as PM's de todos os players!");
- }
- else
- {
- playerinfo[playerid][pBlockPm] = 0;
- SendClientMessage(playerid, COLOR_SUCESS, "Você desbloqueou as PM's de todos os players!");
- }
- return 1;
- }
- CMD:blockpm(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /blockpm [PlayerID]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pDonate] < 1) return SendClientMessage(playerid, COLOR_ERROR, " Você não é um donate Bronze+!");
- if(playerinfo[playerid][pBlockUser] == id)
- {
- playerinfo[playerid][pBlockUser] = -1;
- format(string, sizeof(string), "Você desbloqueou as PM's de %s!", GetName(id));
- SendClientMessage(playerid, COLOR_PM, string);
- return 1;
- }
- playerinfo[playerid][pBlockUser] = id;
- format(string, sizeof(string), "Você agora está bloqueando as PM's de %s!", GetName(id));
- SendClientMessage(playerid, COLOR_PM, string);
- return 1;
- }
- CMD:o(playerid,params[])
- {
- new message[128];
- if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /o [Mensagem]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(TogOOC == 0)
- {
- format(string, sizeof(string), "(([OOC] %s: %s))", GetName(playerid), message);
- SendClientMessageToAll(COLOR_OOC, string);
- }
- else
- {
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, "O Chat OOC está desativado no momento!");
- format(string, sizeof(string), "(([OOC] %s: %s))", GetName(playerid), message);
- SendClientMessageToAll(COLOR_OOC, string);
- }
- return 1;
- }
- CMD:ooc(playerid, params[])
- {
- new blocked[32];
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(sscanf(params, "s[128]", blocked)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /o [Abrir/Trancar]");
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(!strcmp(blocked, "abrir", true))
- {
- if(TogOOC == 0) return SendClientMessage(playerid, COLOR_ERROR, " O Chat OOC já está aberto!");
- TogOOC = 0;
- SendClientMessageToAll(COLOR_OOC, "Um administrador ativou o chat OOC!");
- return 1;
- }
- if(!strcmp(blocked, "trancar", true))
- {
- if(TogOOC == 1) return SendClientMessage(playerid, COLOR_ERROR, " O Chat OOC já está fechado!");
- TogOOC = 1;
- SendClientMessageToAll(COLOR_OOC, "Um administrador desativou o chat OOC!");
- return 1;
- }
- return 1;
- }
- CMD:criarinfernus(playerid, params[])
- {
- new Float: x,
- Float: y,
- Float: z;
- GetPlayerPos(playerid, x, y, z);
- new lol = CreateVehicle(411, x, y, z, 0, 0, 0, -1);
- vehicleinfo[lol][vFCarID] = -1;
- return 1;
- }
- CMD:factionon(playerid, params[])
- {
- new factionid;
- new onlinemembers;
- if(sscanf(params, "d", factionid)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /factionon [ID da faction]");
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(factionid < 1 || factionid > 41) return SendClientMessage(playerid, COLOR_ERROR, " Os ID's de facções vão de 1 à 40!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pFaction] == factionid)
- {
- onlinemembers++;
- }
- }
- format(string, sizeof(string), "(( %s | Membros online: %d/%d ))", factioninfo[factionid-1][fName], onlinemembers, factioninfo[factionid-1][fMembers]);
- SendClientMessage(playerid, COLOR_NEUTRAL, string);
- return 1;
- }
- CMD:promover(playerid, params[])
- {
- new id, cargo;
- if(sscanf(params, "ud", id, cargo)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /promover [PlayerID] [Rank]");
- if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[id][pFaction] != playerinfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_ERROR, "Você pode promover apenas membros da SUA facção!");
- if(playerinfo[id][pRank] == 10) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode promover os líderes de sua facção!");
- if(playerinfo[id][pRank] >= cargo) return SendClientMessage(playerid, COLOR_ERROR, "Para diminuir o rank do player, utilize /rebaixar [PlayerID]");
- format(string, sizeof(string), "Você foi promovido à rank %d pelo líder %s. Parabéns!", cargo, GetName(playerid));
- SendClientMessage(id, COLOR_SUCESS, string);
- format(string, sizeof(string), "Você promoveu o membro %s para o rank %d!", cargo, GetName(playerid));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- playerinfo[id][pRank] = cargo;
- return 1;
- }
- CMD:rebaixar(playerid, params[])
- {
- new id, cargo;
- if(sscanf(params, "ud", id, cargo)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /rebaixar [PlayerID] [Rank]");
- if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[id][pFaction] != playerinfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_ERROR, "Você pode rebaixar apenas membros da SUA facção!");
- if(playerinfo[id][pRank] == 10) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode rebaixar os líderes de sua facção!");
- if(playerinfo[id][pRank] <= cargo) return SendClientMessage(playerid, COLOR_ERROR, "Para aumentar o rank do player, utilize /promover [PlayerID]");
- format(string, sizeof(string), "Você foi rebaixado à rank %d pelo líder %s.", cargo, GetName(playerid));
- SendClientMessage(id, COLOR_SUCESS, string);
- format(string, sizeof(string), "Você rebaixou o membro %s para o rank %d!", cargo, GetName(playerid));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- playerinfo[id][pRank] = cargo;
- return 1;
- }
- CMD:nomerank(playerid, params[])
- {
- new id, rank[128];
- if(sscanf(params, "ds[128]", id, rank)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /nomerank [RankID] [Nome]");
- if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- new faction = playerinfo[playerid][pFaction];
- if(id < 1 || id > 10) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's dos ranks variam de 1 à 10 APENAS!");
- switch(id)
- {
- case 1:
- {
- strmid(factioninfo[faction-1][fRank1], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 1 para %s!", rank);
- }
- case 2:
- {
- strmid(factioninfo[faction-1][fRank2], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 2 para %s!", rank);
- }
- case 3:
- {
- strmid(factioninfo[faction-1][fRank3], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 3 para %s!", rank);
- }
- case 4:
- {
- strmid(factioninfo[faction-1][fRank4], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 4 para %s!", rank);
- }
- case 5:
- {
- strmid(factioninfo[faction-1][fRank5], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 5 para %s!", rank);
- }
- case 6:
- {
- strmid(factioninfo[faction-1][fRank6], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 6 para %s!", rank);
- }
- case 7:
- {
- strmid(factioninfo[faction-1][fRank7], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 7 para %s!", rank);
- }
- case 8:
- {
- strmid(factioninfo[faction-1][fRank8], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 8 para %s!", rank);
- }
- case 9:
- {
- strmid(factioninfo[faction-1][fRank9], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 9 para %s!", rank);
- }
- case 10:
- {
- strmid(factioninfo[faction-1][fRank10], rank, 0, sizeof(rank), 128);
- format(string, sizeof(string), "Você mudou com sucesso o nome do rank 10 para %s!", rank);
- }
- }
- SendClientMessage(playerid, COLOR_SUCESS, string);
- return 1;
- }
- CMD:membros(playerid, params[])
- {
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está em nenhuma faction!");
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- new faction = playerinfo[playerid][pFaction];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pFaction] == faction)
- {
- format(string, sizeof(string), "%s (ID: %d) Rank: %s (%d)", GetName(i), i, GetRankName(i), playerinfo[playerid][pRank]);
- SendClientMessage(playerid, COLOR_SOS, string);
- }
- }
- return 1;
- }
- CMD:convidar(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /convidar [PlayerID]");
- if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, " Você não pode se convidar!");
- new faction;
- faction = playerinfo[playerid][pFaction];
- format(string, sizeof(string), "O Líder %s te convidou para entrar na faction %s. Digite /aceitar convite para aceitar!", GetName(playerid), factioninfo[faction-1][fName]);
- SendClientMessage(id, COLOR_PM, string);
- format(string, sizeof(string), "Você convidou %s a se unir à facção %s. Aguarde-o aceitar o convite!", GetName(id), factioninfo[faction-1][fName]);
- SendClientMessage(playerid, COLOR_PM, string);
- invite[id] = faction;
- return 1;
- }
- CMD:aceitar(playerid, params[])
- {
- new subcmd[32];
- if(sscanf(params, "s[32]", subcmd)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /aceitar [convite]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(!strcmp(subcmd, "convite", true))
- {
- if(invite[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não foi convidado para nenhuma facção!");
- SendClientMessage(playerid, COLOR_PM, "Parabéns, você acaba de entrar na facção!");
- playerinfo[playerid][pFaction] = invite[playerid];
- invite[playerid] = 0;
- factioninfo[invite[playerid]][fMembers] ++;
- playerinfo[playerid][pRank] = 1;
- return 1;
- }
- return 1;
- }
- CMD:f(playerid, params[])
- {
- new msg[256];
- if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /f [Mensagem]");
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não está em uma facção válida!");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new faction = playerinfo[playerid][pFaction];
- if(playerinfo[playerid][pRank] == 1) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank1], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 2) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank2], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 3) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank3], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 4) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank4], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 5) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank5], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 6) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank6], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 7) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank7], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 8) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank8], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 9) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank9], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 10) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank10], GetName(playerid), msg); }
- else
- {
- format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank1], GetName(playerid), msg);
- }
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pFaction] == faction)
- {
- SendClientMessage(i, COLOR_FACTION, string);
- }
- }
- return 1;
- }
- CMD:d(playerid, params[])
- {
- new msg[256];
- if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /d [Mensagem de Rádio]");
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não está em uma facção válida!");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new faction = playerinfo[playerid][pFaction];
- if(factioninfo[faction-1][fType] != 1 && factioninfo[faction-1][fType] != 2 && factioninfo[faction-1][fType] != 3)
- {
- return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções governamentais desfrutem deste rádio!");
- }
- new factionname[32];
- if(playerinfo[playerid][pFaction] == 1)
- {
- format(factionname, sizeof(factionname), "LSPD");
- }
- if(playerinfo[playerid][pFaction] == 2)
- {
- format(factionname, sizeof(factionname), "LSFD");
- }
- if(playerinfo[playerid][pFaction] == 3)
- {
- format(factionname, sizeof(factionname), "GOV");
- }
- if(playerinfo[playerid][pMascarado] == 0)
- {
- if(playerinfo[playerid][pRank] == 1) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 2) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank2], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 3) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank3], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 4) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank4], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 5) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank5], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 6) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank6], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 7) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank7], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 8) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank8], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 9) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank9], GetName(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 10) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank10], GetName(playerid), msg); }
- else
- {
- format(string, sizeof(string), "[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetName(playerid), msg);
- }
- }
- else
- {
- if(playerinfo[playerid][pRank] == 1) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 2) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank2], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 3) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank3], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 4) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank4], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 5) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank5], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 6) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank6], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 7) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank7], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 8) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank8], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 9) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank9], GetMaskID(playerid), msg); }
- else if(playerinfo[playerid][pRank] == 10) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank10], GetMaskID(playerid), msg); }
- else
- {
- format(string, sizeof(string), "[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetName(playerid), msg);
- }
- }
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(factioninfo[faction-1][fType] == 1 || factioninfo[faction-1][fType] == 2 || factioninfo[faction-1][fType] == 3)
- {
- SendClientMessage(i, COLOR_DEPARTMENT, string);
- }
- }
- if(playerinfo[playerid][pMascarado] == 0)
- {
- format(string, sizeof(string), "*[Radio] %s diz: %s", GetName(playerid), msg);
- }
- else
- {
- format(string, sizeof(string), "*[Radio] %s diz: %s", GetMaskID(playerid), msg);
- }
- SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);
- return 1;
- }
- CMD:r(playerid, params[])
- {
- new msg[256];
- if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /r [Mensagem de rádio]");
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não está em uma facção válida!");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new faction = playerinfo[playerid][pFaction];
- if(factioninfo[faction-1][fType] != 1 && factioninfo[faction-1][fType] != 2 && factioninfo[faction-1][fType] != 3)
- {
- return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções governamentais desfrutem deste rádio!");
- }
- if(playerinfo[playerid][pMascarado] == 0)
- {
- format(string, sizeof(string), "*[CH:911 S:1] %s: %s", GetName(playerid), msg);
- }
- else
- {
- format(string, sizeof(string), "*[CH:911 S:1] %s: %s", GetMaskID(playerid), msg);
- }
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pFaction] == faction)
- {
- SendClientMessage(i, COLOR_RADIO, string);
- }
- }
- if(playerinfo[playerid][pMascarado] == 0)
- {
- format(string, sizeof(string), "*[Radio] %s diz: %s", GetName(playerid), msg);
- }
- else
- {
- format(string, sizeof(string), "*[Radio] %s diz: %s", GetMaskID(playerid), msg);
- }
- SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);
- return 1;
- }
- CMD:me(playerid, params[])
- {
- new action[128];
- new string2[128];
- if(sscanf(params, "s[128]", action)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /me [Ação]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMascarado] == 0)
- {
- format(string, sizeof(string), "* %s %s", GetName(playerid), action);
- format(string2, sizeof(string2), "[%s] [/ME] %s", getDateEx(), string);
- Log("Action.log", string2);
- }
- else
- {
- format(string, sizeof(string), "* %s %s", GetMaskID(playerid), action);
- format(string2, sizeof(string2), "[%s] [/ME] (Masked)* %s %s", getDateEx(), GetName(playerid), action);
- Log("Action.log", string2);
- }
- ProxDetectorAction(20.0, playerid, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);
- return 1;
- }
- CMD:eu(playerid, params[])
- {
- new action[128];
- new string2[128];
- if(sscanf(params, "s[128]", action)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /eu [Ação]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMascarado] == 0)
- {
- format(string, sizeof(string), "* %s %s", GetName(playerid), action);
- format(string2, sizeof(string2), "[%s] [/ME] %s", getDateEx(), string);
- Log("Action.log", string2);
- }
- else
- {
- format(string, sizeof(string), "* %s %s", GetMaskID(playerid), action);
- format(string2, sizeof(string2), "[%s] [/ME] (Masked)* %s %s", getDateEx(), GetName(playerid), action);
- Log("Action.log", string2);
- }
- ProxDetectorAction(20.0, playerid, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);
- return 1;
- }
- CMD:do(playerid, params[])
- {
- new action[128];
- new string2[128];
- if(sscanf(params, "s[128]", action)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /do [Ação]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMascarado] == 0)
- {
- format(string, sizeof(string), "* %s ( %s )", action, GetName(playerid));
- format(string2, sizeof(string2), "[%s] [/DO] %s", getDateEx(), string);
- Log("Action.log", string2);
- }
- else
- {
- format(string, sizeof(string), "* %s ( %s )", action, GetMaskID(playerid));
- format(string2, sizeof(string2), "[%s] [/DO] (Masked)* %s ( %s )", getDateEx(), action, GetName(playerid));
- Log("Action.log", string2);
- }
- ProxDetector(20.0, playerid, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);
- return 1;
- }
- CMD:sos(playerid, params[])
- {
- new sos[128];
- if(sscanf(params, "s[128]", sos)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /sos [Pergunta]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pHelp] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você já solicitou um pedido de ajuda! Aguarde a reposta de nossa equipe de Testers!");
- playerinfo[playerid][pHelp] = 1;
- format(string, sizeof(string), "[SOS] %s [%d]: %s (/ah | /rh)", GetName(playerid), playerid, sos);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pTesterDuty] == 1)
- {
- SendClientMessage(i, COLOR_SOS, string);
- }
- }
- strmid(playerinfo[playerid][pHelpStr], string, 0, sizeof(string), 255);
- SendClientMessage(playerid, COLOR_SUCESS, "Sua dúvida foi enviada para os Testers disponíveis, seja paciente!");
- return 1;
- }
- CMD:ah(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ah [PlayerID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Tester aceitar o SEU pedido de ajuda!");
- if(playerinfo[id][pHelp] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não solicitou um pedido de ajuda!");
- playerinfo[id][pHelp] = 0;
- strmid(playerinfo[id][pHelpStr], "", 0, strlen(""), 255);
- format(string, sizeof(string), "O Tester %s está ciente sobre sua pergunta e te responderá quando possível!", GetName(playerid));
- SendClientMessage(id, COLOR_SOS, string);
- format(string, sizeof(string), "Você está ciente sobre o pedido de ajuda de %s. Responda assim que possível!", GetName(id));
- SendClientMessage(playerid, COLOR_SOS, string);
- return 1;
- }
- CMD:rh(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /rh [PlayerID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Tester recusar o SEU pedido de ajuda!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[id][pHelp] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não solicitou um pedido de ajuda!");
- playerinfo[id][pHelp] = 0;
- strmid(playerinfo[id][pHelpStr], "", 0, strlen(""), 255);
- format(string, sizeof(string), "O Tester %s recusou o seu pedido de ajuda!", GetName(playerid));
- SendClientMessage(id, COLOR_SOS, string);
- format(string, sizeof(string), "Você recusou o pedido de ajuda de %s. Explique-o se possível o motivo!", GetName(id));
- SendClientMessage(playerid, COLOR_SOS, string);
- return 1;
- }
- CMD:checarsos(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
- SendClientMessage(playerid, COLOR_SOS, " [Lista de SOS's ativos]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pHelp] == 1)
- {
- SendClientMessage(playerid, COLOR_SOS, playerinfo[i][pHelpStr]);
- return 1;
- }
- }
- return 1;
- }
- CMD:testers(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_OFFDUTY, " [Testers Online]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pTester] > 0)
- {
- if(playerinfo[i][pTesterDuty] == 0)
- {
- format(string, sizeof(string), "[Level: %d] %s [%d] (offDuty)", playerinfo[i][pTester], GetName(i), i);
- SendClientMessage(playerid, COLOR_OFFDUTY, string);
- }
- else
- {
- format(string, sizeof(string), "[Level: %d] %s [%d] (onDuty)", playerinfo[i][pTester], GetName(i), i);
- SendClientMessage(playerid, COLOR_ONDUTY, string);
- }
- }
- }
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_OFFDUTY, " [Administradores Online]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pAdmin] > 0)
- {
- if(playerinfo[i][pAdminDuty] == 0)
- {
- format(string, sizeof(string), "[Level: %d] %s [ID:%d] (offDuty)", playerinfo[i][pAdmin], GetName(i), i);
- SendClientMessage(playerid, COLOR_OFFDUTY, string);
- }
- else
- {
- format(string, sizeof(string), "[Level: %d] %s [%d] (onDuty)", playerinfo[i][pAdmin], GetName(i), i);
- SendClientMessage(playerid, COLOR_ONDUTY, string);
- }
- }
- }
- return 1;
- }
- CMD:aduty(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(playerinfo[playerid][pAdminDuty] == 0)
- {
- playerinfo[playerid][pAdminDuty] = 1;
- SetPlayerColor(playerid, COLOR_ADM);
- SendClientMessage(playerid, COLOR_ADM, "Você entrou em Admin Duty!");
- }
- else
- {
- playerinfo[playerid][pAdminDuty] = 0;
- SetPlayerColor(playerid, COLOR_CIVILIAN);
- SendClientMessage(playerid, COLOR_ADM, "Você saiu do Admin Duty!");
- }
- return 1;
- }
- CMD:tduty(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
- if(playerinfo[playerid][pTesterDuty] == 0)
- {
- playerinfo[playerid][pTesterDuty] = 1;
- SetPlayerColor(playerid, COLOR_TESTER);
- SendClientMessage(playerid, COLOR_TESTER, "Você entrou em Tester Duty!");
- }
- else
- {
- playerinfo[playerid][pTesterDuty] = 0;
- SetPlayerColor(playerid, COLOR_CIVILIAN);
- SendClientMessage(playerid, COLOR_TESTER, "Você saiu do Tester Duty!");
- }
- return 1;
- }
- CMD:mascara(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMask] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui uma máscara!");
- new subcmd[128];
- if(sscanf(params, "s[128]", subcmd)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /mascara [colocar | retirar]");
- if(!strcmp(subcmd, "colocar", true))
- {
- if(playerinfo[playerid][pMascarado] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você já está utilizando a sua máscara!");
- playerinfo[playerid][pMascarado] = 1;
- GameTextForPlayer(playerid, "Voce colocou sua mascara", 3000, 5);
- Delete3DTextLabel(MaskText[playerid]);
- format(string, sizeof(string), "[Desconhecido_%s]", GetMaskID(playerid));
- return 1;
- }
- if(!strcmp(subcmd, "retirar", true))
- {
- if(playerinfo[playerid][pMascarado] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está utilizando a sua máscara!");
- playerinfo[playerid][pMascarado] = 0;
- GameTextForPlayer(playerid, "Voce retirou sua mascara", 3000, 5);
- Delete3DTextLabel(MaskText[playerid]);
- return 1;
- }
- return 1;
- }
- CMD:mascarados(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- SendClientMessage(playerid, COLOR_SOS, " [Usuários Mascarados]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pMascarado] == 1)
- {
- format(string, sizeof(string), "%s [ID:%d] MaskID: %s", GetName(i), i, playerinfo[i][pMaskID]);
- SendClientMessage(playerid, COLOR_SOS, string);
- return 1;
- }
- }
- return 1;
- }
- CMD:reportar(playerid, params[])
- {
- new sos[128], id;
- if(sscanf(params, "us[128]", id, sos)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /reportar [ID] [Motivo]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode se reportar!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[playerid][pReport] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você já reportou um player! Aguarde uma resposta da equipe administrativa!");
- format(string, sizeof(string), "[Report] %s [%d] reportou %s [ID: %d]. Motivo: %s (/ar | /rr)", GetName(playerid), playerid, GetName(id), id, sos);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pAdminDuty] == 1)
- {
- SendClientMessage(i, COLOR_SOS, string);
- }
- }
- playerinfo[playerid][pReport] = 1;
- strmid(playerinfo[playerid][pReportStr], string, 0, sizeof(string), 255);
- SendClientMessage(playerid, COLOR_SUCESS, "Seu report foi encaminhado para os Administradores disponíveis, seja paciente!");
- return 1;
- }
- CMD:ar(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ar [PlayerID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Admin aceitar o SEU report!");
- if(playerinfo[id][pReport] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não enviou um report!");
- playerinfo[id][pReport] = 0;
- strmid(playerinfo[id][pReportStr], "", 0, strlen(""), 255);
- format(string, sizeof(string), "O Admin %s está ciente sobre sua report e te responderá quando possível!", GetName(playerid));
- SendClientMessage(id, COLOR_SOS, string);
- format(string, sizeof(string), "Você está ciente sobre o report de %s. Resolva que possível!", GetName(id));
- SendClientMessage(playerid, COLOR_SOS, string);
- return 1;
- }
- CMD:rr(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /rr [PlayerID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Admin recusar o SEU report!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[id][pReport] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não enviou um report!");
- playerinfo[id][pReport] = 0;
- strmid(playerinfo[id][pReportStr], "", 0, strlen(""), 255);
- format(string, sizeof(string), "O Admin %s recusou a sua report!", GetName(playerid));
- SendClientMessage(id, COLOR_SOS, string);
- format(string, sizeof(string), "Você recusou report de %s. Explique-o se possível o motivo!", GetName(id));
- SendClientMessage(playerid, COLOR_SOS, string);
- return 1;
- }
- CMD:checarreports(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- SendClientMessage(playerid, COLOR_SOS, " [Lista de Report's ativas]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pReport] == 1)
- {
- SendClientMessage(playerid, COLOR_SOS, playerinfo[i][pReportStr]);
- }
- }
- return 1;
- }
- CMD:ajail(playerid, params[])
- {
- new id, time, reason[128];
- if(sscanf(params, "uds[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ajail [PlayerID] [Minutos] [Motivo]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(playerinfo[playerid][pAdmin] < playerinfo[id][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, " O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- format(string, sizeof(string), "[ADMCMD] %s foi preso por %d minutos pelo administrador %s. Motivo: %s", GetName(id), time, GetName(playerid), reason);
- SendClientMessageToAll(COLOR_BAN, string);
- format(string, sizeof(string), "[%s] [Ajail] O Administrador %s prendeu %s por %d minutos. Motivo: %s", getDateEx(), GetName(playerid), GetName(id), time, reason);
- Log("AdminCMD.log", string);
- SetPlayerInterior(id, 5);
- SetPlayerPos(id, 322.197998, 302.497985, 999.148437);
- playerinfo[id][pJailTime] = time*60;
- playerinfo[id][pJailed] = 1;
- playerinfo[id][pJailType] = 3;
- SendClientMessage(id, COLOR_NEUTRAL2, "Eu recomendaria você a rever as regras que você quebrou!");
- SendClientMessage(id, COLOR_NEUTRAL2, "Se você importunar muito o administrador que te puniu, ele poderá dobrar o seu tempo!");
- format(string, sizeof(string), "%s_AdminRecord.log", GetName(id));
- new text[512];
- format(text, sizeof(text), "[Ajail] %s foi preso pelo Administrador %s por %d minutos. Motivo: %s", GetName(id), GetName(playerid), time, reason);
- Log(string, text);
- SaveUser(id);
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- new id, reason[128];
- if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /kick [PlayerID] [Motivo]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(playerinfo[playerid][pAdmin] < playerinfo[id][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- format(string, sizeof(string), "[ADMCMD] %s foi kickado pelo administrador %s. Motivo: %s", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(COLOR_BAN, string);
- Kick(id);
- format(string, sizeof(string), "[%s] [Kick] O Administrador %s kickou %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(id), reason);
- Log("AdminCMD.log", string);
- format(string, sizeof(string), "%s_AdminRecord.log", GetName(id));
- new text[512];
- format(text, sizeof(text), "[Kick] %s foi kickado pelo Administrador %s Motivo: %s", GetName(id), GetName(playerid), reason);
- Log(string, text);
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- new id, reason[128];
- if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ban [PlayerID] [Motivo]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(playerinfo[playerid][pAdmin] < playerinfo[id][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- format(string, sizeof(string), "[ADMCMD] %s foi banido pelo administrador %s. Motivo: %s", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(COLOR_BAN, string);
- Ban(id);
- format(string, sizeof(string), "[%s] [Ban] O Administrador %s baniu %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(id), reason);
- Log("AdminCMD.log", string);
- format(string, sizeof(string), "%s_AdminRecord.log", GetName(id));
- new text[512];
- format(text, sizeof(text), "[Ban] %s foi Banido pelo Administrador %s Motivo: %s", GetName(id), GetName(playerid), reason);
- Log(string, text);
- return 1;
- }
- CMD:tapa(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /tapa [PlayerID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(playerinfo[playerid][pAdmin] < playerinfo[id][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- SendClientMessage(playerid, COLOR_SUCESS, "O jogador foi tapeado!");
- new Float: x,
- Float: y,
- Float: z;
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(id, x, y, z+10.0);
- PlayerPlaySound(id, 1130, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "[%s] [Slap] O Administrador %s tapeou %s!", getDateEx(), GetName(playerid), GetName(id));
- Log("AdminCMD.log", string);
- return 1;
- }
- CMD:ir(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ir [PlayerID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- new Float: X,
- Float: Y,
- Float: Z;
- GetPlayerPos(id, X, Y, Z);
- SetPlayerPos(playerid, X, Y, Z);
- format(string, sizeof(string), "[%s] [Ir] O Administrador %s teleportou-se até %s!", getDateEx(), GetName(playerid), GetName(id));
- Log("AdminCMD.log", string);
- return 1;
- }
- CMD:spec(playerid, params[])
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ir [PlayerID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- TogglePlayerSpectating(playerid, 1);
- if(IsPlayerInAnyVehicle(id))
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
- }
- else
- {
- PlayerSpectatePlayer(playerid, id);
- }
- GameTextForPlayer(playerid, "Para sair de Spec, pressione ~k~~PED_DUCK~", 5000, 5);
- format(string, sizeof(string), "[%s] [Spec] %s espiou %s", getDateEx(), GetName(playerid), GetName(id));
- playerinfo[playerid][pSpectating] = 1;
- Log("AdminCMD.log", string);
- return 1;
- }
- CMD:darlider(playerid, params[])
- {
- new id, factionid;
- if(sscanf(params, "ud", id, factionid)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /darlider [PlayerID] [FactionID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- playerinfo[id][pFaction] = factionid;
- playerinfo[id][pRank] = 10;
- format(string, sizeof(string), "Você tornou %s o líder da facção ID %d (Nome: %s)", GetName(id), factionid, factioninfo[factionid-1][fName]);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O administrador %s te tornou o líder da facção ID %d (Nome: %s)", GetName(playerid), factionid, factioninfo[factionid-1][fName]);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "[Líder] O Administrador %s tornou %s líder da facção ID %d (Nome: %s)", GetName(playerid), GetName(id), factionid, factioninfo[factionid-1][fName]);
- Log("AdminCMD.log", string);
- return 1;
- }
- CMD:ircarro(playerid, params[])
- {
- new vehid;
- if(sscanf(params, "d", vehid)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ircarro [VehicleID]");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
- if(vehid < 1 || vehid > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
- new Float: x,
- Float: y,
- Float: z;
- GetVehiclePos(vehid, x, y, z);
- if(vehicleinfo[vehid][vSQLID] == 0 && vehicleinfo[vehid][vCreated] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe no sistema!");
- SetPlayerPos(playerid, x+3, y, z);
- format(string, sizeof(string), "[Teleporte] O Administrador %s teleportou-se ao veículo %d.", GetName(playerid), vehid);
- Log("AdminCMD.log", string);
- return 1;
- }
- CMD:editar(playerid, params[])
- {
- new targetid, subcmd[128], value;
- if(sscanf(params, "us[128]d(-1)", targetid, subcmd, value))
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [StatName] [Valor]");
- SendClientMessage(playerid, COLOR_SOS, " [Funções]");
- SendClientMessage(playerid, COLOR_SOS, "Level | Dinheiro | Banco | Tester | Faction");
- SendClientMessage(playerid, COLOR_SOS, "Rank | Skin | SpawnType | Emprego");
- }
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins (5+) tenham acesso à este comando! ");
- if(!strcmp(subcmd, "level", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Level] [Valor]");
- if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");
- playerinfo[targetid][pLevel] = value;
- format(string, sizeof(string), "Você editou com sucesso o Level de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou seu Level para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- return 1;
- }
- if(!strcmp(subcmd, "dinheiro", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Dinheiro] [Valor]");
- if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");
- playerinfo[targetid][pMoney] = value;
- format(string, sizeof(string), "Você editou com sucesso o Dinheiro de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou seu Dinheiro para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- ResetPlayerMoney(targetid);
- GivePlayerMoney(targetid, value);
- return 1;
- }
- if(!strcmp(subcmd, "banco", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Banco] [Valor]");
- if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");
- playerinfo[targetid][pBank] = value;
- format(string, sizeof(string), "Você editou com sucesso o Banco de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou seu Banco para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- return 1;
- }
- if(!strcmp(subcmd, "tester", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Tester] [Valor]");
- if(value == 0 || value < -1 || value > 4) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 4!");
- playerinfo[targetid][pTester] = value;
- format(string, sizeof(string), "Você editou com sucesso o Level de Tester %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou seu Level de Tester para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- return 1;
- }
- if(!strcmp(subcmd, "faction", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Faction] [Valor]");
- if(value == 0 || value < -1 || value > 40) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 40!");
- playerinfo[targetid][pFaction] = value;
- format(string, sizeof(string), "Você editou com sucesso a Faction de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou sua Faction para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- return 1;
- }
- if(!strcmp(subcmd, "rank", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Rank] [Valor]");
- if(value == 0 || value < -1 || value > 10) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 10!");
- playerinfo[targetid][pRank] = value;
- format(string, sizeof(string), "Você editou com sucesso o Rank de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou seu Rank para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- return 1;
- }
- if(!strcmp(subcmd, "skin", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Skin] [Valor]");
- if(value < -1 || value == 0 || value > 299) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 299!");
- playerinfo[targetid][pSkin] = value;
- format(string, sizeof(string), "Você editou com sucesso a Skin de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou sua Skin para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- SetPlayerSkin(targetid, value);
- return 1;
- }
- if(!strcmp(subcmd, "spawntype", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [SpawnType] [Valor]");
- if(value == 0 || value < -1 || value > 3) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 3!");
- playerinfo[targetid][pSpawnType] = value;
- format(string, sizeof(string), "Você editou com sucesso o SpawnType de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou seu SpawnType para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- return 1;
- }
- if(!strcmp(subcmd, "emprego", true))
- {
- if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Emprego] [Valor]");
- if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");
- playerinfo[targetid][pJob] = value;
- format(string, sizeof(string), "Você editou com sucesso o Emprego de %s para %d!", GetName(targetid), value);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s editou seu Emprego para %d!", GetName(playerid), value);
- SendClientMessage(targetid, COLOR_SUCESS, string);
- return 1;
- }
- return 1;
- }
- CMD:darvip(playerid, params[])
- {
- new targetid, level, dias;
- if(sscanf(params, "udd", targetid, level, dias))
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /darvip [PlayerID] [Level] [Dias]");
- return SendClientMessage(playerid, COLOR_SOS, "[Leveis] 1(Bronze) | 2(Prata) | 3(Ouro) | 4(Diamante)");
- }
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins level 5 tenham acesso à este comando! ");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(playerinfo[playerid][pAdmin] < playerinfo[targetid][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que você edite apenas administradores de level inferior ao seu!");
- if(dias < 0 || dias > 365 ) return SendClientMessage(playerid, COLOR_ERROR, " O limite de Dias varia de 1 à 365 APENAS!");
- if(level < 1 || level > 4) return SendClientMessage(playerid, COLOR_ERROR, " O level de donate varia entre 1 e 4 APENAS!");
- new levelnome[20];
- if(level == 1)
- {
- format(levelnome, sizeof(levelnome), "Bronze");
- }
- if(level == 2)
- {
- format(levelnome, sizeof(levelnome), "Prata");
- }
- if(level == 3)
- {
- format(levelnome, sizeof(levelnome), "Ouro");
- }
- if(level == 4)
- {
- format(levelnome, sizeof(levelnome), "Diamante");
- }
- format(string, sizeof(string), "O Administrador %s modificou o seu vip para %s por %d dias.", GetName(playerid), levelnome, dias);
- SendClientMessage(targetid, COLOR_SOS, string);
- format(string, sizeof(string), "Você modificou o Vip de %s para %s por %d dias.", GetName(targetid), levelnome, dias);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- playerinfo[targetid][pDonate] = level;
- playerinfo[targetid][pDonatorExpire] = (86400*dias)+gettime();
- printf("Dias: %d ( %d )", (86400*dias)+gettime(), dias);
- SaveUser(targetid);
- return 1;
- }
- CMD:v(playerid, params[])
- {
- new subcmd[32], id;
- if(sscanf(params, "s[32]I(-1)", subcmd, id))
- {
- SendClientMessage(playerid, COLOR_NEUTRAL2, "________________[Subcomandos Veiculares]________________");
- SendClientMessage(playerid, COLOR_SOS, "SINTAXE: /v [Utilidade]");
- SendClientMessage(playerid, COLOR_SOS, "[Utilidades]: lista | comprar | spawn | seguro | estacionar");
- SendClientMessage(playerid, COLOR_SOS, "[Utilidades]: comprarvaga (Custa $2500) | procurar | rebocar | ferrovelho");
- SendClientMessage(playerid, COLOR_SOS, "[Utilidades]: trancar");
- return 1;
- }
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(!strcmp(subcmd, "lista", true))
- {
- format(string, 128, "[Veículos de %s]", GetName(playerid));
- SendClientMessage(playerid, COLOR_NEUTRAL2, string);
- new cars = 0;
- new vstats[32] = "Não";
- new Name[128];
- for(new i = 0; i <= MAX_VEHICLES; i++ )
- {
- if(!strcmp(vehicleinfo[i][vOwner], GetName(playerid), true))
- {
- if(vehicleinfo[i][vLocked] == 1)
- {
- vstats = "Sim";
- }
- GetVehicleName(vehicleinfo[i][vModel], Name, sizeof(Name));
- cars = cars+1;
- format(string, sizeof(string), "(ID:%i) [%i] | Modelo : %s, Alarme: %i, Tranca: %i, Immobiliser: %i, Trancado: %s, Seguro: %i, Vezes Destruído: %i", i,
- vehicleinfo[i][vSQLID], Name, vehicleinfo[i][vAlarm],vehicleinfo[i][vLock],vehicleinfo[i][vImmobiliser], vstats, vehicleinfo[i][vInsurance], vehicleinfo[i][vTimesDestroyed]);
- if(vehicleinfo[i][vInsurance] > 0 && GetVehicleVirtualWorld(i) > 0)
- {
- SendClientMessage(playerid, COLOR_NEUTRAL, string);
- }
- if(vehicleinfo[i][vInsurance] > 0 && GetVehicleVirtualWorld(i) == 0)
- {
- SendClientMessage(playerid, COLOR_SUCESS, string);
- }
- }
- }
- if(cars == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Você atualmente não possui nenhum veículo!");
- }
- return 1;
- }
- if(!strcmp(subcmd, "comprar", true))
- {
- if(!id || id == -1)
- {
- Dealerships(playerid);
- return 1;
- }
- new preco = DealershipPrice(id), Nome[35];
- GetVehicleName(id, Nome, 35);
- if(DealershipValid(id, 1))
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1702.9060,-1469.3427,13.5469)) return SendClientMessage(playerid, COLOR_ERROR, "Você não está na concessionária!");
- if(!DealershipPrice(id)) return SendClientMessage(playerid, COLOR_ERROR, "Você digitou um ID incorreto!");
- if(playerinfo[playerid][pMoney] < preco) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- format(string, 128, "Você comprou um %s por %i$, faça bom proveito do seu novo veículo.", Nome, DealershipPrice(id));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- AddForSaleVehicle(playerid, id, 1700.2917,-1502.0557,13.3828,178.8378, preco);
- return 1;
- }
- if(DealershipValid(id, 2) == 1)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, 411.9653,-1729.3180,9.3693)) return SendClientMessage(playerid, COLOR_ERROR, "Você não está na concessionária!");
- if(!DealershipPrice(id)) return SendClientMessage(playerid, COLOR_ERROR, "Voce digitou um ID incorreto!");
- format(string, 128, "Você comprou um %s por %i$, faça bom proveito do seu novo veículo.", Nome, DealershipPrice(id));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- AddForSaleVehicle(playerid, id, 416.8412,-1722.7974,8.7789,178.8378, preco);
- return 1;
- }
- if(DealershipValid(id, 3) == 1)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, 145.8890,-1834.8905,2.0585)) return SendClientMessage(playerid, COLOR_ERROR, "Você não está na concessionária.");
- if(!DealershipPrice(id)) return SendClientMessage(playerid, COLOR_ERROR, "Você digitou um ID incorreto!");
- format(string, 128, "Você comprou um %s por %i$, faça bom proveito do seu novo veículo.", Nome, DealershipPrice(id));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- AddForSaleVehicle(playerid, id, 89.8989,-1834.7538,-0.5048,88.7344, preco);
- return 1;
- }
- return 1;
- }
- if(!strcmp(subcmd, "spawn", true))
- {
- if(!id || id == -1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v spawn [vID]");
- return 1;
- }
- if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
- if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
- if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
- {
- if(vehicleinfo[id][vInsurance] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este veículo foi destruído por estar sem seguros!");
- if(GetVehicleVirtualWorld(id) == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este veículo já está spawnado!");
- new Fuel, OwnerName[32];
- Fuel = vehicleinfo[id][vFuel];
- strmid(OwnerName, vehicleinfo[id][vOwner], 0, strlen(vehicleinfo[id][vOwner]), 255);
- DestroyVehicle(id);
- new vehicle = CreateVehicle(vehicleinfo[id][vModel], vehicleinfo[id][vParkPos1], vehicleinfo[id][vParkPos2], vehicleinfo[id][vParkPos3],vehicleinfo[id][vParkPos4], vehicleinfo[id][vColors1], vehicleinfo[id][vColors2], -1);
- SetVehiclePos(vehicle, vehicleinfo[id][vParkPos1], vehicleinfo[id][vParkPos2], vehicleinfo[id][vParkPos3]);
- SetVehicleZAngle(vehicle, vehicleinfo[id][vParkPos4]);
- ChangeVehicleColor(vehicle, vehicleinfo[id][vColors1], vehicleinfo[id][vColors2]);
- strmid(vehicleinfo[vehicle][vOwner], OwnerName, 0, strlen(OwnerName), 255);
- SetVehicleVirtualWorld(vehicle, 0);
- vehicleinfo[vehicle][vFuel] = Fuel;
- SendClientMessage(playerid, COLOR_SUCESS, "Você spawnou seu veículo com sucesso!");
- SetVehicleParamsEx(vehicle, 0, 0, 0, 1, 0, 0, 0);
- vehicleinfo[id][vLocked] = 1;
- vehicleinfo[id][vSpawned] = 1;
- }
- return 1;
- }
- if(!strcmp(subcmd, "seguro", true))
- {
- if(!id || id == -1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v seguro [vID]");
- return 1;
- }
- if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
- if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
- if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
- new insurances = vehicleinfo[id][vInsurance];
- new model = vehicleinfo[id][vModel];
- if(playerinfo[playerid][pMoney] < GetInsurancePrice(model, insurances)) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pMoney] -= GetInsurancePrice(model, insurances);
- GivePlayerMoney(playerid, -GetInsurancePrice(model, insurances));
- vehicleinfo[id][vInsurance] ++;
- new Name[128];
- GetVehicleName(vehicleinfo[id][vModel], Name, sizeof(Name));
- format(string, sizeof(string), "Você adiquiriu 1 seguro para seu %s por %d!", Name, GetInsurancePrice(model, insurances));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- return 1;
- }
- if(!strcmp(subcmd, "estacionar", true))
- {
- if(!id || id == -1)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_ERROR, " O Script requer que você esteja dirigindo o seu veículo para realizar esta operação!");
- if(strcmp(GetName(playerid), vehicleinfo[vid][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
- if(IsPlayerInRangeOfPoint(playerid, 5.0, vehicleinfo[vid][vParkPos1], vehicleinfo[vid][vParkPos2], vehicleinfo[vid][vParkPos3]))
- {
- SetVehicleToRespawn(vid);
- SetVehicleVirtualWorld(vid, vid+1);
- SendClientMessage(playerid, COLOR_SUCESS, " Você estacionou o seu veículo nesta posição!");
- vehicleinfo[vid][vSpawned] = 0;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, " O Script requer que você esteja perto da vaga comprada para utilizar este comando!");
- SetPlayerCheckpoint(playerid, vehicleinfo[vid][vParkPos1], vehicleinfo[vid][vParkPos2], vehicleinfo[vid][vParkPos3], 5.0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, " Não utilize ID's para estacionar o veículo!");
- }
- return 1;
- }
- if(!strcmp(subcmd, "comprarvaga", true))
- {
- if(!id || id == -1)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_ERROR, " O Script requer que você esteja dirigindo o seu veículo para realizar esta operação!");
- if(strcmp(GetName(playerid), vehicleinfo[vid][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
- if(playerinfo[playerid][pMoney] < 2500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- new Float: w,
- Float: x,
- Float: y,
- Float: z;
- GetVehiclePos(vid, x, y, z);
- GetVehicleZAngle(vid, w);
- vehicleinfo[vid][vParkPos1] = x;
- vehicleinfo[vid][vParkPos2] = y;
- vehicleinfo[vid][vParkPos3] = z;
- vehicleinfo[vid][vParkPos4] = w;
- SetVehicleToRespawn(vid);
- SetVehicleVirtualWorld(vid, vid+1);
- SendClientMessage(playerid, COLOR_SUCESS, " Você estacionou o seu veículo nesta posição!");
- playerinfo[playerid][pMoney] -= 2500;
- GivePlayerMoney(playerid, -2500);
- vehicleinfo[vid][vSpawned] = 0;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, " Não utilize ID's para comprar a vaga!");
- }
- return 1;
- }
- if(!strcmp(subcmd, "procurar", true))
- {
- if(!id || id == -1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v procurar [vID]");
- return 1;
- }
- if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
- if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
- if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
- new block;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInVehicle(i, id))
- {
- block = 1;
- return 1;
- }
- }
- if(block == 0)
- {
- new Float: x, Float: y, Float: z;
- GetVehiclePos(id, x, y, z);
- SetPlayerCheckpoint(playerid, x, y, z, 3.0);
- SendClientMessage(playerid, COLOR_SOS, "Siga o checkpoint para encontrar o seu veículo!");
- return 1;
- }
- if(block == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Existe alguém dentro do seu veículo, não posso encontrá-lo!");
- return 1;
- }
- return 1;
- }
- if(!strcmp(subcmd, "rebocar", true))
- {
- if(!id || id == -1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v rebocar [vID]");
- return 1;
- }
- if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
- if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
- if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
- if(playerinfo[playerid][pMoney] < 1000) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- new block;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInVehicle(i, id))
- {
- block = 1;
- return 1;
- }
- }
- if(block == 0)
- {
- TowingCar[playerid] = 10;
- TowedCar[playerid] = id;
- return 1;
- }
- if(block == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Existe alguém dentro do seu veículo, não posso rebocá-lo!");
- return 1;
- }
- return 1;
- }
- if(!strcmp(subcmd, "ferrovelho", true))
- {
- if(!id || id == -1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v ferrovelho [vID]");
- SendClientMessage(playerid, COLOR_SOS, "ATENÇÃO: Este comando DELETARÁ o seu veículo e você receberá 50 porcento do valor do mesmo!");
- return 1;
- }
- if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
- if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
- if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
- strmid(vehicleinfo[id][vOwner], "FerroVelho", 0, 10, 255);
- SetVehicleToRespawn(id);
- SetVehicleVirtualWorld(id, id+1);
- new Name[128];
- new price = DealershipPrice(vehicleinfo[id][vModel]);
- format(string, sizeof(string), "Você vendeu o seu %s com sucesso para o ferro velho por $%d!", GetVehicleName(vehicleinfo[id][vModel], Name, sizeof(Name)), price/2);
- SendClientMessage(playerid, COLOR_SOS, string);
- playerinfo[playerid][pMoney] += price/2;
- GivePlayerMoney(playerid, price/2);
- format(string, sizeof(string), "[FerroVelho] %s vendeu o seu %s com sucesso para o ferro velho por $%d!", GetName(playerid), GetVehicleName(vehicleinfo[id][vModel], Name, sizeof(Name)), price/2);
- Log("FerroVelho.log", string);
- return 1;
- }
- if(!strcmp(subcmd, "trancar", true))
- {
- new Float: x,
- Float: y,
- Float: z,
- engine, lights, alarm, doors, bonnet, boot, objective;
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- if(!strcmp(vehicleinfo[i][vOwner], GetName(playerid), true) && vehicleinfo[i][vSpawned] == 1)
- {
- GetVehiclePos(i, x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
- {
- if(vehicleinfo[i][vLocked] == 1)
- {
- vehicleinfo[i][vLocked] = 0;
- GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(i, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
- new name[128];
- GetVehicleName(vehicleinfo[i][vModel], name, 128);
- format(string, sizeof(string), "~g~%s destrancado", name);
- GameTextForPlayer(playerid, string, 1000, 5);
- return 1;
- }
- if(vehicleinfo[i][vLocked] == 0)
- {
- vehicleinfo[i][vLocked] = 1;
- GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(i, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
- new name[128];
- GetVehicleName(vehicleinfo[i][vModel], name, 128);
- format(string, sizeof(string), "~r~%s trancado", name);
- GameTextForPlayer(playerid, string, 1000, 5);
- }
- }
- }
- }
- return 1;
- }
- return 1;
- }
- CMD:motor(playerid, params[])
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- new i = GetPlayerVehicleID(playerid);
- if(strcmp(vehicleinfo[i][vOwner], GetName(playerid), true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui as chaves deste veículo!");
- if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_ERROR, "Você não está dentro de seu veículo!");
- GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);
- if(vehicleinfo[i][vEngine] == 0)
- {
- SetVehicleParamsEx(i, 1, lights, alarm, doors, bonnet, boot, objective);
- format(string, sizeof(string), "* %s vira a chave na ignição, ligando o veículo", GetName(playerid));
- SetPlayerChatBubble(playerid, string, COLOR_ACTION, 30.0, 5000);
- vehicleinfo[i][vEngine] = 1;
- return 1;
- }
- if(vehicleinfo[i][vEngine] == 1)
- {
- SetVehicleParamsEx(i, 0, lights, alarm, doors, bonnet, boot, objective);
- format(string, sizeof(string), "* %s vira a chave na ignição, desligando o veículo", GetName(playerid));
- SetPlayerChatBubble(playerid, string, COLOR_ACTION, 30.0, 5000);
- vehicleinfo[i][vEngine] = 0;
- }
- return 1;
- }
- CMD:stats(playerid, params[])
- {
- ShowStats(playerid, playerid);
- return 1;
- }
- CMD:darpayday(playerid, params[])
- {
- if(playerinfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas adminsitradores level 1338+ desfrutem deste comando!");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- Payday();
- return 1;
- }
- CMD:minhasdrogas(playerid, params[])
- {
- format(string, sizeof(string), "Cocaina: %d | Crack: %d | Heroina: %d | Cachimbo: %d | LSD: %d | Maconha: %d | Haxixe: %d | Agulhas: %d", druginfo[playerid][pCocaina], druginfo[playerid][pCrack],
- druginfo[playerid][pHeroina], druginfo[playerid][pCachimbo], druginfo[playerid][pLSD], druginfo[playerid][pMaconha], druginfo[playerid][pHaxixe], druginfo[playerid][pAgulhas]);
- SendClientMessage(playerid, COLOR_SOS, string);
- return 1;
- }
- CMD:dararma(playerid, params[])
- {
- new id, weapon, ammo;
- if(playerinfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas adminsitradores level 3+ desfrutem deste comando!");
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(sscanf(params, "udd", id, weapon, ammo)) return SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /dararma [PlayerID] [WeaponID] [Munição]");
- if(weapon < 1 || weapon > 46) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das armas variam de 1 à 46 APENAS!");
- GivePlayerWeapon(id, weapon, ammo);
- return 1;
- }
- CMD:aceitarmorte(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pMorto] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está morto!");
- playerinfo[playerid][pMorto] = 0;
- SetPlayerPos(playerid, 0, 0, 0);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, true);
- SendClientMessage(playerid, COLOR_SUCESS, "Você aceitou a morte e o Viih não terminou o comando para sugar seu dinheiro!");
- return 1;
- }
- CMD:revistar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new faction = playerinfo[playerid][pFaction];
- if(factioninfo[faction-1][fType] != 1) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções governamentais desfrutem deste comando!");
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /revistar [PlayerID]");
- if(!IsPlayerNearPlayer(3.5, playerid, id)) return SendClientMessage(playerid, COLOR_ERROR, " Você não está perto desta pessoa!");
- FriskPlayer(playerid, id);
- return 1;
- }
- CMD:editarweaponinfo(playerid, params[])
- {
- new id, type, info;
- if(sscanf(params, "udd", id, type, info))
- {
- SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /editarweaponinfo [PlayerID] [WeaponType] [Weapon]");
- SendClientMessage(playerid, COLOR_SOS, " WeaponTypes: 1(Pistola), 2(Rifles), 3(Submetralhadoras)");
- return 1;
- }
- switch(type)
- {
- case 1: { playerinfo[id][pPistolType] = info; }
- case 2: { playerinfo[id][pRifleType] = info; }
- case 3: { playerinfo[id][pSubType] = info; }
- }
- return 1;
- }
- CMD:dmv(playerid, params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2131.3684,-1149.9357,24.2074)) return SendClientMessage(playerid, COLOR_ERROR, "Você não está perto da Auto Escola de Los Santos!");
- playerinfo[playerid][pCheckpointReason] = 1;
- playerinfo[playerid][pCheckpointNumber] = 1;
- SetPlayerCheckpoint(playerid, 2126.853759, -1125.523559, 25.218969, 5.0);
- return 1;
- }
- CMD:encomendararma(playerid, params[])
- {
- new faction = playerinfo[playerid][pFaction];
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(factioninfo[faction-1][fType] != 5) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções mafiosas desfrutem deste comando!");
- if(playerinfo[playerid][pBizEnteredType] != 4) return SendClientMessage(playerid, COLOR_ERROR, "Você não está dentro de uma Weapon House!");
- new weapon[128];
- if(sscanf(params, "s[128]", weapon))
- {
- SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /encomendararma [Nome]");
- SendClientMessage(playerid, COLOR_ERROR, " [Nomes] SW40VE($7500) | Glock23($8200) | SWMagnum($8500) [Eagle]");
- SendClientMessage(playerid, COLOR_ERROR, " [Nomes] ColtM1911($5500) | Beretta92FS($5000) [Colt 45]");
- SendClientMessage(playerid, COLOR_ERROR, " [Nomes] ColtM4Carbine($12500) [M4]");
- SendClientMessage(playerid, COLOR_ERROR, " [Nomes] HecklerKochMP5($11250) [MP5]");
- return 1;
- }
- if(!strcmp(weapon, "sw40ve", true))
- {
- if(playerinfo[playerid][pMoney] < 7500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pPistolType] = 1;
- playerinfo[playerid][pPistol] = 24;
- playerinfo[playerid][pPistolAmmo] = 100;
- GivePlayerWeapon(playerid, 24, 100);
- playerinfo[playerid][pMoney] -= 7500;
- GivePlayerMoney(playerid, -7500);
- SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Smith & Wesson SW40VE com 100 munições por $7500!");
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Smith & Wesson SW40VE com 100 munições por $7500!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- if(!strcmp(weapon, "glock23", true))
- {
- if(playerinfo[playerid][pMoney] < 8200) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pPistolType] = 2;
- playerinfo[playerid][pPistol] = 24;
- playerinfo[playerid][pPistolAmmo] = 100;
- GivePlayerWeapon(playerid, 24, 100);
- playerinfo[playerid][pMoney] -= 8200;
- GivePlayerMoney(playerid, -8200);
- SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Glock 23 com 100 munições por $8200!");
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Glock 23 com 100 munições por $8200!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- if(!strcmp(weapon, "swmagnum", true))
- {
- if(playerinfo[playerid][pMoney] < 8500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pPistolType] = 3;
- playerinfo[playerid][pPistol] = 24;
- playerinfo[playerid][pPistolAmmo] = 100;
- GivePlayerWeapon(playerid, 24, 100);
- playerinfo[playerid][pMoney] -= 8500;
- GivePlayerMoney(playerid, -8500);
- SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Smith & Wesson .500 S&W Magnum com 100 munições por $8500!");
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Smith & Wesson .500 S&W Magnum com 100 munições por $8500!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- if(!strcmp(weapon, "coltm1911", true))
- {
- if(playerinfo[playerid][pMoney] < 5500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pPistolType] = 4;
- playerinfo[playerid][pPistol] = 22;
- playerinfo[playerid][pPistolAmmo] = 100;
- GivePlayerWeapon(playerid, 22, 100);
- playerinfo[playerid][pMoney] -= 5500;
- GivePlayerMoney(playerid, -5500);
- SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Colt M1911 com 100 munições por $5500!");
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Colt M1911 com 100 munições por $5500!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- if(!strcmp(weapon, "beretta92fs", true))
- {
- if(playerinfo[playerid][pMoney] < 5000) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pPistolType] = 5;
- playerinfo[playerid][pPistol] = 22;
- playerinfo[playerid][pPistolAmmo] = 100;
- GivePlayerWeapon(playerid, 22, 100);
- playerinfo[playerid][pMoney] -= 5000;
- GivePlayerMoney(playerid, -5000);
- SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Beretta 92 FS com 100 munições por $5000!");
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Beretta 92 FS com 100 munições por $5000!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- if(!strcmp(weapon, "coltm4carbine", true))
- {
- if(playerinfo[playerid][pMoney] < 12500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pRifleType] = 1;
- playerinfo[playerid][pRifle] = 31;
- playerinfo[playerid][pRifleAmmo] = 120;
- GivePlayerWeapon(playerid, 31, 120);
- playerinfo[playerid][pMoney] -= 12500;
- GivePlayerMoney(playerid, -12500);
- SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Colt M4 Carbine com 120 munições por $12500!");
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Colt M4 Carbine com 120 munições por $12500!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- if(!strcmp(weapon, "hecklerkochmp5", true))
- {
- if(playerinfo[playerid][pMoney] < 11250) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pSubType] = 1;
- playerinfo[playerid][pSub] = 29;
- playerinfo[playerid][pRifleAmmo] = 120;
- GivePlayerWeapon(playerid, 29, 120);
- playerinfo[playerid][pMoney] -= 11250;
- GivePlayerMoney(playerid, -11250);
- SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Heckler & Koch MP5 Submachine Gun com 120 munições por $11250!");
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Heckler & Koch MP5 Submachine Gun com 120 munições por $11250!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- return 1;
- }
- CMD:ligar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pCellphone] == -1) return SendClientMessage(playerid, COLOR_ERROR, " Você não possui um celular!");
- new number;
- if(sscanf(params, "d", number)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ligar [Número]");
- if(number < 555 || number > 999999) return SendClientMessage(playerid, COLOR_ERROR, "Operadora informa: Este número de telefone não existe!");
- new looped;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(playerinfo[i][pCellphone] == number)
- {
- playerinfo[i][pRinging] = 1;
- callinfo[i][Caller] = playerid;
- looped ++;
- SendClientMessage(i, COLOR_SOS, "O seu celular está tocando, utilize /atender");
- }
- }
- if(looped == 0) return SendClientMessage(playerid, COLOR_ERROR, "Operadora informa: Este número de telefone não existe ou está ocupado!");
- return 1;
- }
- CMD:atender(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pCellphone] == -1) return SendClientMessage(playerid, COLOR_ERROR, " Você não possui um celular!");
- if(playerinfo[playerid][pRinging] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Ninguém está te ligando no momento!");
- playerinfo[playerid][pRinging] = 0;
- SendClientMessage(playerid, COLOR_SOS, "Você atendeu a chamada.");
- SendClientMessage(callinfo[playerid][Caller], COLOR_SOS, "Atenderam a chamada.");
- callinfo[playerid][InaCall] = 1;
- callinfo[callinfo[playerid][Caller]][InaCall] = 1;
- return 1;
- }
- CMD:desligar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(playerinfo[playerid][pCellphone] == -1) return SendClientMessage(playerid, COLOR_ERROR, " Você não possui um celular!");
- if(callinfo[playerid][InaCall] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está em uma ligação!");
- callinfo[playerid][InaCall] = 0;
- SendClientMessage(callinfo[playerid][Caller], COLOR_ERROR, "A ligação foi encerrada!");
- callinfo[callinfo[playerid][Caller]][InaCall] = 0;
- callinfo[playerid][Caller] = 0;
- SendClientMessage(playerid, COLOR_ERROR, "A ligação foi encerrada!");
- return 1;
- }
- CMD:editarnumero(playerid, params[])
- {
- new id, cell;
- if(sscanf(params, "ud", id, cell)) return 1;
- playerinfo[id][pCellphone] = cell;
- return 1;
- }
- CMD:comprar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new i = playerinfo[playerid][pBizEntered];
- new sscanfinput[128];
- if(sscanf(params, "s[128]", sscanfinput))
- {
- if(playerinfo[playerid][pBizEnteredType] == 1)
- {
- SendClientMessage(playerid, COLOR_NEUTRAL2, "______________[24/7]______________");
- SendClientMessage(playerid, COLOR_SOS, "[Sintáxe] /comprar <produto>");
- SendClientMessage(playerid, COLOR_NEUTRAL2, "____________[Produtos]____________");
- SendClientMessage(playerid, COLOR_SOS, "Faca - $35");
- SendClientMessage(playerid, COLOR_SOS, "Bastão de Baseball - $35");
- SendClientMessage(playerid, COLOR_SOS, "Mascara - $300");
- SendClientMessage(playerid, COLOR_SOS, "Spray - $25");
- SendClientMessage(playerid, COLOR_SOS, "Câmera - $50");
- }
- if(playerinfo[playerid][pBizEnteredType] == 2)
- {
- SendClientMessage(playerid, COLOR_NEUTRAL2, "______________[Bar]______________");
- SendClientMessage(playerid, COLOR_SOS, "[Sintáxe] /comprar <produto>");
- SendClientMessage(playerid, COLOR_NEUTRAL2, "____________[Produtos]____________");
- SendClientMessage(playerid, COLOR_SOS, "Água - $10");
- SendClientMessage(playerid, COLOR_SOS, "Café - $15");
- SendClientMessage(playerid, COLOR_SOS, "Vodka - $25");
- SendClientMessage(playerid, COLOR_SOS, "Whisky - $40");
- SendClientMessage(playerid, COLOR_SOS, "Tequila - $50");
- }
- return 1;
- }
- if(playerinfo[playerid][pBizEnteredType] == 1)
- {
- if(!strcmp(sscanfinput, "Mascara", true))
- {
- if(playerinfo[playerid][pMask]) return SendClientMessage(playerid, COLOR_ERROR, "Você já tem uma Máscara.");
- if(playerinfo[playerid][pMoney] < 300) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- if(playerinfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_ERROR, "Você precisa ser level 5+!");
- playerinfo[playerid][pMoney] -= 300;
- GivePlayerMoney(playerid, -300);
- playerinfo[playerid][pMask] = randomEx(10000, 80000);
- format(string, sizeof(string), "Máscara adiquirida. ID: %d.", playerinfo[playerid][pMask]);
- SendClientMessage(playerid, COLOR_SOS, string);
- bizinfo[i][bSafe] += 300;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- }
- else if(!strcmp(sscanfinput, "Faca", true))
- {
- if(playerinfo[playerid][pMoney] < 35) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pMoney] -= 35;
- GivePlayerMoney(playerid, -35);
- SaveUser(playerid);
- bizinfo[i][bSafe] += 35;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- GivePlayerWeapon(playerid, 4, 1);
- SendClientMessage(playerid, COLOR_SOS, "Faca adiquirida!");
- }
- else if(!strcmp(sscanfinput, "Bastão de Baseball", true))
- {
- if(playerinfo[playerid][pMoney] < 35) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- GivePlayerMoney(playerid, -35);
- playerinfo[playerid][pMoney] -= 35;
- SaveUser(playerid);
- bizinfo[i][bSafe] += 35;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- GivePlayerWeapon(playerid, 5, 1);
- SendClientMessage(playerid, COLOR_SOS, "Bastão de Baseball adiquirido!");
- }
- else if(!strcmp(sscanfinput, "Spray", true))
- {
- if(playerinfo[playerid][pMoney] < 25) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- GivePlayerMoney(playerid, -25);
- playerinfo[playerid][pMoney] -= 25;
- SaveUser(playerid);
- bizinfo[i][bSafe] += 25;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- GivePlayerWeapon(playerid, 41, 150);
- SendClientMessage(playerid, COLOR_SOS, "Spray adiquirido!");
- }
- else if(!strcmp(sscanfinput, "Câmera", true))
- {
- if(playerinfo[playerid][pMoney] < 50) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- GivePlayerMoney(playerid, -50);
- playerinfo[playerid][pMoney] -= 50;
- GivePlayerWeapon(playerid, 43, 10);
- SaveUser(playerid);
- bizinfo[i][bSafe] += 50;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- SendClientMessage(playerid, COLOR_SOS, "Câmera adiquirida!");
- }
- }
- if(playerinfo[playerid][pBizEnteredType] == 2)
- {
- if(!strcmp(sscanfinput, "Água", true))
- {
- if(playerinfo[playerid][pMoney] < 10) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pMoney] -= 10;
- GivePlayerMoney(playerid, -10);
- bizinfo[i][bSafe] += 10;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- SendClientMessage(playerid, COLOR_SOS, "Garrafa de água adiquirida!");
- SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");
- playerinfo[playerid][pBebida] = 1;
- }
- else if(!strcmp(sscanfinput, "Café", true))
- {
- if(playerinfo[playerid][pMoney] < 15) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- playerinfo[playerid][pMoney] -= 15;
- GivePlayerMoney(playerid, -15);
- SaveUser(playerid);
- bizinfo[i][bSafe] += 15;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- SendClientMessage(playerid, COLOR_SOS, "Copo de café adiquirido!");
- SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-lo ((/beber))");
- playerinfo[playerid][pBebida] = 2;
- }
- else if(!strcmp(sscanfinput, "Vodka", true))
- {
- if(playerinfo[playerid][pMoney] < 25) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- GivePlayerMoney(playerid, -25);
- playerinfo[playerid][pMoney] -= 25;
- SaveUser(playerid);
- bizinfo[i][bSafe] += 25;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- SendClientMessage(playerid, COLOR_SOS, "Garrafa de Vodka adiquirida!");
- SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");
- playerinfo[playerid][pBebida] = 3;
- }
- else if(!strcmp(sscanfinput, "Whisky", true))
- {
- if(playerinfo[playerid][pMoney] < 40) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- GivePlayerMoney(playerid, -40);
- playerinfo[playerid][pMoney] -= 40;
- SaveUser(playerid);
- bizinfo[i][bSafe] += 40;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- SendClientMessage(playerid, COLOR_SOS, "Garrafa de Whisky adiquirida!");
- SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");
- playerinfo[playerid][pBebida] = 4;
- }
- else if(!strcmp(sscanfinput, "Tequila", true))
- {
- if(playerinfo[playerid][pMoney] < 50) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
- GivePlayerMoney(playerid, -50);
- playerinfo[playerid][pMoney] -= 50;
- SaveUser(playerid);
- bizinfo[i][bSafe] += 50;
- bizinfo[i][bProducts] --;
- SaveBiz(i);
- SendClientMessage(playerid, COLOR_SOS, "Garrafa de Tequila adiquirida!");
- SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");
- playerinfo[playerid][pBebida] = 5;
- }
- }
- return 1;
- }
- CMD:depositar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new quantia;
- if(sscanf(params, "d", quantia)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /depositar [Quantia]");
- if(quantia <= 0) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 0!");
- if(playerinfo[playerid][pMoney] < quantia) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui esta quantia de dinheiro com você!");
- playerinfo[playerid][pMoney] -= quantia;
- playerinfo[playerid][pBank] += quantia;
- GivePlayerMoney(playerid, -quantia);
- format(string, sizeof(string), "Você depositou com sucesso um valor de $%d", quantia);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Smith & Wesson SW40VE com 100 munições por $7500!", GetName(playerid));
- Log("Weapon.log", string);
- return 1;
- }
- CMD:sacar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new quantia;
- if(sscanf(params, "d", quantia)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /sacar [Quantia]");
- if(quantia <= 0) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 0!");
- if(playerinfo[playerid][pBank] < quantia) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui esta quantia de dinheiro em sua conta bancária!");
- playerinfo[playerid][pBank] -= quantia;
- playerinfo[playerid][pMoney] += quantia;
- GivePlayerMoney(playerid, quantia);
- format(string, sizeof(string), "Você sacou com sucesso um valor de $%d", quantia);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- return 1;
- }
- CMD:extrato(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- SendClientMessage(playerid, COLOR_SOS, "_______________[Extrato Bancário]_______________");
- format(string, sizeof(string), "Saldo: $%d", playerinfo[playerid][pBank]);
- SendClientMessage(playerid, COLOR_NEUTRAL2, string);
- return 1;
- }
- CMD:algemar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new id;
- new faction = playerinfo[playerid][pFaction];
- if(factioninfo[faction-1][fType] != 1) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que apenas facções policiais executem este comando!");
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /algemar [PlayerID]");
- if(playerinfo[id][pLogado] == 0 || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(!IsPlayerNearPlayer(5.0, playerid, id)) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que você apenas algeme pessoas que estão perto de você!");
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode se algemar!");
- faction = playerinfo[id][pFaction];
- if(factioninfo[faction-1][fType] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode algemar outros oficiais!");
- if(playerinfo[playerid][pCuffed] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador já está algemado! (/desalgemar)");
- SetPlayerAttachedObject(id, 4, 19418, 6, -0.031999, 0.024000,-0.024000,-7.900000,-32.000011,-72.299987, 1.115998, 1.322000, 1.406000);
- SetPlayerSpecialAction(id, 24);
- return 1;
- }
- CMD:desalgemar(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new id;
- new faction = playerinfo[playerid][pFaction];
- if(factioninfo[faction-1][fType] != 1) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que apenas facções policiais executem este comando!");
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /desalgemar [PlayerID]");
- if(playerinfo[id][pLogado] == 0 || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
- if(!IsPlayerNearPlayer(5.0, playerid, id)) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que você apenas desalgeme pessoas que estão perto de você!");
- if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode se desalgemar!");
- faction = playerinfo[id][pFaction];
- if(factioninfo[faction-1][fType] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode desalgemar outros oficiais!");
- if(playerinfo[playerid][pCuffed] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não está algemado! (/algemar)");
- SetPlayerSpecialAction(id, 0);
- RemovePlayerAttachedObject(id, 4);
- return 1;
- }
- CMD:portamalas(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que apenas motoristas executem este comando!");
- new vid = GetPlayerVehicleID(playerid);
- new subcmd[128], wid;
- if(sscanf(params, "s[128],d(-1)", subcmd, wid))
- {
- SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /portamalas [Função]");
- return SendClientMessage(playerid, COLOR_ERROR, "[Funções]: Abrir | Fechar | ColocarArma | RetirarArma | ColocarDroga | RetirarDroga | Checar");
- }
- if(!strcmp(subcmd, "abrir", true))
- {
- if(GetVehicleParameters(vid, 5) == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Este portamalas já está aberto. ((/portamalas fechar))");
- return 1;
- }
- if(wid == -1)
- {
- if(vehicleinfo[vid][vFCarID] > 0) return SendClientMessage(playerid, COLOR_ERROR, "O Script bloqueia este comando em veículos de faction!");
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,1,objective);
- }
- return 1;
- }
- if(!strcmp(subcmd, "fechar", true))
- {
- if(GetVehicleParameters(vid, 5) == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Este portamalas já está fechado. ((/portamalas abrir))");
- return 1;
- }
- if(wid == -1)
- {
- if(vehicleinfo[vid][vFCarID] > 0) return SendClientMessage(playerid, COLOR_ERROR, "O Script bloqueia este comando em veículos de faction!");
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,0,objective);
- }
- return 1;
- }
- return 1;
- }
- CMD:entregararma(playerid, params[])
- {
- if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
- if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /entregararma [PlayerID]");
- new gunID = GetPlayerWeapon(playerid);
- new gunAmmo = GetPlayerAmmo(playerid);
- if(gunID == 22 || gunID == 24)
- {
- playerinfo[id][pPistolType] = playerinfo[playerid][pPistolType];
- playerinfo[playerid][pPistolType] = 0;
- }
- if(gunID == 31)
- {
- playerinfo[id][pRifleType] = playerinfo[playerid][pRifleType];
- playerinfo[playerid][pRifleType] = 0;
- }
- if(gunID == 29)
- {
- playerinfo[id][pSubType] = playerinfo[playerid][pRifleType];
- playerinfo[playerid][pSubType] = 0;
- }
- GivePlayerWeapon(id, gunID, gunAmmo);
- RemovePlayerWeapon(playerid, gunID);
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(vehicleinfo[vehicleid][vFCarID] != -1)
- {
- if(playerinfo[playerid][pFaction] != vehicleinfo[vehicleid][vFCarID])
- {
- if(playerinfo[playerid][pAdminDuty] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este veículo [Faction]!");
- new Float:ppos[3];
- GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
- SetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]+1);
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(playerinfo[playerid][pCheckpointReason] == 0)
- {
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
- if(playerinfo[playerid][pCheckpointReason] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- if(playerinfo[playerid][pCheckpointNumber] == 1)
- {
- SetPlayerCheckpoint(playerid, 2194.265625, -1127.350952, 24.806684, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 2;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ok, vamos começar o seu exame. Dobre à direita com cautela.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 2)
- {
- SetPlayerCheckpoint(playerid, 2312.474609, -1153.993164, 26.524555, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 3;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Siga em frente. Cruze com cuidado nos trilhos.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 3)
- {
- SetPlayerCheckpoint(playerid, 2368.512207, -1221.064331, 27.156768, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 4;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ótimo. Agora, vire à direita.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 4)
- {
- SetPlayerCheckpoint(playerid, 2315.188964, -1217.386962, 23.580661, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 5;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Vire novamente à direita, dentro do estacionamento.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 5)
- {
- SetPlayerCheckpoint(playerid, 2263.132568, -1142.357421, 26.549264, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 6;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Muito bom. Dobre à direita, e nos trilhos, à esquerda.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 6)
- {
- SetPlayerCheckpoint(playerid, 2021.039306, -1026.977905, 35.217605, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 7;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Mantenha à direita e pegue a adjacente.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 7)
- {
- SetPlayerCheckpoint(playerid, 1918.079833, -1021.020385, 34.544483, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 8;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ok. Você foi muito bem até agora. Vamos tentar na interestadual.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 8)
- {
- SetPlayerCheckpoint(playerid, 1779.353881, -946.320190, 44.413249, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 9;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Mantenha-se ainda à direita para entrar na rodovia.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 9)
- {
- SetPlayerCheckpoint(playerid, 1707.737182, -744.599670, 50.794456, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 10;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Diminua a velocidade para entrar, e sempre entre com cuidado.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 10)
- {
- SetPlayerCheckpoint(playerid, 1659.918090, -38.740947, 36.141929, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 11;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ótimo. Aqui, você pode dirigir até 120 kilômetros por hora.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 11)
- {
- SetPlayerCheckpoint(playerid, 1712.067016, 249.732650, 18.113079, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 12;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Mantenha a direita para pegar o conector para Palomino Creek.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 12)
- {
- SetPlayerCheckpoint(playerid, 2135.144775, 311.238372, 33.436832, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 13;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Entre com cuidado. A máxima desta rodovia é 110 kilômetros por hora.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 13)
- {
- SetPlayerCheckpoint(playerid, 2874.805908, -731.757263, 10.563012, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 14;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Siga reto até a entrada de Las Colinas pela East Beach highway.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 14)
- {
- SetPlayerCheckpoint(playerid, 2867.733398, -1016.851379, 10.602074, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 15;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Diminua a velocidade e prepare-se para dobrar à direita.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 15)
- {
- SetPlayerCheckpoint(playerid, 2388.708740, -1150.836303, 27.991292, 5.0);
- playerinfo[playerid][pCheckpointNumber] = 16;
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Dobre à direita e siga reto até a Auto Escola.");
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 16)
- {
- SetPlayerCheckpoint(playerid, 2127.324951, -1130.787597, 25.269168, 5.0);
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Não se esqueça de cruzar com cuidado nos trilhos!");
- playerinfo[playerid][pCheckpointNumber] = 17;
- return 1;
- }
- if(playerinfo[playerid][pCheckpointNumber] == 17)
- {
- SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ótimo. Terminamos.");
- playerinfo[playerid][pCheckpointNumber] = 0;
- playerinfo[playerid][pCheckpointReason] = 0;
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
- {
- new WeaponUsed[128];
- new Float: Health;
- GetPlayerHealth(damagedid, Health);
- if(weaponid == 24)
- {
- if(playerinfo[playerid][pPistolType] == 1)
- {
- strmid(WeaponUsed, weapondata[0][wName], 0, 128, 255);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[0][wDamage], GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SetPlayerHealth(damagedid, Health - weapondata[0][wDamage]);
- }
- if(playerinfo[playerid][pPistolType] == 2)
- {
- strmid(WeaponUsed, weapondata[1][wName], 0, 128, 255);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[1][wDamage], GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SetPlayerHealth(damagedid, Health - weapondata[1][wDamage]);
- }
- if(playerinfo[playerid][pPistolType] == 3)
- {
- strmid(WeaponUsed, weapondata[2][wName], 0, 128, 255);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[2][wDamage], GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SetPlayerHealth(damagedid, Health - weapondata[2][wDamage]);
- }
- }
- if(weaponid == 22)
- {
- if(playerinfo[playerid][pPistolType] == 4)
- {
- strmid(WeaponUsed, weapondata[3][wName], 0, 128, 255);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[3][wDamage], GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SetPlayerHealth(damagedid, Health - weapondata[3][wDamage]);
- }
- if(playerinfo[playerid][pPistolType] == 5)
- {
- strmid(WeaponUsed, weapondata[4][wName], 0, 128, 255);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[4][wDamage], GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SetPlayerHealth(damagedid, Health - weapondata[4][wDamage]);
- }
- }
- if(weaponid == 31)
- {
- if(playerinfo[playerid][pRifleType] == 1)
- {
- strmid(WeaponUsed, weapondata[5][wName], 0, 128, 255);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[5][wDamage], GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SetPlayerHealth(damagedid, Health - weapondata[5][wDamage]);
- }
- }
- if(weaponid == 29)
- {
- if(playerinfo[playerid][pSubType] == 1)
- {
- strmid(WeaponUsed, weapondata[6][wName], 0, 128, 255);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[6][wDamage], GetName(damagedid), WeaponUsed);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SetPlayerHealth(damagedid, Health - weapondata[6][wDamage]);
- }
- }
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 0;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_CROUCH))
- {
- if(playerinfo[playerid][pAdmin] < 1) return 1;
- if(playerinfo[playerid][pSpectating] == 0) return 1;
- TogglePlayerSpectating(playerid, 0);
- SetPlayerSkin(playerid, playerinfo[playerid][pSkin]);
- playerinfo[playerid][pSpectating] = 0;
- if(playerinfo[playerid][pSpawnType] == 0) //Normal
- {
- SetPlayerPos(playerid, 0, 0, 0);
- return 1;
- }
- if(playerinfo[playerid][pSpawnType] == 1) //Casa 1
- {
- new id;
- id = playerinfo[playerid][pCasa1];
- SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);
- return 1;
- }
- if(playerinfo[playerid][pSpawnType] == 2) //Casa 2
- {
- new id;
- id = playerinfo[playerid][pCasa2];
- SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);
- return 1;
- }
- if(playerinfo[playerid][pSpawnType] == 3) //Faction
- {
- new id;
- id = strval(playerinfo[playerid][pFaction]);
- SetPlayerPos(playerid, factioninfo[id][fSpawnX], factioninfo[id][fSpawnY], factioninfo[id][fSpawnZ]);
- return 1;
- }
- if(playerinfo[playerid][pJailed] == 1)
- {
- if(playerinfo[playerid][pJailType] == 1) //County Jail
- {
- SetPlayerPos(playerid, 30, 30, 30);
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");
- return 1;
- }
- if(playerinfo[playerid][pJailType] == 2) //LSP
- {
- SetPlayerPos(playerid, 7, 7, 7);
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");
- return 1;
- }
- if(playerinfo[playerid][pJailType] == 3) //AJAIL
- {
- SetPlayerInterior(playerid, 5);
- SetPlayerPos(playerid, 322.197998, 302.497985, 999.148437);
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena (OOCly)");
- return 1;
- }
- }
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_LOGIN)
- {
- if(!response) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Scarlett Roleplay (Login)", "Digite sua senha abaixo para logar-se!", "Login", "Logout");
- Login(playerid, inputtext);
- playerinfo[playerid][pCameraInterpol] = 0;
- }
- if(dialogid == DIALOG_ADMPM)
- {
- if(!response) return 1;
- SendClientMessage(playerid, COLOR_PM, playerinfo[playerid][pString2]);
- SendClientMessage(SendingPM[playerid], COLOR_PM, playerinfo[playerid][pString]);
- SendingPM[playerid] = 0;
- strmid(playerinfo[playerid][pString], "", 0, strlen(""), 255);
- strmid(playerinfo[playerid][pString2], "", 0, strlen(""), 255);
- }
- if(dialogid == DIALOG_ADMACTIONS)
- {
- if(!response) return 1;
- if(listitem == 0) //Spec
- {
- TogglePlayerSpectating(playerid, 1);
- if(IsPlayerInAnyVehicle(targetclick[playerid]))
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetclick[playerid]));
- }
- else
- {
- PlayerSpectatePlayer(playerid, targetclick[playerid]);
- }
- GameTextForPlayer(playerid, "Para sair de Spec, pressione ~k~~PED_DUCK~", 5000, 5);
- format(string, sizeof(string), "[%s] [Spec] %s espiou %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]));
- playerinfo[playerid][pSpectating] = 1;
- Log("AdminCMD.log", string);
- }
- if(listitem == 1) //Ir
- {
- new Float: X,
- Float: Y,
- Float: Z;
- GetPlayerPos(targetclick[playerid], X, Y, Z);
- SetPlayerPos(playerid, X, Y, Z);
- format(string, sizeof(string), "[%s] [Ir] O Administrador %s teleportou-se até %s!", getDateEx(), GetName(playerid), GetName(targetclick[playerid]));
- Log("AdminCMD.log", string);
- }
- if(listitem == 2) //Kick
- {
- ShowPlayerDialog(playerid, DIALOG_ADMKICK, DIALOG_STYLE_INPUT, "Kick Player", "Digite o motivo do kick abaixo", "Confirmar", "Cancelar");
- }
- if(listitem == 3) //Ban
- {
- ShowPlayerDialog(playerid, DIALOG_ADMKICK, DIALOG_STYLE_INPUT, "Ban Player", "Digite o motivo do ban abaixo", "Confirmar", "Cancelar");
- }
- if(listitem == 4) //Ajail
- {
- ShowPlayerDialog(playerid, DIALOG_ADMAJAIL, DIALOG_STYLE_INPUT, "Ajail Player", "Digite o tempo da ajail abaixo", "Confirmar", "Cancelar");
- return 1;
- }
- if(listitem == 5) //Slap
- {
- if(playerinfo[playerid][pAdmin] < playerinfo[targetclick[playerid]][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- SendClientMessage(playerid, COLOR_SUCESS, "O jogador foi tapeado!");
- new Float: x,
- Float: y,
- Float: z;
- GetPlayerPos(targetclick[playerid], x, y, z);
- SetPlayerPos(targetclick[playerid], x, y, z+10.0);
- PlayerPlaySound(targetclick[playerid], 1130, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "[%s] [Slap] O Administrador %s tapeou %s!", getDateEx(), GetName(playerid), GetName(targetclick[playerid]));
- Log("AdminCMD.log", string);
- }
- if(listitem == 6) //Editar
- {
- if(playerinfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, "Apenas administradores de level maiores que 5 podem utilizar esta função!");
- ShowPlayerDialog(playerid, DIALOG_ADMEDIT, DIALOG_STYLE_LIST, "Edição de Usuario", "Nickname\nLevel\nSenha\nDinheiro\nBanco\nCasas\nSkin\nFaction\nRank\nTester\nDonate", "Confirmar","Cancelar");
- }
- }
- if(dialogid == DIALOG_ADMKICK)
- {
- if(!response) return 1;
- if(playerinfo[playerid][pAdmin] < playerinfo[targetclick[playerid]][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- format(string, sizeof(string), "[ADMCMD] %s foi kickado pelo administrador %s. Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);
- SendClientMessageToAll(COLOR_BAN, string);
- Kick(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Kick] O Administrador %s kickou %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), inputtext);
- Log("AdminCMD.log", string);
- format(string, sizeof(string), "%s_AdminRecord.log", GetName(targetclick[playerid]));
- new text[512];
- format(text, sizeof(text), "[Kick] %s foi kickado pelo Administrador %s Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);
- Log(string, text);
- }
- if(dialogid == DIALOG_ADMBAN)
- {
- if(!response) return 1;
- if(playerinfo[playerid][pAdmin] < playerinfo[targetclick[playerid]][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- format(string, sizeof(string), "[ADMCMD] %s foi banido pelo administrador %s. Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);
- SendClientMessageToAll(COLOR_BAN, string);
- Ban(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Ban] O Administrador %s baniu %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), inputtext);
- Log("AdminCMD.log", string);
- format(string, sizeof(string), "%s_AdminRecord.log", GetName(targetclick[playerid]));
- new text[512];
- format(text, sizeof(text), "[Ban] %s foi banido pelo Administrador %s Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);
- Log(string, text);
- }
- if(dialogid == DIALOG_ADMAJAIL)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return ShowPlayerDialog(playerid, DIALOG_ADMAJAIL, DIALOG_STYLE_INPUT, "Ajail Player", "Apenas números!\n Digite o tempo do player abaixo", "Confirmar", "Cancelar");
- if(playerinfo[playerid][pAdmin] < playerinfo[targetclick[playerid]][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- PlaceAjail[playerid] = strval(inputtext);
- ShowPlayerDialog(playerid, DIALOG_ADMAJAILR, DIALOG_STYLE_INPUT, "Ajail Player", "Digite o motivo da Ajail abaixo", "Confirmar", "Cancelar");
- }
- if(dialogid == DIALOG_ADMAJAILR)
- {
- if(!response) return 1;
- if(playerinfo[playerid][pAdmin] < playerinfo[targetclick[playerid]][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a punição de administradores de mesmo nível ou maiores que o seu!");
- format(string, sizeof(string), "[ADMCMD] %s foi preso por %d minutos pelo administrador %s. Motivo: %s", GetName(targetclick[playerid]), PlaceAjail[playerid], GetName(playerid), inputtext);
- SendClientMessageToAll(COLOR_BAN, string);
- format(string, sizeof(string), "[%s] [Ajail] O Administrador %s prendeu %s por %d minutos. Motivo: %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), PlaceAjail[playerid], inputtext);
- Log("AdminCMD.log", string);
- SetPlayerInterior(targetclick[playerid], 5);
- SetPlayerPos(targetclick[playerid], 322.197998, 302.497985, 999.148437);
- playerinfo[targetclick[playerid]][pJailTime] = PlaceAjail[playerid]*60;
- playerinfo[targetclick[playerid]][pJailed] = 1;
- playerinfo[targetclick[playerid]][pJailType] = 3;
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Eu recomendaria você a rever as regras que você quebrou!");
- SendClientMessage(playerid, COLOR_NEUTRAL2, "Se você importunar muito o administrador que te puniu, ele poderá dobrar o seu tempo!");
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "%s_AdminRecord.log", GetName(targetclick[playerid]));
- new text[512];
- format(text, sizeof(text), "[Ajail] %s foi preso pelo Administrador %s por %d minutos.Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), PlaceAjail[playerid], inputtext);
- Log(string, text);
- PlaceAjail[playerid] = 0;
- }
- if(dialogid == DIALOG_ADMEDIT)
- {
- if(!response) return 1;
- if(playerinfo[playerid][pAdmin] < playerinfo[targetclick[playerid]][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "O Script impede a edição de administradores de mesmo nível ou maiores que o seu!");
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMNAMEEDIT, DIALOG_STYLE_INPUT, "Edição de Nickname", "Digite o novo nickname do jogador 'Sem _'", "Confirmar", "Cancelar");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMLEVELEDIT, DIALOG_STYLE_INPUT, "Edição de Level", "Digite o novo Level do jogador", "Confirmar", "Cancelar");
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMPASSEDIT, DIALOG_STYLE_INPUT, "Edição de Senha", "Digite a nova Senha do jogador (EM MD5, NÃO SE ESQUEÇA!)", "Confirmar", "Cancelar");
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMMONEYEDIT, DIALOG_STYLE_INPUT, "Edição de Dinheiro", "Digite uma quantia para DAR para o jogador\n Utilize negativo(-) para retirar", "Confirmar", "Cancelar");
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMBANKEDIT, DIALOG_STYLE_INPUT, "Edição de Banco", "Digite uma quantia para o banco do jogador\n Utilize negativo(-) para retirar", "Confirmar", "Cancelar");
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid, DIALOG_HOUSEEDIT1, DIALOG_STYLE_LIST, "Edição de Casas", "Casa 1\nCasa2", "Confirmar", "Cancelar");
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMEDITSKIN, DIALOG_STYLE_INPUT, "Edição de Skin", "Digite o número da nova skin do jogador", "Confirmar", "Cancelar");
- }
- if(listitem == 7)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMEDITGROUP, DIALOG_STYLE_INPUT, "Edição de Faction", "Digite o número da nova faction do jogador", "Confirmar", "Cancelar");
- }
- if(listitem == 8)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMEDITRANK, DIALOG_STYLE_INPUT, "Edição de Rank(Faction)", "Digite o número do novo rank do jogador", "Confirmar", "Cancelar");
- }
- if(listitem == 9)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMEDITTESTER, DIALOG_STYLE_INPUT, "Edição de Tester", "Digite o número do novo Tester Level do jogador", "Confirmar", "Cancelar");
- }
- if(listitem == 10)
- {
- ShowPlayerDialog(playerid, DIALOG_ADMEDITDONATE, DIALOG_STYLE_INPUT, "Edição de Donate", "Digite o número do level de Donate do jogador", "Confirmar", "Cancelar");
- }
- }
- if(dialogid == DIALOG_ADMNAMEEDIT)
- {
- if(!response) return 1;
- if(IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Não utilize números no nome");
- format(string, sizeof(string), "Você acaba de trocar o nome de %s para %s!", GetName(targetclick[playerid]), inputtext);
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "Seu nome foi trocado de %s para %s pelo Administrador %s!", GetName(targetclick[playerid]), inputtext, GetName(playerid));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, "Não esqueça de trocar o seu nick no SA-MP para se logar novamente!");
- SetPlayerName(targetclick[playerid], playerinfo[targetclick[playerid]][pName]);
- strmid(playerinfo[targetclick[playerid]][pName], inputtext, 0, strlen(inputtext), 255);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][NOME] O Administrador %s editou o NOME de %s para %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), inputtext);
- Log("AdminCMD.log", string);
- Kick(targetclick[playerid]);
- }
- if(dialogid == DIALOG_ADMLEVELEDIT)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de trocar o Level de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "Seu Level foi editado para %d pelo Administrador %s!", strval(inputtext), GetName(playerid));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pLevel] = strval(inputtext);
- SetPlayerScore(targetclick[playerid], playerinfo[targetclick[playerid]][pLevel]);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][LEVEL] O Administrador %s editou o LEVEL de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_ADMPASSEDIT)
- {
- if(!response) return 1;
- format(string, sizeof(string), "Você acaba de trocar a senha de %s para %s!", GetName(targetclick[playerid]), strval(inputtext));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "Sua senha foi editada para %s pelo Administrador %s!", strval(inputtext), GetName(playerid));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- strmid(playerinfo[targetclick[playerid]][pPassword], inputtext, 0, strlen(inputtext), 255);
- SaveUser(targetclick[playerid]);
- }
- if(dialogid == DIALOG_ADMMONEYEDIT)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de dar %d de dinheiro para %s!", strval(inputtext), GetName(targetclick[playerid]));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s te deu %d de dinheiro!", GetName(playerid), strval(inputtext));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pMoney] += strval(inputtext);
- new money = strval(inputtext);
- GivePlayerMoney(playerid, money);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][DINHEIRO] O Administrador %s editou o DINHEIRO de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_ADMBANKEDIT)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de dar %d de dinheiro para %s (Banco)!", strval(inputtext), GetName(targetclick[playerid]));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s te deu %d de dinheiro (Banco)!", GetName(playerid), strval(inputtext));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pBank] += strval(inputtext);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][BANCO] O Administrador %s editou o BANCO de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_ADMEDITSKIN)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de setar a skin de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s setou sua skin para %d!", GetName(playerid), strval(inputtext));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pSkin] = strval(inputtext);
- new skin = strval(inputtext);
- SetPlayerSkin(targetclick[playerid], skin);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][SKIN] O Administrador %s editou a SKIN de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_ADMEDITGROUP)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de setar a faction de %d para %s!", strval(inputtext), GetName(targetclick[playerid]));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s setou sua faction para %d!", GetName(playerid), strval(inputtext));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pFaction] = strval(inputtext);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][FACTION] O Administrador %s editou a FACTION de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_ADMEDITRANK)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de setar o rank(faction) de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s setou seu rank(faction) para %d!", GetName(playerid), strval(inputtext));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pRank] = strval(inputtext);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][RANK] O Administrador %s editou o RANK de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_ADMEDITTESTER)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de dar Tester nível %d para %s!", strval(inputtext), GetName(targetclick[playerid]));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s te deu Tester nível %d. Parabéns!", GetName(playerid), strval(inputtext));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pTester] += strval(inputtext);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][TESTER] O Administrador %s editou o TESTER de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_ADMEDITDONATE)
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");
- format(string, sizeof(string), "Você acaba de setar o nível de donate de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
- SendClientMessage(playerid, COLOR_SUCESS, string);
- format(string, sizeof(string), "O Administrador %s setou o seu nível de donate para %d!", GetName(playerid), strval(inputtext));
- SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
- playerinfo[targetclick[playerid]][pDonate] += strval(inputtext);
- SaveUser(targetclick[playerid]);
- format(string, sizeof(string), "[%s] [Editar][DONATE] O Administrador %s editou o DONATE de %s para %d", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), strval(inputtext));
- Log("AdminCMD.log", string);
- }
- if(dialogid == DIALOG_AJUDA)
- {
- if(!response) return 1;
- if(listitem == 0) //Comandos Gerais
- {
- SendClientMessage(playerid, COLOR_NEUTRAL2, " [Comandos Gerais]");
- SendClientMessage(playerid, COLOR_SOS, "/sos | /reportar | /mascara | /casa | /empresa | /v | /stats | /comprar | /ligar | /desligar");
- SendClientMessage(playerid, COLOR_SOS, "/depositar | /sacar | /extrato");
- }
- if(listitem == 1) //Comandos Veiculares
- {
- SendClientMessage(playerid, COLOR_NEUTRAL2, " [Comandos Veiculares]");
- SendClientMessage(playerid, COLOR_SOS, "/v | /na | /na | /na | /na | /na | /na | /na | /na | /na");
- }
- if(listitem == 2) //Comandos de Factions
- {
- if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não está em uma faction]");
- SendClientMessage(playerid, COLOR_NEUTRAL2, " [Comandos de Faction]");
- new faction = playerinfo[playerid][pFaction];
- if(factioninfo[faction-1][fType] == 1 || factioninfo[faction-1][fType] == 2 || factioninfo[faction-1][fType] == 3)
- {
- SendClientMessage(playerid, COLOR_SOS, "/f | /d | /r | /membros | /revistar | /algemar | /desalgemar | /na | /na | /na");
- }
- else
- {
- SendClientMessage(playerid, COLOR_SOS, "/f | /membros | /na | /na | /na | /na | /na | /na | /na | /na");
- }
- }
- if(listitem == 3) //Comandos de Líderes
- {
- if(playerinfo[playerid][pRank] != 10) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é líder de nenhuma faction]");
- SendClientMessage(playerid, COLOR_NEUTRAL2, " [Comandos de Líderes]");
- SendClientMessage(playerid, COLOR_SOS, "/convidar | /promover | /rebaixar | /nomerank | /na | /na | /na | /na | /na | /na");
- }
- if(listitem == 4) //Comandos de Donaters
- {
- if(playerinfo[playerid][pDonate] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é um Donater]");
- SendClientMessage(playerid, COLOR_NEUTRAL2, " [Comandos de Donaters]");
- SendClientMessage(playerid, COLOR_SOS, "/togpm | /blockpm | /na | /na | /na | /na | /na | /na | /na | /na");
- }
- if(listitem == 5) //Comandos de Tester
- {
- if(playerinfo[playerid][pTester] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é um Tester]");
- SendClientMessage(playerid, COLOR_NEUTRAL2, " [Comandos de Tester]");
- SendClientMessage(playerid, COLOR_SOS, "[1] /tduty | /ah | /rh | /checarsos | /na | /na | /na | /na | /na | /na");
- }
- if(listitem == 6) //Comandos de Administradores
- {
- if(playerinfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é um Adminstrador]");
- SendClientMessage(playerid, COLOR_NEUTRAL2, " [Comandos de Administradores]");
- if(playerinfo[playerid][pAdmin] >= 1)
- {
- SendClientMessage(playerid, COLOR_SOS, "[1] /ooc | /aduty | /mascarados | /ar | /rr | /checarreports | /ajail | /kick | /ban | /tapa");
- SendClientMessage(playerid, COLOR_SOS, "[1] /ir | /spec | /darlider | /ircarro | /na | /na | /na | /na | /na | /na");
- }
- if(playerinfo[playerid][pAdmin] >= 2)
- {
- SendClientMessage(playerid, COLOR_SOS, "[2] Comandos admin 2 ficarão aqui");
- }
- if(playerinfo[playerid][pAdmin] >= 3)
- {
- SendClientMessage(playerid, COLOR_SOS, "[3] Comandos admin 3 ficarão aqui");
- }
- if(playerinfo[playerid][pAdmin] >= 4)
- {
- SendClientMessage(playerid, COLOR_SOS, "[4] Comandos admin 4 ficarão aqui");
- }
- if(playerinfo[playerid][pAdmin] >= 5)
- {
- SendClientMessage(playerid, COLOR_SOS, "[5] Comandos admin 5 ficarão aqui");
- }
- if(playerinfo[playerid][pAdmin] >= 6)
- {
- SendClientMessage(playerid, COLOR_SOS, "[6] Comandos admin 6 ficarão aqui");
- }
- if(playerinfo[playerid][pAdmin] >= 1337)
- {
- SendClientMessage(playerid, COLOR_SOS, "[1337] Comandos admin 1337 ficarão aqui");
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- if(playerinfo[playerid][pAdmin] > 0)
- {
- targetclick[playerid] = clickedplayerid;
- if(clickedplayerid == playerid) return 1;
- ShowPlayerDialog(playerid, DIALOG_ADMACTIONS, DIALOG_STYLE_LIST, GetName(clickedplayerid), "Spec\nIr\nKick\nBan\nAjail\nTapa\nEditar", "Confirmar", "Cancelar");
- return 1;
- }
- return 1;
- }
- stock getDateEx(){
- new
- a,b,c,d,e,f, stringx[128];
- gettime(a,b,c);
- getdate(d,e,f);
- format(stringx, 128, "%i/%i/%i | %i:%i:%i", f,e,d,a,b,c);
- return stringx;
- }
- stock IsNumeric(const strings[])
- {
- for (new i = 0, j = strlen(strings); i < j; i++)
- {
- if (strings[i] > '9' || strings[i] < '0') return 0;
- }
- return 1;
- }
- stock Dealerships(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 145.8890,-1834.8905,2.0585))
- {
- SendClientMessage(playerid, COLOR_SOS, "Dinghy (473, $17500), Reefer (453, $22000), Tropic (454, $20000), Squallo (446, $275000) ");
- }
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 1702.9060,-1469.3427,13.5469))
- {
- SendClientMessage(playerid, COLOR_NEUTRAL2, "|____________ CONCESSIONARIA 01 ____________|");
- SendClientMessage(playerid, -1, "/v comprar [id] | Nome (ID, $Preço)");
- SendClientMessage(playerid, COLOR_SOS, "Landstalker (400, $40000), Bravura (401, $16000), Buffalo (402, $46000), Perinniel (404, $12000) ");
- SendClientMessage(playerid, COLOR_SOS, "Sentinel (405, $32000), Limosine (409, $110000), Manana (410, $9000), Infernus (411, $500000) ");
- SendClientMessage(playerid, COLOR_SOS, "Voodoo (412, $23000), Cheetah (415, $475000), Moonbeam (418, $10000), Esperanto (419, $18000) ");
- SendClientMessage(playerid, COLOR_SOS, "Washington (421, $36000), Bobcat (422, $14000), Premier (426, $40000), Banshee (429, $57000) ");
- SendClientMessage(playerid, COLOR_SOS, "Previon (436, $11000), Stallion (439, $17000), Admiral (445, $31500), Turismo (451, $625000) ");
- SendClientMessage(playerid, COLOR_SOS, "Solair (458, $13500), PCJ-600 (461, $50000), Fagio (462, $7000), Freeway (463, $13000) ");
- SendClientMessage(playerid, COLOR_SOS, "Glendale (466, $19500), Oceanic (467, $22500), Sanchez (468, $37500), Hermes (474, $16200) ");
- SendClientMessage(playerid, COLOR_SOS, "Sabre (475, $24500), ZR-350 (477, $125000), Regina (479, $12000), Comet (480, $72000) ");
- SendClientMessage(playerid, COLOR_SOS, "BMX (481, $4500), Burrito (482, $20500), Camper (483, $19500), Rancher (489, $25999) ");
- SendClientMessage(playerid, COLOR_SOS, "Virgo (491, $28000), Greenwood (492, $25000), Blista Compact (496, $19000), Mesa (500, $22500) ");
- SendClientMessage(playerid, COLOR_SOS, "Super GT (506, $700000), Elegant (507, $34000), Bike (509, $4500), Nebula (516, $16200) ");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 411.9653,-1729.3180,9.3693))
- {
- SendClientMessage(playerid, COLOR_NEUTRAL2, "|____________ CONCESSIONARIA 02 ____________|");
- SendClientMessage(playerid, -1, "/v comprar [id] | Nome (ID, $Preço)");
- SendClientMessage(playerid, COLOR_SOS, "Majestic (517, $20000), Buccaneer (518, $24000), FRC-900 (521, $80000), Fortune (526, $14000) ");
- SendClientMessage(playerid, COLOR_SOS, "Cadrona (527, $14000), Willard (529, $14500), Feltzer (533, $50000), Remington (534, $27000) ");
- SendClientMessage(playerid, COLOR_SOS, "Slamvan (535, $36000), Blade (536, $24000), Vincent (540, $29000), Bullet (541, $550000) ");
- SendClientMessage(playerid, COLOR_SOS, "Clover (542, $17500), Sadler (543, $13500), Hustler (545, $34500), Intruder (546, $15000) ");
- SendClientMessage(playerid, COLOR_SOS, "Primo (547, $18000), Tampa (549, $17500), Sunrise (550, $50000), Merit (551, $42000) ");
- SendClientMessage(playerid, COLOR_SOS, "Yosemite (554, $27000), Windsor (555, $60000), Uranus (558, $56000), Jester (559, $66000) ");
- SendClientMessage(playerid, COLOR_SOS, "Sultan (560, $375000), Stratum (561, $50000), Elegy (562, $105000), Flash (565, $48000) ");
- SendClientMessage(playerid, COLOR_SOS, "Tahoma (566, $27000), Savanna (567, $28000), Broadway (575, $23000), Tornado (576, $17500) ");
- SendClientMessage(playerid, COLOR_SOS, "Huntley (579, $40000), Stafford (580, $41500), Emperror (585, $15000), Wayfarer (586, $11000) ");
- SendClientMessage(playerid, COLOR_SOS, "Euros (587, $20000), Club (589, $16000), Picador (600, $13500), Alpha (602, $34000) ");
- SendClientMessage(playerid, COLOR_SOS, "Phoenix (603, $43000) Pony(413, 20000), Yankee(456, 22000), Benson(499, 35000), Mule(414, 40000) Faggio(462, 7000)");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement