Advertisement
Guest User

Untitled

a guest
Dec 14th, 2012
1,549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 308.49 KB | None | 0 0
  1. #include <a_samp>
  2. #include <victor>
  3. #include <a_mysql>
  4. #include <streamer>
  5. #include <zcmd>
  6. #include <sscanf2>
  7. /*
  8.  
  9.  
  10.                              _   _ _      _               ______                               _
  11.                             | | | (_)    | |             |  ___|                              (_)
  12.                             | | | |_  ___| |_ ___  _ __  | |_ ___ _ __ _ __ __ _ _ __ ___  ___ _
  13.                             | | | | |/ __| __/ _ \| '__| |  _/ _ \ '__| '__/ _` | '__/ _ \/ __| |
  14.                             \ \_/ / | (__| || (_) | |    | ||  __/ |  | | | (_| | | |  __/\__ \ |
  15.                              \___/|_|\___|\__\___/|_|    \_| \___|_|  |_|  \__,_|_|  \___||___/_|
  16.  
  17.  
  18.  
  19.                               ___    _   __   ___         _   _           _
  20.                              / _ \  | | / /  / _ \       | | | |         | |
  21.                             / /_\ \ | |/ /  / /_\ \      | |_| | __ _ ___| |__
  22.                             |  _  | |    \  |  _  |      |  _  |/ _` / __| '_ \
  23.                             | | | |_| |\  \_| | | |      | | | | (_| \__ \ | | |
  24.                             \_| |_(_)_| \_(_)_| |_/      \_| |_/\__,_|___/_| |_|
  25.  
  26.                             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.
  27.                             Antes que perguntem, SIM, existem sistemas incompletos como o de armas: Ele funciona perfeitamente, mas vocês deverão adicionar as armas à gosto.
  28.                             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.
  29.                             O Sistema de veículos precisa de alguns toques finais como criar uma tunadora para modificar o veículo e fazer edições à gosto.
  30.                             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.
  31.                             Estou dando release por vontade própria, então, desconsidero críticas e reclamações, afinal, não estou cobrando ninguém por nada ;)
  32.                             Cheers.
  33.  
  34.  
  35.  
  36. */
  37.  
  38. /*
  39.     Faction Types: 1 = Police    
  40.                    2 = Medical                  
  41.                    3 = Governamental                  
  42.                    4 = Gang                  
  43.                    5 = Máfia                  
  44.                    6 = Motorcycle Club                  
  45.                    7 = Facção Legal Independente                    
  46.  
  47.     Jail Types:   1 = Los Santos Prison    
  48.                   2 = Department Jail                  
  49.                   3 = Admin Jail (Ajail)                  
  50.  
  51.     Bizzes Types: 0 = Null Biz    
  52.                   1 = 24/7                  
  53.                   2 = Bar                  
  54.                   3 = Club                        
  55.                   4 = Weapon House
  56. */
  57.  
  58.  
  59. main()
  60. {
  61.     print("\n**********************************************************");
  62.     print("* ______________________________________________________ *");
  63.     print("*   ==========Scarlett (Roleplay) Gamemode============   *");
  64.     print("* Owner/Scripter: Victor Ferraresi (Viiih / Hash)        *");
  65.     print("* This gamemode has been written from ZERO lines         *");
  66.     print("* Nothing is pasted from the web or another gamemodes    *");
  67.     print("* So, be careful with my credits. Cheers.                *");
  68.     print("* ______________________________________________________ *");
  69.     print("**********************************************************\n");
  70.     DisableInteriorEnterExits();
  71. }
  72.  
  73. public OnGameModeInit()
  74. {
  75.     SetGameModeText(SCRIPT_VERSION);
  76.     format(string, sizeof(string), "hostname %s", SERVER_NAME);  
  77.     SendRconCommand(string);
  78.     format(string, sizeof(string), "weburl %s", WEBSITE_URL);
  79.     SendRconCommand(string);
  80.     format(string, sizeof(string), "mapname %s", MAP_NAME);
  81.     SendRconCommand(string);
  82.     ShowPlayerMarkers(0);    
  83.     AddPlayerClass(0,1683.3234,-2286.5359,-1.2353,83.2267,0,0,0,0,0,0);
  84.          
  85.     MYSQLConnection = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);    
  86.     LoadHouses();          
  87.     LoadFactions();        
  88.     LoadBizzes();      
  89.     LoadVehicles();        
  90.     LoadWeaponData();    
  91.     SaveWeaponData();
  92.     TimerSegundos = SetTimer("TimerSeconds", 1000, true);    
  93.     r@TimerSegundos = SetTimer("r@TimerSeconds", 1000, true);    
  94.     TimerUpdate = SetTimer("UpdatePlayerEx", 100, true);          
  95.     TimerPayday = SetTimer("PaydayTimer", 5000, true);
  96.     TimerMinutos = SetTimer("TimerMinutes", 300000, true);    
  97.     gettime(ghour, gminute, gsecond);    
  98.     return 1;
  99. }
  100.  
  101. stock GetVehicleParameters(vehicleid, paramid)
  102. {
  103.         new engine,lights,alarm,doors,bonnet,boot,objective;
  104.         GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  105.         switch(paramid) {
  106.             case 0: {
  107.                 if(engine == 1) return 0x01;
  108.                 return 0;
  109.             }
  110.             case 1:
  111.             {
  112.                 if(lights == 1) return 0x01;
  113.                 return 0;
  114.             }
  115.             case 2:
  116.             {
  117.                 if(alarm == 1) return 0x01;
  118.                 return 0;
  119.             }
  120.             case 3:
  121.             {
  122.                 if(doors == 1) return 0x01;
  123.                 return 0;
  124.             }
  125.             case 4:
  126.             {
  127.                 if(bonnet == 1) return 0x01;
  128.                 return 0;
  129.             }
  130.             case 5:
  131.             {
  132.                 if(boot == 1) return 0x01;
  133.                 return 0;
  134.             }
  135.             case 6:
  136.             {
  137.                 if(objective == 1) return 0x01;
  138.                 return 0;
  139.             }
  140.         }
  141.         return 0;
  142. }
  143.  
  144. stock GetName(playerid)
  145. {
  146.     new name[MAX_PLAYER_NAME];
  147.     GetPlayerName(playerid, name, sizeof(name));
  148.     for(new i = 0; i < MAX_PLAYER_NAME; i++)
  149.     {
  150.         if (name[i] == '_') name[i] = ' ';
  151.     }
  152.     return name;
  153. }
  154.  
  155. stock GetRankName(playerid)
  156. {
  157.     new faction = playerinfo[playerid][pFaction];        
  158.     new rankname[128];
  159.     if(playerinfo[playerid][pRank] == 1)    
  160.     {    
  161.         strmid(rankname, factioninfo[faction-1][fRank1], 0, sizeof(rankname), 255);
  162.     }    
  163.     if(playerinfo[playerid][pRank] == 2)    
  164.     {    
  165.         strmid(rankname, factioninfo[faction-1][fRank2], 0, sizeof(rankname), 255);
  166.     }    
  167.     if(playerinfo[playerid][pRank] == 3)    
  168.     {    
  169.         strmid(rankname, factioninfo[faction-1][fRank3], 0, sizeof(rankname), 255);
  170.     }    
  171.     if(playerinfo[playerid][pRank] == 4)    
  172.     {    
  173.         strmid(rankname, factioninfo[faction-1][fRank4], 0, sizeof(rankname), 255);
  174.     }    
  175.     if(playerinfo[playerid][pRank] == 5)    
  176.     {    
  177.         strmid(rankname, factioninfo[faction-1][fRank5], 0, sizeof(rankname), 255);
  178.     }    
  179.     if(playerinfo[playerid][pRank] == 6)    
  180.     {    
  181.         strmid(rankname, factioninfo[faction-1][fRank6], 0, sizeof(rankname), 255);
  182.     }    
  183.     if(playerinfo[playerid][pRank] == 7)    
  184.     {    
  185.         strmid(rankname, factioninfo[faction-1][fRank7], 0, sizeof(rankname), 255);
  186.     }    
  187.     if(playerinfo[playerid][pRank] == 8)    
  188.     {    
  189.         strmid(rankname, factioninfo[faction-1][fRank8], 0, sizeof(rankname), 255);
  190.     }    
  191.     if(playerinfo[playerid][pRank] == 9)    
  192.     {    
  193.         strmid(rankname, factioninfo[faction-1][fRank9], 0, sizeof(rankname), 255);
  194.     }    
  195.     if(playerinfo[playerid][pRank] == 10)    
  196.     {    
  197.         strmid(rankname, factioninfo[faction-1][fRank10], 0, sizeof(rankname), 255);
  198.     }        
  199.     return rankname;
  200. }
  201.  
  202. stock GetMaskID(playerid)
  203. {
  204.     new MaskID[128];    
  205.     format(MaskID, sizeof(MaskID), "[Desconhecido %s]", playerinfo[playerid][pMaskID]);    
  206.     return MaskID;
  207. }
  208.  
  209. stock param_cutleft(str[])
  210. {
  211.         new len = strlen(str),
  212.                 index = -1;
  213.                
  214.         if(!len)
  215.                 return 0;
  216.                
  217.         new
  218.                 ignorespaces = 1;
  219.                
  220.         while(++index < len)
  221.         {
  222.                 if(str[index] == ' ')
  223.                 {
  224.                         if(ignorespaces)
  225.                                 continue;
  226.                                
  227.                         strdel(str, 0, index + 1);
  228.                         return 1;
  229.                 }
  230.                 else
  231.                         if(ignorespaces)
  232.                                 ignorespaces = 0;
  233.         }
  234.         str[0] = 0;
  235.         return 1;
  236. }
  237.  
  238. stock GetInsurancePrice(vehmodel, insurances)
  239. {
  240.     if(vehmodel == 400) return 100 * insurances;        
  241.     else if(vehmodel == 401) return 100 * insurances;
  242.     else if(vehmodel == 402) return 100 * insurances;
  243.     else if(vehmodel == 403) return 100 * insurances;
  244.     else if(vehmodel == 404) return 100 * insurances;
  245.     else if(vehmodel == 405) return 100 * insurances;
  246.     else if(vehmodel == 406) return 100 * insurances;
  247.     else if(vehmodel == 407) return 100 * insurances;
  248.     else if(vehmodel == 408) return 100 * insurances;
  249.     else if(vehmodel == 409) return 100 * insurances;
  250.     else if(vehmodel == 410) return 100 * insurances;
  251.     else if(vehmodel == 411) return 100 * insurances;
  252.     else if(vehmodel == 412) return 100 * insurances;
  253.     else if(vehmodel == 413) return 100 * insurances;
  254.     else if(vehmodel == 414) return 100 * insurances;
  255.     else if(vehmodel == 415) return 100 * insurances;
  256.     else if(vehmodel == 417) return 100 * insurances;
  257.     else if(vehmodel == 418) return 100 * insurances;
  258.     else if(vehmodel == 419) return 100 * insurances;
  259.     else if(vehmodel == 420) return 100 * insurances;
  260.     else if(vehmodel == 421) return 100 * insurances;
  261.     else if(vehmodel == 422) return 100 * insurances;
  262.     else if(vehmodel == 423) return 100 * insurances;
  263.     else if(vehmodel == 424) return 100 * insurances;
  264.     else if(vehmodel == 426) return 100 * insurances;
  265.     else if(vehmodel == 428) return 100 * insurances;
  266.     else if(vehmodel == 429) return 100 * insurances;
  267.     else if(vehmodel == 434) return 100 * insurances;
  268.     else if(vehmodel == 436) return 100 * insurances;
  269.     else if(vehmodel == 439) return 100 * insurances;
  270.     else if(vehmodel == 443) return 100 * insurances;
  271.     else if(vehmodel == 444) return 100 * insurances;
  272.     else if(vehmodel == 445) return 100 * insurances;
  273.     else if(vehmodel == 446) return 100 * insurances;
  274.     else if(vehmodel == 451) return 100 * insurances;
  275.     else if(vehmodel == 452) return 100 * insurances;
  276.     else if(vehmodel == 453) return 100 * insurances;
  277.     else if(vehmodel == 454) return 100 * insurances;
  278.     else if(vehmodel == 455) return 100 * insurances;
  279.     else if(vehmodel == 456) return 100 * insurances;
  280.     else if(vehmodel == 457) return 100 * insurances;
  281.     else if(vehmodel == 458) return 100 * insurances;
  282.     else if(vehmodel == 459) return 100 * insurances;
  283.     else if(vehmodel == 460) return 100 * insurances;
  284.     else if(vehmodel == 461) return 100 * insurances;
  285.     else if(vehmodel == 462) return 100 * insurances;
  286.     else if(vehmodel == 463) return 100 * insurances;
  287.     else if(vehmodel == 466) return 100 * insurances;
  288.     else if(vehmodel == 467) return 100 * insurances;
  289.     else if(vehmodel == 468) return 100 * insurances;
  290.     else if(vehmodel == 469) return 100 * insurances;
  291.     else if(vehmodel == 471) return 100 * insurances;
  292.     else if(vehmodel == 473) return 100 * insurances;
  293.     else if(vehmodel == 474) return 100 * insurances;
  294.     else if(vehmodel == 475) return 100 * insurances;
  295.     else if(vehmodel == 477) return 100 * insurances;
  296.     else if(vehmodel == 478) return 100 * insurances;
  297.     else if(vehmodel == 479) return 100 * insurances;
  298.     else if(vehmodel == 480) return 100 * insurances;
  299.     else if(vehmodel == 481) return 100 * insurances;
  300.     else if(vehmodel == 482) return 100 * insurances;
  301.     else if(vehmodel == 483) return 100 * insurances;
  302.     else if(vehmodel == 484) return 100 * insurances;
  303.     else if(vehmodel == 485) return 100 * insurances;
  304.     else if(vehmodel == 486) return 100 * insurances;
  305.     else if(vehmodel == 487) return 100 * insurances;
  306.     else if(vehmodel == 489) return 100 * insurances;
  307.     else if(vehmodel == 491) return 100 * insurances;
  308.     else if(vehmodel == 492) return 100 * insurances;
  309.     else if(vehmodel == 493) return 100 * insurances;
  310.     else if(vehmodel == 494) return 100 * insurances;
  311.     else if(vehmodel == 495) return 100 * insurances;
  312.     else if(vehmodel == 496) return 100 * insurances;
  313.     else if(vehmodel == 498) return 100 * insurances;
  314.     else if(vehmodel == 499) return 100 * insurances;
  315.     else if(vehmodel == 500) return 100 * insurances;
  316.     else if(vehmodel == 502) return 100 * insurances;
  317.     else if(vehmodel == 503) return 100 * insurances;
  318.     else if(vehmodel == 504) return 100 * insurances;
  319.     else if(vehmodel == 505) return 100 * insurances;
  320.     else if(vehmodel == 506) return 100 * insurances;
  321.     else if(vehmodel == 507) return 100 * insurances;
  322.     else if(vehmodel == 508) return 100 * insurances;
  323.     else if(vehmodel == 509) return 100 * insurances;
  324.     else if(vehmodel == 510) return 100 * insurances;
  325.     else if(vehmodel == 511) return 100 * insurances;
  326.     else if(vehmodel == 512) return 100 * insurances;
  327.     else if(vehmodel == 513) return 100 * insurances;
  328.     else if(vehmodel == 514) return 100 * insurances;
  329.     else if(vehmodel == 515) return 100 * insurances;
  330.     else if(vehmodel == 516) return 100 * insurances;
  331.     else if(vehmodel == 517) return 100 * insurances;
  332.     else if(vehmodel == 518) return 100 * insurances;
  333.     else if(vehmodel == 519) return 100 * insurances;
  334.     else if(vehmodel == 521) return 100 * insurances;
  335.     else if(vehmodel == 522) return 100 * insurances;
  336.     else if(vehmodel == 524) return 100 * insurances;
  337.     else if(vehmodel == 525) return 100 * insurances;
  338.     else if(vehmodel == 526) return 100 * insurances;
  339.     else if(vehmodel == 527) return 100 * insurances;
  340.     else if(vehmodel == 529) return 100 * insurances;
  341.     else if(vehmodel == 530) return 100 * insurances;
  342.     else if(vehmodel == 531) return 100 * insurances;
  343.     else if(vehmodel == 532) return 100 * insurances;
  344.     else if(vehmodel == 533) return 100 * insurances;
  345.     else if(vehmodel == 534) return 100 * insurances;
  346.     else if(vehmodel == 535) return 100 * insurances;
  347.     else if(vehmodel == 536) return 100 * insurances;
  348.     else if(vehmodel == 539) return 100 * insurances;
  349.     else if(vehmodel == 540) return 100 * insurances;
  350.     else if(vehmodel == 541) return 100 * insurances;
  351.     else if(vehmodel == 542) return 100 * insurances;
  352.     else if(vehmodel == 543) return 100 * insurances;
  353.     else if(vehmodel == 544) return 100 * insurances;
  354.     else if(vehmodel == 545) return 100 * insurances;
  355.     else if(vehmodel == 546) return 100 * insurances;
  356.     else if(vehmodel == 547) return 100 * insurances;
  357.     else if(vehmodel == 549) return 100 * insurances;
  358.     else if(vehmodel == 550) return 100 * insurances;
  359.     else if(vehmodel == 551) return 100 * insurances;
  360.     else if(vehmodel == 552) return 100 * insurances;
  361.     else if(vehmodel == 553) return 100 * insurances;
  362.     else if(vehmodel == 554) return 100 * insurances;
  363.     else if(vehmodel == 555) return 100 * insurances;
  364.     else if(vehmodel == 556) return 100 * insurances;
  365.     else if(vehmodel == 557) return 100 * insurances;
  366.     else if(vehmodel == 558) return 100 * insurances;
  367.     else if(vehmodel == 559) return 100 * insurances;
  368.     else if(vehmodel == 560) return 100 * insurances;
  369.     else if(vehmodel == 561) return 100 * insurances;
  370.     else if(vehmodel == 562) return 100 * insurances;
  371.     else if(vehmodel == 563) return 100 * insurances;
  372.     else if(vehmodel == 565) return 100 * insurances;
  373.     else if(vehmodel == 566) return 100 * insurances;
  374.     else if(vehmodel == 567) return 100 * insurances;
  375.     else if(vehmodel == 568) return 100 * insurances;
  376.     else if(vehmodel == 571) return 100 * insurances;
  377.     else if(vehmodel == 572) return 100 * insurances;
  378.     else if(vehmodel == 573) return 100 * insurances;
  379.     else if(vehmodel == 575) return 100 * insurances;
  380.     else if(vehmodel == 576) return 100 * insurances;
  381.     else if(vehmodel == 578) return 100 * insurances;
  382.     else if(vehmodel == 579) return 100 * insurances;
  383.     else if(vehmodel == 580) return 100 * insurances;
  384.     else if(vehmodel == 581) return 100 * insurances;
  385.     else if(vehmodel == 583) return 100 * insurances;
  386.     else if(vehmodel == 585) return 100 * insurances;
  387.     else if(vehmodel == 586) return 100 * insurances;
  388.     else if(vehmodel == 587) return 100 * insurances;
  389.     else if(vehmodel == 588) return 100 * insurances;
  390.     else if(vehmodel == 589) return 100 * insurances;
  391.     else if(vehmodel == 592) return 100 * insurances;
  392.     else if(vehmodel == 593) return 100 * insurances;
  393.     else if(vehmodel == 600) return 100 * insurances;
  394.     else if(vehmodel == 602) return 100 * insurances;
  395.     else if(vehmodel == 603) return 100 * insurances;
  396.     else if(vehmodel == 609) return 100 * insurances;
  397.     return 0;
  398. }
  399.  
  400. stock DealershipPrice(model)
  401. {
  402.     if(model == 400) return 40000;
  403.     else if(model == 401) return 16000;
  404.     else if(model == 402) return 46000;
  405.     else if(model == 403) return 25000;
  406.     else if(model == 404) return 12000;
  407.     else if(model == 405) return 32000;
  408.     else if(model == 406) return 200000;
  409.     else if(model == 407) return 50000;
  410.     else if(model == 408) return 80000;
  411.     else if(model == 409) return 110000;
  412.     else if(model == 410) return 9000;
  413.     else if(model == 411) return 500000;
  414.     else if(model == 412) return 23000;
  415.     else if(model == 413) return 20000;
  416.     else if(model == 414) return 45000;
  417.     else if(model == 415) return 475000;
  418.     else if(model == 417) return 250000;
  419.     else if(model == 418) return 10000;
  420.     else if(model == 419) return 18000;
  421.     else if(model == 420) return 12000;
  422.     else if(model == 421) return 36000;
  423.     else if(model == 422) return 14000;
  424.     else if(model == 423) return 25000;
  425.     else if(model == 424) return 85000;
  426.     else if(model == 426) return 40000;
  427.     else if(model == 428) return 40000;
  428.     else if(model == 429) return 57000;
  429.     else if(model == 434) return 49000;
  430.     else if(model == 436) return 11000;
  431.     else if(model == 439) return 17000;
  432.     else if(model == 443) return 100000;
  433.     else if(model == 444) return 175000;
  434.     else if(model == 445) return 31500;
  435.     else if(model == 446) return 275000;
  436.     else if(model == 451) return 625000;
  437.     else if(model == 452) return 175000;
  438.     else if(model == 453) return 22000;
  439.     else if(model == 454) return 20000;
  440.     else if(model == 455) return 80000;
  441.     else if(model == 456) return 22000;
  442.     else if(model == 457) return 10000;
  443.     else if(model == 458) return 13500;
  444.     else if(model == 459) return 21000;
  445.     else if(model == 460) return 215000;
  446.     else if(model == 461) return 50000;
  447.     else if(model == 462) return 7000;
  448.     else if(model == 463) return 13000;
  449.     else if(model == 466) return 19500;
  450.     else if(model == 467) return 22500;
  451.     else if(model == 468) return 37500;
  452.     else if(model == 469) return 175000;
  453.     else if(model == 471) return 15000;
  454.     else if(model == 473) return 30000;
  455.     else if(model == 474) return 16200;
  456.     else if(model == 475) return 24500;
  457.     else if(model == 477) return 125000;
  458.     else if(model == 478) return 17500;
  459.     else if(model == 479) return 12000;
  460.     else if(model == 480) return 72000;
  461.     else if(model == 481) return 4500;
  462.     else if(model == 482) return 20500;
  463.     else if(model == 483) return 19500;
  464.     else if(model == 484) return 50000;
  465.     else if(model == 485) return 30000;
  466.     else if(model == 486) return 150000;
  467.     else if(model == 487) return 200000;
  468.     else if(model == 489) return 25999;
  469.     else if(model == 491) return 28000;
  470.     else if(model == 492) return 25000;
  471.     else if(model == 493) return 60000;
  472.     else if(model == 494) return 100000;
  473.     else if(model == 495) return 90000;
  474.     else if(model == 496) return 19000;
  475.     else if(model == 498) return 50000;
  476.     else if(model == 499) return 45000;
  477.     else if(model == 500) return 22500;
  478.     else if(model == 502) return 100000;
  479.     else if(model == 503) return 100000;
  480.     else if(model == 504) return 100000;
  481.     else if(model == 505) return 75000;
  482.     else if(model == 506) return 700000;
  483.     else if(model == 507) return 34000;
  484.     else if(model == 508) return 50000;
  485.     else if(model == 509) return 4500;
  486.     else if(model == 510) return 10000;
  487.     else if(model == 511) return 215000;
  488.     else if(model == 512) return 200000;
  489.     else if(model == 513) return 220000;
  490.     else if(model == 514) return 35000;
  491.     else if(model == 515) return 40000;
  492.     else if(model == 516) return 16200;
  493.     else if(model == 517) return 20000;
  494.     else if(model == 518) return 24000;
  495.     else if(model == 519) return 300000;
  496.     else if(model == 521) return 80000;
  497.     else if(model == 522) return 100000;
  498.     else if(model == 524) return 80000;
  499.     else if(model == 525) return 12000;
  500.     else if(model == 526) return 14000;
  501.     else if(model == 527) return 14000;
  502.     else if(model == 529) return 14500;
  503.     else if(model == 530) return 90000;
  504.     else if(model == 531) return 40000;
  505.     else if(model == 532) return 200000;
  506.     else if(model == 533) return 50000;
  507.     else if(model == 534) return 27000;
  508.     else if(model == 535) return 36000;
  509.     else if(model == 536) return 24000;
  510.     else if(model == 539) return 150000;
  511.     else if(model == 540) return 29000;
  512.     else if(model == 541) return 550000;
  513.     else if(model == 542) return 17500;
  514.     else if(model == 543) return 13500;
  515.     else if(model == 544) return 50000;
  516.     else if(model == 545) return 34500;
  517.     else if(model == 546) return 15000;
  518.     else if(model == 547) return 18000;
  519.     else if(model == 549) return 17500;
  520.     else if(model == 550) return 50000;
  521.     else if(model == 551) return 42000;
  522.     else if(model == 552) return 30000;
  523.     else if(model == 553) return 250000;
  524.     else if(model == 554) return 27000;
  525.     else if(model == 555) return 60000;
  526.     else if(model == 556) return 200000;
  527.     else if(model == 557) return 200000;
  528.     else if(model == 558) return 56000;
  529.     else if(model == 559) return 66000;
  530.     else if(model == 560) return 375000;
  531.     else if(model == 561) return 50000;
  532.     else if(model == 562) return 105000;
  533.     else if(model == 563) return 50000;
  534.     else if(model == 565) return 48000;
  535.     else if(model == 566) return 27000;
  536.     else if(model == 567) return 28000;
  537.     else if(model == 568) return 50000;
  538.     else if(model == 571) return 85000;
  539.     else if(model == 572) return 15000;
  540.     else if(model == 573) return 90000;
  541.     else if(model == 575) return 23000;
  542.     else if(model == 576) return 17500;
  543.     else if(model == 578) return 90000;
  544.     else if(model == 579) return 40000;
  545.     else if(model == 580) return 41500;
  546.     else if(model == 581) return 40000;
  547.     else if(model == 583) return 25000;
  548.     else if(model == 585) return 15000;
  549.     else if(model == 586) return 11000;
  550.     else if(model == 587) return 20000;
  551.     else if(model == 588) return 36000;
  552.     else if(model == 589) return 16000;
  553.     else if(model == 592) return 350000;
  554.     else if(model == 593) return 225000;
  555.     else if(model == 600) return 13500;
  556.     else if(model == 602) return 34000;
  557.     else if(model == 603) return 43000;
  558.     else if(model == 609) return 62000;
  559.     return 0;
  560. }
  561.  
  562. stock DealershipValid(id, dealerid)
  563. {
  564.     if(dealerid == 1)
  565.     {
  566.         switch(id) {
  567.             case 400, 401, 402, 404 , 405, 409, 410, 411, 412, 415, 418,
  568.             419, 421, 422, 426, 429, 436, 439, 445, 451, 461, 463, 458, 466, 467, 468, 474, 475,
  569.             477, 479, 480, 481, 482, 483, 489, 491, 492, 496, 500, 506, 507,
  570.             509, 516: return 1;
  571.         }
  572.     }
  573.     if(dealerid == 2)
  574.     {
  575.         switch(id)
  576.         {
  577.             case 517, 518, 521, 526, 527, 529, 533, 534, 535,
  578.                  536, 540, 541, 542, 543, 545, 546, 547, 549, 550,
  579.                  551, 554, 555, 558, 559, 560, 561, 562, 565, 566,
  580.                  567, 575, 576, 579, 580, 585, 586, 587, 589, 600,
  581.                  602, 603,413,456,498,499,414,525, 420, 462: return 1;
  582.         }
  583.     }
  584.     if(dealerid == 3)
  585.     {
  586.         switch(id)
  587.         {
  588.             case 473, 453, 454, 446, 499: return 1;
  589.         }
  590.     }
  591.     return 0;
  592. }
  593.  
  594. stock GetBizType(bizid)
  595. {
  596.     new typename[24];
  597.     switch(bizid) {
  598.         case 0: format(typename, sizeof(typename), "NULL");
  599.         case 1: format(typename, sizeof(typename), "24/7");
  600.         case 2: format(typename, sizeof(typename), "Bar");
  601.         case 3: format(typename, sizeof(typename), "Club");
  602.         case 4: format(typename, sizeof(typename), "Weapon House");
  603.         case 5: format(typename, sizeof(typename), "Clothes");
  604.         case 6: format(typename, sizeof(typename), "Donut");
  605.         case 7: format(typename, sizeof(typename), "Bar");
  606.         case 8: format(typename, sizeof(typename), "Sex Shop");
  607.         case 9: format(typename, sizeof(typename), "WeapMake");
  608.         case 10: format(typename, sizeof(typename), "DrugMake");
  609.         case 11: format(typename, sizeof(typename), "Complex");
  610.         case 12: format(typename, sizeof(typename), "Club");
  611.     }
  612.     return typename;
  613. }
  614.  
  615. stock timec(timestamp, compare = -1) {
  616.     if (compare == -1) {
  617.         compare = gettime();
  618.     }
  619.     new
  620.         n,
  621.         Float:d = (timestamp > compare) ? timestamp - compare : compare - timestamp,
  622.         returnstr[32];
  623.     if (d < 60) {
  624.         format(returnstr, sizeof(returnstr), "< 1 minuto");
  625.         return returnstr;
  626.     } else if (d < 3600) { // 3600 = 1 hour
  627.         n = floatround(floatdiv(d, 60.0), floatround_floor);
  628.         format(returnstr, sizeof(returnstr), "minuto");
  629.     } else if (d < 86400) { // 86400 = 1 day
  630.         n = floatround(floatdiv(d, 3600.0), floatround_floor);
  631.         format(returnstr, sizeof(returnstr), "hora");
  632.     } else if (d < 2592000) { // 2592000 = 1 month
  633.         n = floatround(floatdiv(d, 86400.0), floatround_floor);
  634.         format(returnstr, sizeof(returnstr), "dia");
  635.     } else if (d < 31536000) { // 31536000 = 1 year
  636.         n = floatround(floatdiv(d, 2592000.0), floatround_floor);
  637.         format(returnstr, sizeof(returnstr), "mês");
  638.     } else {
  639.         n = floatround(floatdiv(d, 31536000.0), floatround_floor);
  640.         format(returnstr, sizeof(returnstr), "ano");
  641.     }
  642.     if (n == 1) {
  643.         format(returnstr, sizeof(returnstr), "1 %s", returnstr);
  644.     } else {
  645.         format(returnstr, sizeof(returnstr), "%d %ss", n, returnstr);
  646.     }
  647.     return returnstr;
  648. }
  649.  
  650. stock GetRespect(level)
  651. {
  652.     new nextlevel = level+1;    
  653.     new expamount = nextlevel*levelexp;    
  654.     return expamount;
  655. }
  656.  
  657. public OnGameModeExit()
  658. {
  659.     SaveHouses();      
  660.     SaveFactions();        
  661.     SaveWeaponData();
  662.     for(new i = 0; i < MAX_PLAYERS; i++)
  663.     {        
  664.         if(playerinfo[i][pLogado] == 1)
  665.         {                            
  666.             SaveUser(i);            
  667.         }
  668.     }    
  669.     KillTimer(TimerSegundos);
  670.     KillTimer(r@TimerSegundos);
  671.     KillTimer(TimerUpdate);
  672.     KillTimer(TimerPayday);
  673.     KillTimer(TimerMinutos);
  674.     mysql_close(MYSQLConnection);
  675.     return 1;
  676. }
  677.  
  678. public OnPlayerRequestClass(playerid, classid)
  679. {
  680.     return 0;
  681. }
  682.  
  683. public OnPlayerConnect(playerid)
  684. {
  685.     format(query, sizeof(query), "SELECT * FROM `playerinfo` WHERE `Name` = '%s' AND `Accepted` = '1' LIMIT 1", GetName(playerid));    
  686.     mysql_function_query(MYSQLConnection, query, true, "CheckAccount", "d", playerid);            
  687.  
  688.     MaskText[playerid] = Create3DTextLabel(" ", 0xD8D8D8AA, 30.0,40.0,50.0,15.0,0);
  689.     SetPlayerColor(playerid, -1);    
  690.     return 1;
  691. }
  692.  
  693. function:RemovePlayerWeapon(playerid, weaponid)
  694. {
  695.     new plyWeapons[12] = 0;
  696.     new plyAmmo[12] = 0;
  697.     for(new slot = 0; slot != 12; slot++)
  698.     {
  699.         new wep, ammo;
  700.         GetPlayerWeaponData(playerid, slot, wep, ammo);
  701.  
  702.         if(wep != weaponid && ammo != 0)
  703.         {
  704.             GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
  705.         }
  706.     }
  707.  
  708.     ResetPlayerWeapons(playerid);    
  709.     for(new slot = 0; slot != 12; slot++)
  710.     {
  711.         if(plyAmmo[slot] != 0)
  712.         {
  713.             GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
  714.         }
  715.     }
  716.     return 0x01;
  717. }
  718.  
  719.  
  720. function:PaydayTimer()
  721. {
  722.     new tmphour;
  723.     new tmpminute;
  724.     new tmpsecond;
  725.     gettime(tmphour, tmpminute, tmpsecond);
  726.     if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
  727.     {
  728.         format(string, sizeof(string), "* [Horário] São %d:00 horas",tmphour);
  729.         SendClientMessageToAll(COLOR_SOS, string);
  730.         ghour = tmphour;
  731.         Payday();
  732.         new hour, minute, second;
  733.         gettime(hour, minute, second);
  734.     }
  735. }
  736.  
  737. function:Payday()
  738. {
  739.     for(new i = 0; i <= MAX_PLAYERS; i++)
  740.     {
  741.         if(IsPlayerConnected(i) && playerinfo[i][pLogado] == 1)
  742.         {
  743.             new cash = 50;
  744.             switch(playerinfo[i][pJob])
  745.             {
  746.                 //To be done
  747.             }
  748.             switch(playerinfo[i][pRank])
  749.             {
  750.                 case 0 .. 10: cash = (cash + playerinfo[i][pRank]*50);
  751.             }
  752.             new vipgold;
  753.             vipgold = (playerinfo[i][pDonate] == 1 ? 50 : playerinfo[i][pDonate] == 2 ? 100 : playerinfo[i][pDonate] == 3 ? 200 : playerinfo[i][pDonate] == 4 ? 325 : 0);
  754.             SendClientMessage(i, COLOR_SOS, "_______________________[Payday]_______________________");
  755.             format(string, 128, "Pagamento diário: $%d ", cash);
  756.             SendClientMessage(i, -1, string);
  757.             format(string, 128, "Saldo antigo: $%d", playerinfo[i][pBank]);
  758.             SendClientMessage(i, -1, string);
  759.             playerinfo[i][pBank] = playerinfo[i][pBank]+cash;
  760.             playerinfo[i][pBank] = playerinfo[i][pBank]+vipgold;
  761.  
  762.             format(string, 128, "Novo saldo: $%d", playerinfo[i][pBank]);
  763.             SendClientMessage(i, -1, string);
  764.             GameTextForAll("Payday", 3000, 1);
  765.             SendClientMessage(i, COLOR_SOS, "-------------------------------------------------");
  766.             playerinfo[i][pRespeitos] ++ ;
  767.             playerinfo[i][pPlayingTime] = 0;
  768.             SaveUser(i);
  769.         }
  770.     }
  771.     return 1;
  772. }
  773.  
  774. function:ShowStats(playerid, targetid)
  775. {
  776.     new string1[512];                                                                          
  777.     new cash = playerinfo[playerid][pMoney];    
  778.     new account = playerinfo[playerid][pBank];    
  779.     new level = playerinfo[playerid][pLevel];    
  780.     new exp = playerinfo[playerid][pRespeitos];                                                                                                                                  
  781.     new cellphone = playerinfo[playerid][pCellphone];
  782.     new expamount = GetRespect(playerinfo[playerid][pLevel]);
  783.     format(string, sizeof(string), "          [%s]          ", GetName(playerid));        
  784.     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);        
  785.     SendClientMessage(targetid, COLOR_SOS, string);  
  786.     SendClientMessage(targetid, COLOR_SOS, string1);      
  787.     return 1;
  788. }
  789.  
  790. function:FriskPlayer(playerid, targetid)
  791. {
  792.     new ammo[12],weapon[12], name[50];
  793.     for(new i = 0; i < 12; i++)
  794.     {
  795.         GetPlayerWeaponData(targetid, i+1, weapon[i], ammo[i]);
  796.     }  
  797.     format(string, sizeof(string), "Corpo de %s", GetName(targetid));    
  798.     SendClientMessage(playerid, COLOR_NEUTRAL2, string);
  799.     if(weapon[1] == 22)    
  800.     {    
  801.         if(playerinfo[targetid][pPistolType] == 4)
  802.         {
  803.             strmid(name, weapondata[3][wName], 0, 128, 255);            
  804.             format(string, sizeof(string), "%s (%d)", name, ammo[1]);            
  805.             SendClientMessage(playerid, COLOR_SOS, string);
  806.         }
  807.         if(playerinfo[targetid][pPistolType] == 5)
  808.         {
  809.             strmid(name, weapondata[4][wName], 0, 128, 255);            
  810.             format(string, sizeof(string), "%s (%d)", name, ammo[1]);            
  811.             SendClientMessage(playerid, COLOR_SOS, string);
  812.         }          
  813.     }    
  814.     if(weapon[1] == 24)    
  815.     {    
  816.         if(playerinfo[targetid][pPistolType] == 1)
  817.         {
  818.             strmid(name, weapondata[0][wName], 0, 128, 255);              
  819.             format(string, sizeof(string), "%s (%d)", name, ammo[1]);            
  820.             SendClientMessage(playerid, COLOR_SOS, string);
  821.         }
  822.         if(playerinfo[targetid][pPistolType] == 2)
  823.         {
  824.             strmid(name, weapondata[1][wName], 0, 128, 255);                
  825.             format(string, sizeof(string), "%s (%d)", name, ammo[1]);            
  826.             SendClientMessage(playerid, COLOR_SOS, string);
  827.         }
  828.         if(playerinfo[targetid][pPistolType] == 3)
  829.         {
  830.             strmid(name, weapondata[2][wName], 0, 128, 255);                
  831.             format(string, sizeof(string), "%s (%d)", name, ammo[1]);            
  832.             SendClientMessage(playerid, COLOR_SOS, string);
  833.         }    
  834.     }
  835.     if(weapon[4] == 31)    
  836.     {    
  837.         if(playerinfo[targetid][pRifleType] == 1)
  838.         {
  839.             strmid(name, weapondata[5][wName], 0, 128, 255);              
  840.             format(string, sizeof(string), "%s (%d)", name, ammo[4]);            
  841.             SendClientMessage(playerid, COLOR_SOS, string);
  842.         }
  843.     }
  844.     if(weapon[3] == 29)    
  845.     {    
  846.         if(playerinfo[targetid][pSubType] == 1)
  847.         {
  848.             strmid(name, weapondata[6][wName], 0, 128, 255);              
  849.             format(string, sizeof(string), "%s (%d)", name, ammo[3]);            
  850.             SendClientMessage(playerid, COLOR_SOS, string);
  851.         }                                  
  852.     }  
  853.     return 1;
  854. }
  855.  
  856. function:TimerSeconds()
  857. {
  858.     for(new i = 0; i < MAX_PLAYERS; ++i)
  859.     {
  860.         for(new a = 0; a < MAX_HOUSES; a++)
  861.         {
  862.             if(IsPlayerInRangeOfPoint(i, 2.0, houseinfo[a][hEntranceX], houseinfo[a][hEntranceY], houseinfo[a][hEntranceZ]) && houseinfo[a][hOwned] == 1)
  863.             {                  
  864.                 new houseid = a;
  865.                 if(HouseMarker[i] == 0)
  866.                 {                                                                    
  867.                     DisablePlayerCheckpoint(i);
  868.                     if(!IsPlayerInRangeOfPoint(i, 2.0, houseinfo[houseid][hEntranceX], houseinfo[houseid][hEntranceY], houseinfo[houseid][hEntranceZ]))                    
  869.                     {                    
  870.                         HouseMarked[i] = 9999;                        
  871.                     }
  872.                     if(HouseMarked[i] == a) return 1;                    
  873.                     format(string, sizeof(string), "Nº %d Dono: %s.", a, houseinfo[a][hOwner]);
  874.                     SendClientMessage(i, COLOR_NEUTRAL, string);
  875.                     format(string, sizeof(string), "Os comandos são /entrar, /casa alugar.");
  876.                     SendClientMessage(i, COLOR_NEUTRAL2, string);              
  877.                     SetPlayerCheckpoint(i, houseinfo[houseid][hEntranceX], houseinfo[houseid][hEntranceY], houseinfo[houseid][hEntranceZ], 1.0);
  878.                     HouseMarker[i] = 2;            
  879.                     HouseMarked[i] = a;
  880.                 }
  881.             }
  882.         }
  883.         if(playerinfo[i][pRinging] == 1)
  884.         {          
  885.             if(RingingTime[i] == 0)            
  886.             {
  887.                 format(string, sizeof(string), "* O celular de %s está tocando.", GetName(i));            
  888.                 ProxDetector(20.0, i, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);                
  889.                 RingingTime[i] = 5;
  890.             }  
  891.         }
  892.         if(playerinfo[i][pCameraInterpol] == 1)
  893.         {
  894.             InterpolateCameraPos(i, 0.0, 0.0, 0.0, 1958, 1343, 15, 3000, 1);
  895.             playerinfo[i][pCameraInterpol] ++;
  896.         }
  897.         if(playerinfo[i][pCameraInterpol] >= 2)
  898.         {
  899.             playerinfo[i][pCameraInterpol] ++;
  900.         }
  901.         if(playerinfo[i][pCameraInterpol] == 7)
  902.         {
  903.             InterpolateCameraPos(i, 1958, 1343, 15, 500, 500, 500, 3000, 2);
  904.         }
  905.         if(playerinfo[i][pCameraInterpol] == 12)
  906.         {
  907.             InterpolateCameraPos(i, 500, 500, 500, 400, 400, 400, 3000,2);
  908.             playerinfo[i][pCameraInterpol] = 1;
  909.         }
  910.         if(playerinfo[i][pCameraInterpol] == 17)
  911.         {
  912.             InterpolateCameraPos(i, 400, 400, 400, 0, 0, 0, 3000,2);
  913.             playerinfo[i][pCameraInterpol] = 1;
  914.         }      
  915.     }
  916.     return 1;
  917. }
  918.  
  919. function:r@TimerSeconds()
  920. {
  921.     for( new i = 0; i < MAX_PLAYERS; i++)    
  922.     {                                
  923.         if(HouseMarker[i] > 0)
  924.         {              
  925.             HouseMarker[i]--;            
  926.         }          
  927.         if(RingingTime[i] > 0)        
  928.         {        
  929.             RingingTime[i]--;
  930.         }
  931.         if(playerinfo[i][pLogado] == 1)        
  932.         {        
  933.             playerinfo[i][pPlayingTime] ++;
  934.         }        
  935.         if(playerinfo[i][pJailTime] > 0)        
  936.         {        
  937.             playerinfo[i][pJailTime] --;                    
  938.             if(playerinfo[i][pJailTime] == 0)        
  939.             {        
  940.                 playerinfo[i][pJailed] = 0;
  941.                 SetPlayerPos(i, 1515.6228,-1673.2925,14.0469);
  942.                 SetPlayerVirtualWorld(i, 0);
  943.                 SetPlayerInterior(i, 0);
  944.                 SetPlayerFacingAngle(i, 87.9105);                
  945.                 playerinfo[i][pJailType] = 0;
  946.                 SaveUser(i);
  947.             }
  948.         }
  949.         if(TowingCar[i] > 0)
  950.         {
  951.             TowingCar[i] --;                                  
  952.             format(string, sizeof(string), "Aguarde %d segundos para o carro ser rebocado", TowingCar[i]);
  953.             GameTextForPlayer(i, string, 1000, 5);            
  954.             if(TowingCar[i] == 0)            
  955.             {            
  956.                 SetVehicleToRespawn(TowedCar[i]);
  957.                 SetVehiclePos(TowedCar[i], vehicleinfo[TowedCar[i]][vParkPos1], vehicleinfo[TowedCar[i]][vParkPos2], vehicleinfo[TowedCar[i]][vParkPos3]);
  958.                 SetVehicleZAngle(TowedCar[i], vehicleinfo[TowedCar[i]][vParkPos4]);
  959.                 TowedCar[i] = 0;                                            
  960.                 playerinfo[i][pMoney] -= 1000;                
  961.                 GivePlayerMoney(i, -1000);
  962.             }
  963.         }                                      
  964.     }      
  965.     return 1;
  966. }
  967.  
  968. function:UpdatePlayerEx(playerid)
  969. {
  970.     for(new i = 0; i < MAX_PLAYERS; i++)  
  971.     {
  972.         if(playerinfo[i][pLogado] == 1)
  973.         {
  974.             if(playerinfo[playerid][pMascarado] == 0)
  975.             {
  976.                 ShowPlayerNameTagForPlayer(i,playerid,1);
  977.             }
  978.             else
  979.             {
  980.                 Attach3DTextLabelToPlayer(MaskText[playerid], playerid, 0,0,0);
  981.                 ShowPlayerNameTagForPlayer(i,playerid,0);
  982.             }
  983.         }      
  984.     }
  985.     return 1;
  986. }
  987.  
  988. function:TimerMinutes()
  989. {
  990.     for(new i = 0; i < MAX_PLAYERS; i++)
  991.     {
  992.         if(playerinfo[i][pLogado] == 1 && playerinfo[i][pAdmin] < 1)
  993.         {
  994.             if(playerinfo[i][pJailType] != 3)
  995.             {
  996.                 GetPlayerPos(i, playerinfo[i][pPlayerPos][0], playerinfo[i][pPlayerPos][1], playerinfo[i][pPlayerPos][2]);
  997.                 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])
  998.                 {
  999.                     format(string, sizeof(string), "AdmCmd: Você foi kickado automaticamente por ficar AFK!", GetName(i));
  1000.                     SendClientMessage(i,COLOR_BAN,string);
  1001.                     Kick(i);
  1002.                 }
  1003.                 playerinfo[i][pPlayerPos][3] = playerinfo[i][pPlayerPos][0];
  1004.                 playerinfo[i][pPlayerPos][4] = playerinfo[i][pPlayerPos][1];
  1005.                 playerinfo[i][pPlayerPos][5] = playerinfo[i][pPlayerPos][2];
  1006.                 Idle[i] = 0;
  1007.             }
  1008.         }
  1009.     }
  1010.     return 1;
  1011. }
  1012.  
  1013. function:Log(const File[], lstr[])
  1014. {
  1015.     if(!fexist(File))
  1016.     {
  1017.         new File:Arquivo = fopen(File, io_write);
  1018.         fclose(Arquivo);
  1019.     }
  1020.     new cells[300];
  1021.     new a, m, d, h, mi, s;
  1022.     getdate(a, m, d);
  1023.     gettime(h,mi,s);
  1024.     format(cells, sizeof(cells), "%s\r\n", lstr);
  1025.     new File:Arquivo = fopen(File, io_append);
  1026.     fwrite(Arquivo, cells);
  1027.     fclose(Arquivo);
  1028.     return 1;
  1029. }
  1030.  
  1031. function:CheckAccount(playerid)
  1032. {
  1033.     new rows, fields;    
  1034.     cache_get_data(rows, fields);    
  1035.     if(!rows)
  1036.     {
  1037.          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");        
  1038.          return Kick(playerid);        
  1039.     }                                      
  1040.     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Scarlett Roleplay (Login)", "Digite sua senha abaixo para logar-se!", "Login", "Logout");
  1041.     playerinfo[playerid][pCameraInterpol] = 1;
  1042.     return 1;      
  1043. }
  1044.  
  1045. function:Login(playerid, password[])
  1046. {
  1047.     format(query, sizeof(query), "SELECT * FROM `playerinfo` WHERE `Name` = '%s' AND `Password` = md5('%s')", GetName(playerid), password);
  1048.     mysql_function_query(MYSQLConnection, query, true, "r@Login", "ds[24]", playerid, GetName(playerid));
  1049.     return 1;    
  1050. }
  1051.  
  1052. function:r@Login(playerid, name[32])
  1053. {
  1054.     new rows, fields;
  1055.     cache_get_data(rows, fields);    
  1056.     if(!rows)    
  1057.     {                              
  1058.         if(Tentatives[playerid] == 2)
  1059.         {                                
  1060.             Tentatives[playerid] = 0;
  1061.             return Kick(playerid);
  1062.         }
  1063.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Scarlett Roleplay (Login)", "Senha Incorreta! Digite sua senha abaixo para logar-se!", "Login", "Logout");        
  1064.         Tentatives[playerid] ++;
  1065.     }    
  1066.     else    
  1067.     {          
  1068.         CleanChat(playerid);
  1069.         SendClientMessage(playerid, 0x97CBFFAA, "------------------------------------------------");
  1070.         SendClientMessage(playerid, 0xE8E8E8AA, "Programadores: Victor Ferraresi");
  1071.         SendClientMessage(playerid, 0xE8E8E8AA, "Versão: 1.4.5 Alpha");
  1072.         SendClientMessage(playerid, 0xE8E8E8AA, "Site: NONE");
  1073.         SendClientMessage(playerid, 0x97CBFFAA, "------------------------------------------------");
  1074.         SendClientMessage(playerid, 0xE8E8E8AA, "[SC-RP]: É sempre um prazer ter você de volta !");
  1075.        
  1076.         new IP[24];
  1077.         GetPlayerIp(playerid, IP, 24);
  1078.         format(string, sizeof(string), "[%s] %s - %s", getDateEx(), GetName(playerid), IP);
  1079.         Log("Logins.log", string);
  1080.         playerinfo[playerid][pLogado] = 1;      
  1081.  
  1082.         new valor[128];        
  1083.         cache_get_field_content(0, "Name", playerinfo[playerid][pName], MYSQLConnection);        
  1084.         cache_get_field_content(0, "Password", playerinfo[playerid][pPassword], MYSQLConnection);
  1085.         cache_get_field_content(0, "Level", valor, MYSQLConnection);
  1086.         playerinfo[playerid][pLevel] = strval(valor);
  1087.         cache_get_field_content(0, "Money", valor, MYSQLConnection);
  1088.         playerinfo[playerid][pMoney] = strval(valor);
  1089.         cache_get_field_content(0, "Bank", valor, MYSQLConnection);
  1090.         playerinfo[playerid][pBank] = strval(valor);
  1091.         cache_get_field_content(0, "Skin", valor, MYSQLConnection);
  1092.         playerinfo[playerid][pSkin] = strval(valor);
  1093.         cache_get_field_content(0, "SpawnType", valor, MYSQLConnection);
  1094.         playerinfo[playerid][pSpawnType] = strval(valor);
  1095.         cache_get_field_content(0, "Faction", valor, MYSQLConnection);
  1096.         playerinfo[playerid][pFaction] = strval(valor);
  1097.         cache_get_field_content(0, "Rank", valor, MYSQLConnection);
  1098.         playerinfo[playerid][pRank] = strval(valor);
  1099.         cache_get_field_content(0, "Ferido", valor, MYSQLConnection);
  1100.         playerinfo[playerid][pFerido] = strval(valor);
  1101.         cache_get_field_content(0, "MaskID", playerinfo[playerid][pMaskID], MYSQLConnection);
  1102.         cache_get_field_content(0, "Admin", valor, MYSQLConnection);
  1103.         playerinfo[playerid][pAdmin] = strval(valor);        
  1104.         cache_get_field_content(0, "Tester", valor, MYSQLConnection);
  1105.         playerinfo[playerid][pTester] = strval(valor);
  1106.         cache_get_field_content(0, "Casa1", valor, MYSQLConnection);
  1107.         playerinfo[playerid][pCasa1] = strval(valor);  
  1108.         cache_get_field_content(0, "Casa2", valor, MYSQLConnection);
  1109.         playerinfo[playerid][pCasa2] = strval(valor);
  1110.         cache_get_field_content(0, "JailTime", valor, MYSQLConnection);
  1111.         playerinfo[playerid][pJailTime] = strval(valor);
  1112.         cache_get_field_content(0, "JailType", valor, MYSQLConnection);
  1113.         playerinfo[playerid][pJailType] = strval(valor);
  1114.         cache_get_field_content(0, "Jailed", valor, MYSQLConnection);
  1115.         playerinfo[playerid][pJailed] = strval(valor);
  1116.         cache_get_field_content(0, "Mask", valor, MYSQLConnection);
  1117.         playerinfo[playerid][pMask] = strval(valor);
  1118.         cache_get_field_content(0, "Donate", valor, MYSQLConnection);
  1119.         playerinfo[playerid][pDonate] = strval(valor);
  1120.         cache_get_field_content(0, "Biz", valor, MYSQLConnection);
  1121.         playerinfo[playerid][pEmpresa] = strval(valor);
  1122.         cache_get_field_content(0, "PlayingTime", valor, MYSQLConnection);
  1123.         playerinfo[playerid][pPlayingTime] = strval(valor);  
  1124.         cache_get_field_content(0, "DonatorExpire", valor, MYSQLConnection);
  1125.         playerinfo[playerid][pDonatorExpire] = strval(valor);
  1126.         cache_get_field_content(0, "Respeito", valor, MYSQLConnection);
  1127.         playerinfo[playerid][pRespeitos] = strval(valor);                
  1128.         cache_get_field_content(0, "PistolType", valor, MYSQLConnection);
  1129.         playerinfo[playerid][pPistolType] = strval(valor);                      
  1130.         cache_get_field_content(0, "RifleType", valor, MYSQLConnection);
  1131.         playerinfo[playerid][pRifleType] = strval(valor);                
  1132.         cache_get_field_content(0, "SubType", valor, MYSQLConnection);
  1133.         playerinfo[playerid][pSubType] = strval(valor);          
  1134.         cache_get_field_content(0, "Cellphone", valor, MYSQLConnection);
  1135.         playerinfo[playerid][pCellphone] = strval(valor);          
  1136.         cache_get_field_content(0, "Tutorial", valor, MYSQLConnection);
  1137.         playerinfo[playerid][pTutorial] = strval(valor);
  1138.        
  1139.         if(playerinfo[playerid][pDonatorExpire] > 0)
  1140.         {
  1141.             if(playerinfo[playerid][pDonatorExpire] < gettime())            
  1142.             {
  1143.                 SendClientMessage(playerid, COLOR_SOS, " O seu tempo de Donate expirou! Obrigado por doar para o Scarlett Roleplay. ");
  1144.                 playerinfo[playerid][pDonatorExpire] = 0;
  1145.                 playerinfo[playerid][pDonate] = 0;
  1146.             }
  1147.             else
  1148.             {
  1149.                 new expiresin = playerinfo[playerid][pDonatorExpire];
  1150.                 new iRandomTime = (expiresin-gettime())+gettime();
  1151.                 format(string, sizeof(string), "O seu Donate irá expirar em %s", timec(iRandomTime));
  1152.                 SendClientMessage(playerid, COLOR_SOS, string);
  1153.             }
  1154.         }                
  1155.  
  1156.  
  1157.         playerinfo[playerid][pBlockUser] = -1;          
  1158.         playerinfo[playerid][pPmAllowed] = -1;
  1159.         playerinfo[playerid][pTesterDuty] = 0;
  1160.         playerinfo[playerid][pAdminDuty] = 0;
  1161.         playerinfo[playerid][pMascarado] = 0;          
  1162.         SetPlayerColor(playerid, -1);
  1163.         if(playerinfo[playerid][pDonate] < 1)
  1164.         {
  1165.             playerinfo[playerid][pMask] = 0;            
  1166.         }  
  1167.         SetSpawnInfo(playerid, 1, 264, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0);      
  1168.         SpawnPlayer(playerid);              
  1169.         GivePlayerMoney(playerid, playerinfo[playerid][pMoney]);            
  1170.         SetPlayerScore(playerid, playerinfo[playerid][pLevel]);        
  1171.         SetPlayerSkin(playerid, playerinfo[playerid][pSkin]);  
  1172.         SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
  1173.        
  1174.         LoadPlayerDrugs(playerid);    
  1175.            
  1176.         if(playerinfo[playerid][pSpawnType] == 0) //Normal        
  1177.         {        
  1178.             SetPlayerPos(playerid, 1036.9316, -1850.9518, 13.5703);     //Spawn Civil
  1179.             return 1;                        
  1180.         }                                                                          
  1181.         if(playerinfo[playerid][pSpawnType] == 1) //Casa 1      
  1182.         {    
  1183.             new id;
  1184.             id = playerinfo[playerid][pCasa1];
  1185.             SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);  
  1186.             return 1;                                                          
  1187.         }
  1188.         if(playerinfo[playerid][pSpawnType] == 2) //Casa 2      
  1189.         {            
  1190.             new id;
  1191.             id = playerinfo[playerid][pCasa2];    
  1192.             SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);                
  1193.             return 1;
  1194.         }            
  1195.         if(playerinfo[playerid][pSpawnType] == 3) //Faction
  1196.         {  
  1197.             new id;    
  1198.             id = strval(playerinfo[playerid][pFaction]);                              
  1199.             SetPlayerPos(playerid, factioninfo[id][fSpawnX], factioninfo[id][fSpawnY], factioninfo[id][fSpawnZ]);  
  1200.             return 1;          
  1201.         }
  1202.         if(playerinfo[playerid][pJailed] == 1)
  1203.         {
  1204.             if(playerinfo[playerid][pJailType] == 1) //County Jail            
  1205.             {            
  1206.                 SetPlayerPos(playerid, 30, 30, 30);        
  1207.                 SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");  
  1208.                 return 1;        
  1209.             }            
  1210.             if(playerinfo[playerid][pJailType] == 2) //LSP            
  1211.             {            
  1212.                 SetPlayerPos(playerid, 7, 7, 7);
  1213.                 SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");
  1214.                 return 1;              
  1215.             }            
  1216.             if(playerinfo[playerid][pJailType] == 3) //AJAIL            
  1217.             {                                            
  1218.                 SetPlayerInterior(playerid, 5);
  1219.                 SetPlayerPos(playerid, 322.197998, 302.497985, 999.148437);      
  1220.                 SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena (OOCly)");    
  1221.                 return 1;              
  1222.             }              
  1223.         }
  1224.         if(playerinfo[playerid][pTutorial] == 0)
  1225.         {        
  1226.             new number = 111111 + random(999999);
  1227.             playerinfo[playerid][pCellphone] = number;
  1228.             playerinfo[playerid][pTutorial] = 1;          
  1229.         }                                          
  1230.     }  
  1231.     return 1;
  1232. }
  1233.  
  1234. function:CleanChat(playerid)
  1235. {
  1236.     for(new i = 0; i < 100; i++)    
  1237.     {    
  1238.         SendClientMessage(playerid, -1, "");        
  1239.     }                
  1240.     return 1;
  1241. }
  1242.  
  1243.  
  1244. function:IsPlayerNearPlayer(Float:radi, playerid, targetid)
  1245. {
  1246.     if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
  1247.     {
  1248.         new Float:posx, Float:posy, Float:posz;
  1249.         new Float:oldposx, Float:oldposy, Float:oldposz;
  1250.         new Float:tempposx, Float:tempposy, Float:tempposz;
  1251.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1252.         GetPlayerPos(targetid, posx, posy, posz);
  1253.         tempposx = (oldposx -posx);
  1254.         tempposy = (oldposy -posy);
  1255.         tempposz = (oldposz -posz);
  1256.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1257.         {
  1258.             if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid))
  1259.             {
  1260.                 return 1;
  1261.             }
  1262.         }
  1263.     }
  1264.     return 0;
  1265. }
  1266.  
  1267. function:ProxDetector(Float:radi, playerid, strings[],col1,col2,col3,col4,col5)
  1268. {
  1269.     if(IsPlayerConnected(playerid))
  1270.     {
  1271.         new Float:posx, Float:posy, Float:posz;
  1272.         new Float:oldposx, Float:oldposy, Float:oldposz;
  1273.         new Float:tempposx, Float:tempposy, Float:tempposz;
  1274.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1275.         for(new i = 0; i < MAX_PLAYERS; i++)
  1276.         {
  1277.             if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  1278.             {
  1279.                 GetPlayerPos(i, posx, posy, posz);
  1280.                 tempposx = (oldposx -posx);
  1281.                 tempposy = (oldposy -posy);
  1282.                 tempposz = (oldposz -posz);
  1283.                 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
  1284.                 {
  1285.                     SendClientMessage(i, col1, strings);
  1286.                 }
  1287.                 else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
  1288.                 {
  1289.                     SendClientMessage(i, col2, strings);
  1290.                 }
  1291.                 else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
  1292.                 {
  1293.                     SendClientMessage(i, col3, strings);
  1294.                 }
  1295.                 else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
  1296.                 {
  1297.                     SendClientMessage(i, col4, strings);
  1298.                 }
  1299.                 else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
  1300.                 {
  1301.                     SendClientMessage(i, col5, strings);
  1302.                 }
  1303.             }
  1304.             else
  1305.             {
  1306.                 SendClientMessage(i, col1, string);
  1307.             }
  1308.         }
  1309.     }
  1310.     return 1;
  1311. }
  1312.  
  1313. function:ProxDetectorAction(Float:radi, playerid, message[],col1,col2,col3,col4,col5)
  1314. {
  1315.     if(!IsPlayerConnected(playerid)) return 1;
  1316.     new Float:posx, Float:posy, Float:posz;
  1317.     new Float:oldposx, Float:oldposy, Float:oldposz;
  1318.     new Float:tempposx, Float:tempposy, Float:tempposz;
  1319.     GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1320.     for(new i = 0; i <= MAX_PLAYERS; ++i) {
  1321.         if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))) {
  1322.             GetPlayerPos(i, posx, posy, posz);
  1323.             tempposx = (oldposx -posx);
  1324.             tempposy = (oldposy -posy);
  1325.             tempposz = (oldposz -posz);
  1326.             if (((tempposx < radi/15) && (tempposx > -radi/15)) && ((tempposy < radi/16) && (tempposy > -radi/17)) && ((tempposz < radi/18) && (tempposz > -radi/18)))
  1327.             {
  1328.                 LongAction(i,col1,message);
  1329.             }
  1330.             else if (((tempposx < radi/6) && (tempposx > -radi/6)) && ((tempposy < radi/6) && (tempposy > -radi/6)) && ((tempposz < radi/6) && (tempposz > -radi/6)))
  1331.             {
  1332.                 LongAction(i, col2, message);
  1333.             }
  1334.             else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  1335.             {
  1336.                 LongAction(i, col3, message);
  1337.             }
  1338.             else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  1339.             {
  1340.                 LongAction(i, col4, message);
  1341.             }
  1342.             else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1343.             {
  1344.                 LongAction(i, col5, message);
  1345.             }
  1346.         }
  1347.     }
  1348.     return 1;
  1349. }
  1350.  
  1351. function:LongAction(playerid, color, const strings[])
  1352. {
  1353.     if(strlen(string) > 90)
  1354.     {
  1355.         new
  1356.             string1[210], string2[210], string3[210];
  1357.         format(string1, sizeof(string1), strings);
  1358.         format(string2, sizeof(string2), strings);
  1359.         strdel(string1, 90, 256);
  1360.         strdel(string2, 0, 90);
  1361.         format(string3, sizeof(string3), "%s ...", string1);
  1362.         SendClientMessage(playerid,color, string3);
  1363.         format(string3, sizeof(string3), "... %s", string2);
  1364.         SendClientMessage(playerid,color, string3);
  1365.         return true;
  1366.     }
  1367.     else {
  1368.         SendClientMessage(playerid,color, strings);
  1369.         return true;
  1370.     }
  1371. }
  1372.  
  1373. function:LongMessage(playerid, color, const strings[])
  1374. {
  1375.     if(strlen(string) > 90)
  1376.     {
  1377.         new
  1378.             string1[210], string2[210], string3[210];
  1379.         format(string1, sizeof(string1), strings);
  1380.         format(string2, sizeof(string2), strings);
  1381.         strdel(string1, 90, 256);
  1382.         strdel(string2, 0, 90);
  1383.         format(string3, sizeof(string3), "%s ...", string1);
  1384.         SendClientMessage(playerid,color, string3);
  1385.         format(string3, sizeof(string3), "... %s", string2);
  1386.         SendClientMessage(playerid,color, string3);
  1387.         return true;
  1388.     }
  1389.     else {
  1390.         SendClientMessage(playerid,color, strings);
  1391.         return true;
  1392.     }
  1393. }
  1394.  
  1395. function:SaveUser(playerid)
  1396. {
  1397.     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', \
  1398.    MaskID = '%d', Admin = '%d', Tester = '%d', Casa1 = '%d', Casa2 = '%d', JailTime = '%d', JailType = '%d', Jailed = '%d', Mask = '%d', Donate = '%d', Biz = '%d',\
  1399.    PlayingTime = '%d', Job = '%d', DonatorExpire = '%d', Respeito = '%d', Cellphone = '%d', Tutorial = '%d' WHERE `Name` = '%s'",
  1400.     playerinfo[playerid][pName], playerinfo[playerid][pPassword], playerinfo[playerid][pLevel], playerinfo[playerid][pMoney], playerinfo[playerid][pBank], playerinfo[playerid][pSkin],
  1401.     playerinfo[playerid][pSpawnType], playerinfo[playerid][pFaction], playerinfo[playerid][pRank], playerinfo[playerid][pFerido], playerinfo[playerid][pMaskID], playerinfo[playerid][pAdmin],
  1402.     playerinfo[playerid][pTester], playerinfo[playerid][pCasa1], playerinfo[playerid][pCasa2], playerinfo[playerid][pJailTime], playerinfo[playerid][pJailType], playerinfo[playerid][pJailed],
  1403.     playerinfo[playerid][pMask], playerinfo[playerid][pDonate], playerinfo[playerid][pEmpresa], playerinfo[playerid][pPlayingTime], playerinfo[playerid][pJob], playerinfo[playerid][pDonatorExpire],
  1404.     playerinfo[playerid][pRespeitos], playerinfo[playerid][pCellphone], playerinfo[playerid][pTutorial], GetName(playerid));
  1405.     mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", playerid);        
  1406.    
  1407.     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],
  1408.     GetName(playerid));    
  1409.     mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", playerid);
  1410.  
  1411.     format(query, sizeof(query), "UPDATE `druginfo` SET \
  1412.    `Cocaina` = '%d', `Crack` = '%d', `Heroina` = '%d', `Cachimbo` = '%d', `LSD` = '%d', \
  1413.    `Maconha` = '%d', `Haxixe` = '%d', `Agulhas` = '%d' \
  1414.    WHERE `Name` = '%s'",
  1415.     druginfo[playerid][pCocaina],druginfo[playerid][pCrack],druginfo[playerid][pHeroina],druginfo[playerid][pCachimbo],druginfo[playerid][pLSD],druginfo[playerid][pMaconha],druginfo[playerid][pHaxixe],
  1416.     druginfo[playerid][pAgulhas], GetName(playerid));
  1417.     mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 13);
  1418.     return 1;
  1419. }
  1420.  
  1421. function:LoadPlayerDrugs(playerid)
  1422. {
  1423.     format(query, sizeof(query), "SELECT * FROM `druginfo` WHERE `Name` = '%s'", GetName(playerid));
  1424.     mysql_function_query(MYSQLConnection, query, true, "r@LoadPlayerDrugs", "ds[24]", playerid, GetName(playerid));
  1425.     return 1;
  1426. }
  1427. function:r@LoadPlayerDrugs(playerid, name[24])
  1428. {
  1429.     new rows, fields;    
  1430.     cache_get_data(rows, fields);
  1431.     new valores[128];        
  1432.     cache_get_field_content(playerid, "Cocaina", valores, MYSQLConnection);        
  1433.     druginfo[playerid][pCocaina] = strval(valores);        
  1434.     cache_get_field_content(playerid, "Crack", valores, MYSQLConnection);        
  1435.     druginfo[playerid][pCrack] = strval(valores);        
  1436.     cache_get_field_content(playerid, "Heroina", valores, MYSQLConnection);        
  1437.     druginfo[playerid][pHeroina] = strval(valores);                  
  1438.     cache_get_field_content(playerid, "Cachimbo", valores, MYSQLConnection);        
  1439.     druginfo[playerid][pCachimbo] = strval(valores);      
  1440.     cache_get_field_content(playerid, "LSD", valores, MYSQLConnection);        
  1441.     druginfo[playerid][pLSD] = strval(valores);        
  1442.     cache_get_field_content(playerid, "Maconha", valores, MYSQLConnection);        
  1443.     druginfo[playerid][pMaconha] = strval(valores);      
  1444.     cache_get_field_content(playerid, "Haxixe", valores, MYSQLConnection);        
  1445.     druginfo[playerid][pHaxixe] = strval(valores);                
  1446.     cache_get_field_content(playerid, "Agulhas", valores, MYSQLConnection);        
  1447.     druginfo[playerid][pAgulhas] = strval(valores);        
  1448.     return 1;
  1449. }
  1450.  
  1451. function:SaveHouses()
  1452. {
  1453.     mysql_function_query(MYSQLConnection, "SELECT * FROM `houseinfo`", true, "r@SaveHouses", "d", 0);    
  1454.     return 1;
  1455. }
  1456.  
  1457. function:r@SaveHouses()
  1458. {
  1459.     new rows, fields;
  1460.     cache_get_data(rows, fields);
  1461.     for(new i = 1; i <= rows; i++)    
  1462.     {    
  1463.         format(query, sizeof(query), "UPDATE `houseinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
  1464.        Owner = '%s', Owned = '%d', Price = '%d', Locked = '%d' WHERE `ID` = '%d'", houseinfo[i][hEntranceX], houseinfo[i][hEntranceY], houseinfo[i][hEntranceZ], houseinfo[i][hExitX],
  1465.         houseinfo[i][hExitY], houseinfo[i][hExitZ], houseinfo[i][hInterior], houseinfo[i][hOwner], houseinfo[i][hOwned], houseinfo[i][hPrice],
  1466.         houseinfo[i][hLocked], i);
  1467.         mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i);  
  1468.     }    
  1469.     return 1;
  1470. }
  1471.  
  1472. function:LoadHouses()
  1473. {
  1474.     mysql_function_query(MYSQLConnection, "SELECT * FROM `houseinfo`", true, "r@LoadHouses", "d", 0);
  1475.     return 1;
  1476. }
  1477. function:r@LoadHouses()
  1478. {
  1479.     new rows, fields;    
  1480.     cache_get_data(rows, fields);
  1481.     for(new i; i < rows; i++)
  1482.     {        
  1483.         new valores[128];        
  1484.         cache_get_field_content(i, "ID", valores, MYSQLConnection);        
  1485.         houseinfo[i][hID] = strval(valores);
  1486.         cache_get_field_content(i, "EntranceX", valores, MYSQLConnection);        
  1487.         houseinfo[i][hEntranceX] = floatstr(valores);        
  1488.         cache_get_field_content(i, "EntranceY", valores, MYSQLConnection);        
  1489.         houseinfo[i][hEntranceY] = floatstr(valores);        
  1490.         cache_get_field_content(i, "EntranceZ", valores, MYSQLConnection);        
  1491.         houseinfo[i][hEntranceZ] = floatstr(valores);                  
  1492.         cache_get_field_content(i, "ExitX", valores, MYSQLConnection);        
  1493.         houseinfo[i][hExitX] = floatstr(valores);        
  1494.         cache_get_field_content(i, "ExitY", valores, MYSQLConnection);        
  1495.         houseinfo[i][hExitY] = floatstr(valores);        
  1496.         cache_get_field_content(i, "ExitZ", valores, MYSQLConnection);        
  1497.         houseinfo[i][hExitZ] = floatstr(valores);        
  1498.         cache_get_field_content(i, "Interior", valores, MYSQLConnection);        
  1499.         houseinfo[i][hInterior] = strval(valores);        
  1500.         cache_get_field_content(i, "Owner", houseinfo[i][hOwner], MYSQLConnection);            
  1501.         cache_get_field_content(i, "Owned", valores, MYSQLConnection);        
  1502.         houseinfo[i][hOwned] = strval(valores);        
  1503.         cache_get_field_content(i, "Price", valores, MYSQLConnection);        
  1504.         houseinfo[i][hPrice] = strval(valores);        
  1505.         cache_get_field_content(i, "Locked", valores, MYSQLConnection);        
  1506.         houseinfo[i][hLocked] = strval(valores);
  1507.         if(houseinfo[i][hOwned] == 0)
  1508.         {
  1509.             format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por:  $%i", houseinfo[i][hPrice]);
  1510.             HouseEstrutura2[i] = CreateDynamicPickup(1239, 1, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ],0, 0, -1, 15.0);
  1511.             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);
  1512.         }
  1513.     }
  1514.     printf("[SC-RP] Loaded %i Houses.", rows);
  1515.     return 1;
  1516. }
  1517.  
  1518. function:SaveHouse(houseid)
  1519. {
  1520.     format(query, sizeof(query), "UPDATE `houseinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
  1521.    Owner = '%s', Owned = '%d', Price = '%d', Locked = '%d' WHERE `ID` = '%d'", houseinfo[houseid][hEntranceX], houseinfo[houseid][hEntranceY], houseinfo[houseid][hEntranceZ], houseinfo[houseid][hExitX],
  1522.     houseinfo[houseid][hExitY], houseinfo[houseid][hExitZ], houseinfo[houseid][hInterior], houseinfo[houseid][hOwner], houseinfo[houseid][hOwned], houseinfo[houseid][hPrice],
  1523.     houseinfo[houseid][hLocked], houseid);
  1524.  
  1525.     mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 4);    
  1526.     return 1;
  1527. }
  1528.  
  1529. function:CreateNewHouse(Float:X, Float:Y, Float:Z, price, interior)
  1530. {
  1531.     format(string, sizeof(string), "INSERT INTO houseinfo (EntranceX, EntranceY, EntranceZ, Price, Owner) VALUES('%f', '%f', '%f', %i, 'None')",
  1532.     X, Y, Z, price);
  1533.     mysql_function_query(MYSQLConnection, string, false, "NewHouseCreated", "fffii", X,Y,Z,price,interior);
  1534.     return 1;
  1535. }
  1536.  
  1537. function:NewHouseCreated(Float:X, Float:Y, Float:Z, price, interior)
  1538. {
  1539.     mysql_store_result();
  1540.     new sqlid = mysql_insert_id();
  1541.     mysql_free_result();
  1542.     printf("House Created: %i", sqlid);
  1543.     houseinfo[sqlid][hPrice] = price;
  1544.     houseinfo[sqlid][hEntranceX] = X;
  1545.     houseinfo[sqlid][hEntranceY] = Y;
  1546.     houseinfo[sqlid][hEntranceZ] = Z;
  1547.     houseinfo[sqlid][hLocked] = 1;
  1548.     strmid(houseinfo[sqlid][hOwner], "", 0, strlen(""), 255);
  1549.    
  1550.     format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por:  $%i", houseinfo[sqlid][hPrice]);
  1551.     HouseEstrutura2[sqlid] = CreateDynamicPickup(1239, 1, houseinfo[sqlid][hEntranceX],houseinfo[sqlid][hEntranceY],houseinfo[sqlid][hEntranceZ],0, 0, -1, 15.0);
  1552.     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);        
  1553.     switch(interior) {
  1554.         case 1: { // Jefferson Motel
  1555.             houseinfo[sqlid][hExitX] = 2220.26;
  1556.             houseinfo[sqlid][hExitY] = -1148.01;
  1557.             houseinfo[sqlid][hExitZ] = 1025.80;
  1558.             houseinfo[sqlid][hInterior] = 15;
  1559.         }
  1560.         case 2: { // House Large 1
  1561.             SetHouseExit(sqlid, 3 ,235.508994, 1189.169897 ,1080.339966);
  1562.         }
  1563.         case 3: { // House Medium
  1564.             SetHouseExit(sqlid,2, 225.756989, 1240.000000, 1082.149902);
  1565.         }
  1566.         case 4: { // House Small
  1567.             SetHouseExit(sqlid, 1, 223.043991, 1289.259888, 1082.199951);
  1568.         }
  1569.         case 5: {
  1570.             SetHouseExit(sqlid, 7, 225.630997, 1022.479980,  1084.069946);
  1571.         }
  1572.         case 6: {
  1573.             SetHouseExit(sqlid, 15, 295.138977, 1474.469971, 1080.519897);
  1574.         }
  1575.         case 7: {
  1576.             SetHouseExit(sqlid, 15, 328.493988, 1480.589966, 1084.449951);
  1577.         }
  1578.         case 8: {
  1579.             SetHouseExit(sqlid, 15, 385.803986, 1471.769897, 1080.209961);
  1580.         }
  1581.         case 9: {
  1582.             SetHouseExit(sqlid, 8, 2807.63, -1170.15, 1025.57);
  1583.         }
  1584.         case 10: {
  1585.             SetHouseExit(sqlid, 9, 2251.85, -1138.16, 1050.63);
  1586.         }
  1587.         case 11: {
  1588.             SetHouseExit(sqlid, 10, 2260.76, -1210.45, 1049.02);
  1589.         }
  1590.         case 12: {
  1591.             SetHouseExit(sqlid, 3, 2496.65, -1696.55, 1014.74);
  1592.         }
  1593.         case 13: {
  1594.             SetHouseExit(sqlid, 5, 1299.14, -794.77, 1084.00);
  1595.         }
  1596.         case 14: {
  1597.             SetHouseExit(sqlid, 10, 2262.83, -1137.71, 1050.63);
  1598.         }
  1599.         case 15: {
  1600.             SetHouseExit(sqlid, 9, 2365.42, -1131.85, 1050.88);
  1601.         }
  1602.     }
  1603.     SaveHouse(sqlid);
  1604.     return 1;
  1605. }
  1606.  
  1607. function:SetHouseExit(id, interiorid, Float:X, Float:Y, Float:Z)
  1608. {
  1609.     houseinfo[id][hExitX] = X;
  1610.     houseinfo[id][hExitY] = Y;
  1611.     houseinfo[id][hExitZ] = Z;
  1612.     houseinfo[id][hInterior] = interiorid;    
  1613.     return 1;
  1614. }
  1615.  
  1616. function:CreateNewBiz(Float:X, Float:Y, Float:Z, price, interior, tipo)
  1617. {
  1618.     format(query, sizeof(query), "INSERT INTO businessinfo (EntranceX, EntranceY, EntranceZ, Price, Owner) VALUES('%f', '%f', '%f', %i, 'None')",
  1619.     X, Y, Z, price);
  1620.     mysql_function_query(MYSQLConnection, query, false, "NewBizCreated", "fffiii", X,Y,Z,price,interior,tipo);
  1621.     return 1;
  1622. }
  1623. function:NewBizCreated(Float:X, Float:Y, Float:Z, price, interior, tipo)
  1624. {
  1625.     mysql_store_result();
  1626.     new sqlid = mysql_insert_id();
  1627.     mysql_free_result();
  1628.     printf("Business created: %s", sqlid);
  1629.     bizinfo[sqlid][bPrice] = price;
  1630.     bizinfo[sqlid][bEntranceX] = X;
  1631.     bizinfo[sqlid][bEntranceY] = Y;
  1632.     bizinfo[sqlid][bEntranceZ] = Z;
  1633.     bizinfo[sqlid][bType] = tipo;
  1634.     strmid(bizinfo[sqlid][bOwner], "None", 0, strlen("None"), 255);
  1635.     bizEstrutura2[sqlid] = CreateDynamicPickup(1239, 1, X,Y,Z,-1, -1, -1, 15.0);
  1636.     format(string, sizeof(string), "[Empresa a venda %s]\n$%i", GetBizType(bizinfo[sqlid][bType]), bizinfo[sqlid][bPrice]);
  1637.     bizEstrutura[sqlid] = CreateDynamic3DTextLabel(string,0x008080FF,X,Y,Z,15.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID);
  1638.     switch(interior) {
  1639.         case 1: {
  1640.             SetBizExitCoordinates(sqlid, 17, -25.884498,-185.868988,1003.546875);
  1641.         }
  1642.         case 2: {
  1643.             SetBizExitCoordinates(sqlid, 6, 296.919982,-108.071998,1001.515625);
  1644.         }
  1645.         case 3: {
  1646.             SetBizExitCoordinates(sqlid, 10,    375.962463,-65.816848,1001.507812);
  1647.         }
  1648.         case 4: {
  1649.             SetBizExitCoordinates(sqlid, 9, 364.9181,-10.5893,1001.8516);
  1650.         }
  1651.         case 5: {
  1652.             SetBizExitCoordinates(sqlid, 5, 372.5956,-133.2348,1001.4922);
  1653.         }
  1654.         case 6: {
  1655.             SetBizExitCoordinates(sqlid, 17,    -204.439987,-8.469599,1002.273437);
  1656.         }
  1657.         case 7: {
  1658.             SetBizExitCoordinates(sqlid, 17,    381.169189,-188.803024,1000.632812);
  1659.         }
  1660.         case 8: {
  1661.             SetBizExitCoordinates(sqlid, 12,     1118.8878,  -10.2737   , 1002.0859);
  1662.         }
  1663.         case 9: {
  1664.             SetBizExitCoordinates(sqlid, 3, 833.269775,10.588416,1004.179687);
  1665.         }
  1666.         case 10: {
  1667.             SetBizExitCoordinates(sqlid,3,  -103.559165,-24.225606,1000.718750);
  1668.         }
  1669.         case 11: {
  1670.             SetBizExitCoordinates(sqlid, 6, -2240.468505,137.060440,1035.414062);
  1671.         }
  1672.         case 12: {
  1673.             SetBizExitCoordinates(sqlid,3,  207.054992,-138.804992,1003.507812);
  1674.         }
  1675.         case 13: {
  1676.             SetBizExitCoordinates(sqlid, 15,    207.737991,-109.019996,1005.132812);
  1677.         }
  1678.         case 14: {
  1679.             SetBizExitCoordinates(sqlid, 5, 226.293991,-7.431529,1002.210937);
  1680.         }
  1681.         case 15: {
  1682.             SetBizExitCoordinates(sqlid, 1, 203.777999,-48.492397,1001.804687);
  1683.         }
  1684.         case 16: {
  1685.             SetBizExitCoordinates(sqlid,18, 161.391006,-93.159156,1001.804687);
  1686.         }
  1687.         case 17: {
  1688.             SetBizExitCoordinates(sqlid,11, 501.980987,-69.150199,998.757812);
  1689.         }
  1690.         case 18: {
  1691.             SetBizExitCoordinates(sqlid, 2, 1204.809936,-11.586799,1000.921875);
  1692.         }
  1693.         case 19: {
  1694.             SetBizExitCoordinates(sqlid, 1, -794.806396,497.738037,1376.195312);
  1695.         }
  1696.         case 20: {
  1697.             SetBizExitCoordinates(sqlid, 3, 418.652984,-82.639793,1001.804687);
  1698.         }
  1699.         case 21,22: {
  1700.             SetBizExitCoordinates(sqlid, 1, 963.418762,2108.292480,1011.030273);
  1701.         }
  1702.         case 23: {
  1703.             SetBizExitCoordinates(sqlid, 0, 2019.8438,-1660.0923,2135.6104);
  1704.         }
  1705.         case 24: {
  1706.             SetBizExitCoordinates(sqlid, 1, 2269.7439,1628.5479,1084.2455);
  1707.         }
  1708.         case 25: {
  1709.             SetBizExitCoordinates(sqlid, 3, 950.0336,-7.6499,1001.1484);
  1710.         }
  1711.         case 26: {
  1712.             SetBizExitCoordinates(sqlid, 0, 2008.6963,-1709.8448,1806.4431);
  1713.         }
  1714.         case 27: { //jizzy
  1715.             SetBizExitCoordinates(sqlid, 3, -2637.69,1404.24,906.46);
  1716.         }
  1717.         case 28: { //alhamba
  1718.             SetBizExitCoordinates(sqlid, 17, 493.390991,-22.722799,1000.679687);
  1719.         }
  1720.         case 29: { //bar pequeno
  1721.             SetBizExitCoordinates(sqlid, 18, -227.027999,1401.229980,27.765625);
  1722.         }
  1723.     }
  1724.     SaveBiz(sqlid);
  1725. }
  1726.  
  1727. function:SetBizExitCoordinates(id, interiorid, Float:X, Float:Y, Float:Z)
  1728. {
  1729.     bizinfo[id][bExitX] = X;
  1730.     bizinfo[id][bExitY] = Y;
  1731.     bizinfo[id][bExitZ] = Z;
  1732.     bizinfo[id][bInterior] = interiorid;
  1733.     SaveBiz(id);          
  1734.     return 1;
  1735. }
  1736.  
  1737. function:SaveFactions()
  1738. {
  1739.     mysql_function_query(MYSQLConnection, "SELECT * FROM `factioninfo`", true, "r@SaveFactions", "d", 0);    
  1740.     return 1;
  1741. }
  1742.  
  1743. function:r@SaveFactions()
  1744. {
  1745.     new rows, fields;
  1746.     cache_get_data(rows, fields);
  1747.     for(new i = 0; i < rows; i++)    
  1748.     {    
  1749.         format(query, sizeof(query), "UPDATE `factioninfo`\
  1750.        SET Name = '%s',\
  1751.        Type = '%i',\
  1752.        Members = '%i',\
  1753.        Rank1 = '%s',\
  1754.        Rank2 = '%s',\
  1755.        Rank3 = '%s',\
  1756.        Rank4 = '%s',\
  1757.        Rank5 = '%s',\
  1758.        Rank6 = '%s',\
  1759.        Rank7 = '%s',\
  1760.        Rank8 = '%s',\
  1761.        Rank9 = '%s',\
  1762.        Rank10 = '%s',\
  1763.        Bank = '%i',\
  1764.        SpawnX = '%f',\
  1765.        SpawnY = '%f',\
  1766.        SpawnZ = '%f'\
  1767.        WHERE `id` = '%d'", factioninfo[i][fName], factioninfo[i][fType], factioninfo[i][fMembers], factioninfo[i][fRank1], factioninfo[i][fRank2], factioninfo[i][fRank3],
  1768.         factioninfo[i][fRank4], factioninfo[i][fRank5], factioninfo[i][fRank6], factioninfo[i][fRank7], factioninfo[i][fRank8], factioninfo[i][fRank9], factioninfo[i][fRank10],
  1769.         factioninfo[i][fBank], factioninfo[i][fSpawnX], factioninfo[i][fSpawnY], factioninfo[i][fSpawnZ], i+1);  
  1770.         mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i);  
  1771.     }    
  1772.     return 1;
  1773. }
  1774.  
  1775. function:LoadFactions()
  1776. {
  1777.     mysql_function_query(MYSQLConnection, "SELECT * FROM `factioninfo`", true, "r@LoadFactions", "d", 0);
  1778.     return 1;
  1779. }
  1780. function:r@LoadFactions()
  1781. {
  1782.     new rows, fields;    
  1783.     cache_get_data(rows, fields);
  1784.     for(new i = 0; i < rows; i++)
  1785.     {        
  1786.         new valores[128];        
  1787.         cache_get_field_content(i, "Name", factioninfo[i][fName], MYSQLConnection);              
  1788.         cache_get_field_content(i, "Type", valores, MYSQLConnection);        
  1789.         factioninfo[i][fType] = strval(valores);      
  1790.         cache_get_field_content(i, "Rank1", factioninfo[i][fRank1], MYSQLConnection);                      
  1791.         cache_get_field_content(i, "Rank2", factioninfo[i][fRank2], MYSQLConnection);            
  1792.         cache_get_field_content(i, "Rank3", factioninfo[i][fRank3], MYSQLConnection);        
  1793.         cache_get_field_content(i, "Rank4", factioninfo[i][fRank4], MYSQLConnection);        
  1794.         cache_get_field_content(i, "Rank5", factioninfo[i][fRank5], MYSQLConnection);              
  1795.         cache_get_field_content(i, "Rank6", factioninfo[i][fRank6], MYSQLConnection);            
  1796.         cache_get_field_content(i, "Rank7", factioninfo[i][fRank7], MYSQLConnection);          
  1797.         cache_get_field_content(i, "Rank8", factioninfo[i][fRank8], MYSQLConnection);              
  1798.         cache_get_field_content(i, "Rank9", factioninfo[i][fRank9], MYSQLConnection);                
  1799.         cache_get_field_content(i, "Rank10", factioninfo[i][fRank10], MYSQLConnection);              
  1800.         cache_get_field_content(i, "Bank", valores, MYSQLConnection);        
  1801.         factioninfo[i][fBank] = strval(valores);        
  1802.         cache_get_field_content(i, "SpawnX", valores, MYSQLConnection);        
  1803.         factioninfo[i][fSpawnX] = floatstr(valores);        
  1804.         cache_get_field_content(i, "SpawnY", valores, MYSQLConnection);        
  1805.         factioninfo[i][fSpawnY] = floatstr(valores);        
  1806.         cache_get_field_content(i, "SpawnZ", valores, MYSQLConnection);        
  1807.         factioninfo[i][fSpawnZ] = floatstr(valores);        
  1808.     }
  1809.     printf("[SC-RP] Loaded %i Factions.", rows);
  1810.     return 1;
  1811. }
  1812.  
  1813. function:LoadBizzes()
  1814. {
  1815.     mysql_function_query(MYSQLConnection, "SELECT * FROM `businessinfo`", true, "r@LoadBizzes", "d", 0);
  1816.     return 1;
  1817. }
  1818. function:r@LoadBizzes()
  1819. {
  1820.     new rows, fields;    
  1821.     cache_get_data(rows, fields);
  1822.     for(new i; i < rows; i++)
  1823.     {        
  1824.         new valores[128];        
  1825.         cache_get_field_content(i, "ID", valores, MYSQLConnection);        
  1826.         bizinfo[i][bID] = strval(valores);        
  1827.         cache_get_field_content(i, "Name", bizinfo[i][bName], MYSQLConnection);        
  1828.         cache_get_field_content(i, "EntranceX", valores, MYSQLConnection);        
  1829.         bizinfo[i][bEntranceX] = floatstr(valores);        
  1830.         cache_get_field_content(i, "EntranceY", valores, MYSQLConnection);        
  1831.         bizinfo[i][bEntranceY] = floatstr(valores);        
  1832.         cache_get_field_content(i, "EntranceZ", valores, MYSQLConnection);        
  1833.         bizinfo[i][bEntranceZ] = floatstr(valores);                  
  1834.         cache_get_field_content(i, "ExitX", valores, MYSQLConnection);        
  1835.         bizinfo[i][bExitX] = floatstr(valores);        
  1836.         cache_get_field_content(i, "ExitY", valores, MYSQLConnection);        
  1837.         bizinfo[i][bExitY] = floatstr(valores);        
  1838.         cache_get_field_content(i, "ExitZ", valores, MYSQLConnection);        
  1839.         bizinfo[i][bExitZ] = floatstr(valores);        
  1840.         cache_get_field_content(i, "Interior", valores, MYSQLConnection);        
  1841.         bizinfo[i][bInterior] = strval(valores);        
  1842.         cache_get_field_content(i, "Owner", bizinfo[i][bOwner], MYSQLConnection);            
  1843.         cache_get_field_content(i, "Owned", valores, MYSQLConnection);        
  1844.         bizinfo[i][bOwned] = strval(valores);        
  1845.         cache_get_field_content(i, "Price", valores, MYSQLConnection);        
  1846.         bizinfo[i][bPrice] = strval(valores);        
  1847.         cache_get_field_content(i, "Locked", valores, MYSQLConnection);        
  1848.         bizinfo[i][bLocked] = strval(valores);              
  1849.         cache_get_field_content(i, "Fee", valores, MYSQLConnection);        
  1850.         bizinfo[i][bFee] = strval(valores);        
  1851.         cache_get_field_content(i, "Type", valores, MYSQLConnection);        
  1852.         bizinfo[i][bType] = strval(valores);    
  1853.         cache_get_field_content(i, "Safe", valores, MYSQLConnection);        
  1854.         bizinfo[i][bSafe] = strval(valores);    
  1855.  
  1856.         if(bizinfo[i][bOwned] == 1)        
  1857.         {        
  1858.             format(string, sizeof(string), "[Empresa]\n[%s]\nEntrada: %d", bizinfo[i][bName], bizinfo[i][bFee]);
  1859.         }
  1860.  
  1861.         if(bizinfo[i][bOwned] == 0)
  1862.         {
  1863.             format(string, sizeof(string), "[Empresa]\n{FFF000}Vende-se por:  $%i", bizinfo[i][bPrice]);
  1864.         }
  1865.         bizEstrutura2[i] = CreateDynamicPickup(1239, 1, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ],0, 0, -1, 15.0);
  1866.         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);
  1867.     }
  1868.     printf("[SC-RP] Loaded %i Businesses.", rows);
  1869.     return 1;
  1870. }
  1871.  
  1872. function:SaveBizzes()
  1873. {
  1874.     mysql_function_query(MYSQLConnection, "SELECT * FROM `businessinfo`", true, "r@SaveBizzes", "d", 0);
  1875.     return 1;
  1876. }
  1877.  
  1878. function:r@SaveBizzes()
  1879. {
  1880.     new rows, fields;
  1881.     cache_get_data(rows, fields);
  1882.     for(new i = 1; i <= rows; i++)    
  1883.     {    
  1884.         format(query, sizeof(query), "UPDATE `businessinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
  1885.        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],
  1886.         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],
  1887.         bizinfo[i][bType], bizinfo[i][bName], bizinfo[i][bSafe], i);
  1888.         mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i);  
  1889.     }      
  1890.     return 1;
  1891. }
  1892.  
  1893. function:SaveBiz(bizid)
  1894. {
  1895.     format(query, sizeof(query), "UPDATE `businessinfo` SET EntranceX = '%f', EntranceY = '%f', EntranceZ = '%f', ExitX = '%f', ExitY = '%f', ExitZ = '%f', Interior = '%d', \
  1896.    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],
  1897.     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],
  1898.     bizinfo[bizid][bType], bizinfo[bizid][bName], bizinfo[bizid][bSafe], bizid);
  1899.     mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", bizid);
  1900.     return 1;  
  1901. }
  1902.  
  1903. function:LoadVehicles()
  1904. {
  1905.     mysql_function_query(MYSQLConnection, "SELECT * FROM vehicleinfo LIMIT 2000", true, "r@LoadVehicles", "d", 11);
  1906.     return 1;
  1907. }
  1908.  
  1909. function:r@LoadVehicles()
  1910. {
  1911.     new values[32], rows, fields;
  1912.     cache_get_data(rows, fields);  
  1913.     new i = 1;  
  1914.     for( ; i < rows; i++)    
  1915.     {              
  1916.         cache_get_field_content(i, "ID", values, MYSQLConnection);
  1917.         vehicleinfo[i][vSQLID] = strval(values);                                    
  1918.         cache_get_field_content(i, "Model", values, MYSQLConnection);
  1919.         vehicleinfo[i][vModel] = strval(values);                      
  1920.         cache_get_field_content(i, "Color1", values, MYSQLConnection);
  1921.         vehicleinfo[i][vColors1] = strval(values);        
  1922.         cache_get_field_content(i, "Color2", values, MYSQLConnection);
  1923.         vehicleinfo[i][vColors2] = strval(values);                
  1924.         cache_get_field_content(i, "Mod1", values, MYSQLConnection);
  1925.         vehicleinfo[i][vMod][0] = strval(values);                          
  1926.         cache_get_field_content(i, "Mod2", values, MYSQLConnection);
  1927.         vehicleinfo[i][vMod][1] = strval(values);        
  1928.         cache_get_field_content(i, "Mod3", values, MYSQLConnection);
  1929.         vehicleinfo[i][vMod][2] = strval(values);                          
  1930.         cache_get_field_content(i, "Mod4", values, MYSQLConnection);
  1931.         vehicleinfo[i][vMod][3] = strval(values);        
  1932.         cache_get_field_content(i, "Mod5", values, MYSQLConnection);
  1933.         vehicleinfo[i][vMod][4] = strval(values);        
  1934.         cache_get_field_content(i, "Mod6", values, MYSQLConnection);
  1935.         vehicleinfo[i][vMod][5] = strval(values);        
  1936.         cache_get_field_content(i, "Mod7", values, MYSQLConnection);
  1937.         vehicleinfo[i][vMod][6] = strval(values);            
  1938.         cache_get_field_content(i, "Mod8", values, MYSQLConnection);
  1939.         vehicleinfo[i][vMod][7] = strval(values);          
  1940.         cache_get_field_content(i, "Mod9", values, MYSQLConnection);
  1941.         vehicleinfo[i][vMod][8] = strval(values);            
  1942.         cache_get_field_content(i, "Mod10", values, MYSQLConnection);
  1943.         vehicleinfo[i][vMod][9] = strval(values);                  
  1944.         cache_get_field_content(i, "Mod11", values, MYSQLConnection);
  1945.         vehicleinfo[i][vMod][10] = strval(values);        
  1946.         cache_get_field_content(i, "Mod12", values, MYSQLConnection);
  1947.         vehicleinfo[i][vMod][11] = strval(values);        
  1948.         cache_get_field_content(i, "Mod13", values, MYSQLConnection);
  1949.         vehicleinfo[i][vMod][12] = strval(values);        
  1950.         cache_get_field_content(i, "Health", values, MYSQLConnection);
  1951.         vehicleinfo[i][vHealth] = floatstr(values);          
  1952.         cache_get_field_content(i, "Owner", vehicleinfo[i][vOwner], MYSQLConnection);      
  1953.         cache_get_field_content(i, "Type", values, MYSQLConnection);
  1954.         vehicleinfo[i][vType] = strval(values);                            
  1955.         cache_get_field_content(i, "RentPrice", values, MYSQLConnection);
  1956.         vehicleinfo[i][vRentPrice] = strval(values);      
  1957.         cache_get_field_content(i, "Price", values, MYSQLConnection);
  1958.         vehicleinfo[i][vPrice] = strval(values);      
  1959.         cache_get_field_content(i, "Fuel", values, MYSQLConnection);
  1960.         vehicleinfo[i][vFuel] = strval(values);                  
  1961.         cache_get_field_content(i, "Job", values, MYSQLConnection);
  1962.         vehicleinfo[i][vJob] = strval(values);        
  1963.         cache_get_field_content(i, "Buyable", values, MYSQLConnection);
  1964.         vehicleinfo[i][vBuyable] = strval(values);
  1965.         cache_get_field_content(i, "Locked", values, MYSQLConnection);
  1966.         vehicleinfo[i][vLocked] = strval(values);
  1967.         cache_get_field_content(i, "Rentable", values, MYSQLConnection);
  1968.         vehicleinfo[i][vRentable] = strval(values);  
  1969.         cache_get_field_content(i, "ParkX", values, MYSQLConnection);
  1970.         vehicleinfo[i][vParkPos1] = floatstr(values);      
  1971.         cache_get_field_content(i, "ParkY", values, MYSQLConnection);
  1972.         vehicleinfo[i][vParkPos2] = floatstr(values);      
  1973.         cache_get_field_content(i, "ParkZ", values, MYSQLConnection);
  1974.         vehicleinfo[i][vParkPos3] = floatstr(values);                        
  1975.         cache_get_field_content(i, "ParkAngle", values, MYSQLConnection);
  1976.         vehicleinfo[i][vParkPos4] = floatstr(values);        
  1977.         cache_get_field_content(i, "fCarID", values, MYSQLConnection);
  1978.         vehicleinfo[i][vFCarID] = strval(values);                            
  1979.         cache_get_field_content(i, "Alarm", values, MYSQLConnection);
  1980.         vehicleinfo[i][vAlarm] = strval(values);        
  1981.         cache_get_field_content(i, "Locks", values, MYSQLConnection);
  1982.         vehicleinfo[i][vLock] = strval(values);                                    
  1983.         cache_get_field_content(i, "Immobiliser", values, MYSQLConnection);
  1984.         vehicleinfo[i][vImmobiliser] = strval(values);      
  1985.         cache_get_field_content(i, "Bought", values, MYSQLConnection);
  1986.         vehicleinfo[i][vBought] = strval(values);                
  1987.         cache_get_field_content(i, "World", values, MYSQLConnection);
  1988.         vehicleinfo[i][vWorld] = strval(values);    
  1989.         cache_get_field_content(i, "Weapon1", values, MYSQLConnection);
  1990.         vehicleinfo[i][vWeapons1] = strval(values);          
  1991.         cache_get_field_content(i, "Weapon2", values, MYSQLConnection);
  1992.         vehicleinfo[i][vWeapons2] = strval(values);            
  1993.         cache_get_field_content(i, "Weapon3", values, MYSQLConnection);
  1994.         vehicleinfo[i][vWeapons3] = strval(values);          
  1995.         cache_get_field_content(i, "Ammo1", values, MYSQLConnection);
  1996.         vehicleinfo[i][vAmmo1] = strval(values);      
  1997.         cache_get_field_content(i, "Ammo2", values, MYSQLConnection);
  1998.         vehicleinfo[i][vAmmo2] = strval(values);        
  1999.         cache_get_field_content(i, "Ammo3", values, MYSQLConnection);
  2000.         vehicleinfo[i][vAmmo3] = strval(values);            
  2001.         cache_get_field_content(i, "XMRadio", values, MYSQLConnection);
  2002.         vehicleinfo[i][vXMRadio] = strval(values);            
  2003.         cache_get_field_content(i, "Insurance", values, MYSQLConnection);        
  2004.         vehicleinfo[i][vInsurance] = strval(values);          
  2005.         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);  
  2006.         SetVehicleZAngle(vehicleadd, vehicleinfo[i][vParkPos4]);        
  2007.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][0]);
  2008.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][1]);
  2009.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][2]);
  2010.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][3]);
  2011.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][4]);
  2012.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][5]);
  2013.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][6]);
  2014.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][7]);
  2015.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][8]);
  2016.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][9]);
  2017.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][10]);
  2018.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][11]);
  2019.         AddVehicleComponent(vehicleadd, vehicleinfo[i][vMod][12]);        
  2020.         SetVehicleHealth(vehicleadd, vehicleinfo[i][vHealth]);            
  2021.  
  2022.         for(new b = 0; b < MAX_PLAYERS; b ++)
  2023.         {
  2024.             if(vehicleinfo[i][vLocked] == 1) SetVehicleParamsForPlayer(vehicleadd,b,0,1);
  2025.             if(vehicleinfo[i][vFCarID] != -1 && playerinfo[b][pFaction] != vehicleinfo[i][vFCarID]) SetVehicleParamsForPlayer(vehicleadd,b,0,1);
  2026.             if(vehicleinfo[i][vJob] != -1 && playerinfo[b][pJob] != vehicleinfo[i][vJob]) SetVehicleParamsForPlayer(vehicleadd,b,0,1);            
  2027.         }        
  2028.         SetVehicleToRespawn(vehicleadd);            
  2029.         if(!strcmp(vehicleinfo[i][vOwner], "Faction", true))
  2030.         {
  2031.             SetVehicleVirtualWorld(vehicleadd, 0);              
  2032.         }
  2033.         else
  2034.         {
  2035.             SetVehicleVirtualWorld(vehicleadd, i+1);            
  2036.         }
  2037.     }    
  2038.     printf("[SC-RP] Loaded %d Vehicles.", rows);      
  2039.     return 1;
  2040. }
  2041.  
  2042. function:SaveVehicle(sqlid, id)
  2043. {
  2044.     if(!IsValidVehicle(id)) return 1;
  2045.     if(vehicleinfo[id][vModel] == 0) return 1;
  2046.     if(vehicleinfo[id][vCreated] == 1) return 1;      
  2047.  
  2048.     format(query, sizeof(query), "UPDATE vehicleinfo SET Model=%i,\
  2049.    ParkX='%f',\
  2050.    ParkY='%f',\
  2051.    ParkZ='%f',\
  2052.    ParkAngle='%f',\
  2053.    Color1=%i,\
  2054.    Color2=%i,\
  2055.    Mod1=%i,\
  2056.    Mod2=%i,\
  2057.    Mod3=%i,\
  2058.    Mod4=%i,\
  2059.    Mod5=%i,\
  2060.    Mod6=%i,\
  2061.    Mod7=%i,\
  2062.    Mod8=%i,\
  2063.    Mod9=%i,\
  2064.    Mod10=%i,\
  2065.    Mod11=%i,\
  2066.    Mod12=%i,\
  2067.    Mod13=%i,\
  2068.    Health='%f',\
  2069.    Owner='%s',\
  2070.    Type=%i,\
  2071.    RentPrice=%i,\
  2072.    Price=%i,\
  2073.    Fuel=%i,\
  2074.    Job=%i,\
  2075.    Buyable=%i,\
  2076.    Locked=%i,\
  2077.    Rentable=%i,\
  2078.    fCarID=%d,\
  2079.    Alarm=%i,\
  2080.    Locks=%i,\
  2081.    Destroyed=%i,\
  2082.    TimesDestroyed=%i WHERE ID = %i",
  2083.     vehicleinfo[id][vModel],vehicleinfo[id][vParkPos1],vehicleinfo[id][vParkPos2],vehicleinfo[id][vParkPos3],vehicleinfo[id][vParkPos4],
  2084.     vehicleinfo[id][vColors1],vehicleinfo[id][vColors2],vehicleinfo[id][vMod][0],vehicleinfo[id][vMod][1],vehicleinfo[id][vMod][2],vehicleinfo[id][vMod][3],
  2085.     vehicleinfo[id][vMod][4],vehicleinfo[id][vMod][5],vehicleinfo[id][vMod][6],vehicleinfo[id][vMod][7],vehicleinfo[id][vMod][8],
  2086.     vehicleinfo[id][vMod][9],vehicleinfo[id][vMod][10],vehicleinfo[id][vMod][11],vehicleinfo[id][vMod][12], vehicleinfo[id][vHealth],vehicleinfo[id][vOwner],
  2087.     vehicleinfo[id][vType],vehicleinfo[id][vRentPrice],vehicleinfo[id][vPrice], vehicleinfo[id][vFuel],vehicleinfo[id][vJob],
  2088.     vehicleinfo[id][vBuyable],vehicleinfo[id][vLocked], vehicleinfo[id][vRentable],vehicleinfo[id][vFCarID], vehicleinfo[id][vAlarm],vehicleinfo[id][vLock],
  2089.     vehicleinfo[id][vDestroyed], vehicleinfo[id][vTimesDestroyed], sqlid);
  2090.     mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 5);
  2091.  
  2092.     format(query, sizeof(query), "UPDATE vehicleinfo SET Immobiliser=%i,\
  2093.    Bought=%i,\
  2094.    Insurance=%i,\
  2095.    World=%i,\
  2096.    Weapon1=%i,\
  2097.    Weapon2=%i,\
  2098.    Weapon3=%i,\
  2099.    Ammo1=%i,\
  2100.    Ammo2=%i,\
  2101.    Ammo3=%i,\
  2102.    XMRadio=%i WHERE ID =%i",
  2103.     vehicleinfo[id][vImmobiliser], vehicleinfo[id][vBought], vehicleinfo[id][vInsurance], vehicleinfo[id][vWorld], \
  2104.     vehicleinfo[id][vWeapons1],vehicleinfo[id][vWeapons2],vehicleinfo[id][vWeapons3],vehicleinfo[id][vAmmo1],vehicleinfo[id][vAmmo2],vehicleinfo[id][vAmmo3],vehicleinfo[id][vXMRadio], sqlid);
  2105.     mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "i", 5);
  2106.  
  2107.     return 1;
  2108. }
  2109.  
  2110. function:AddForSaleVehicle(playerid, model, Float: X, Float: Y, Float: Z, Float:Angle, price)
  2111. {
  2112.     format(query, sizeof(query), "INSERT INTO vehicleinfo (Owner) VALUES('%s')", GetName(playerid));
  2113.     mysql_function_query(MYSQLConnection, query, false, "onSaleVehicleAdded", "ddffffd", playerid, model, X, Y, Z, Angle, price);
  2114.     return 1;
  2115. }
  2116.  
  2117. function:onSaleVehicleAdded(playerid, model, Float: X, Float: Y, Float: Z, Float: Angle, price)
  2118. {
  2119.     new CarID;
  2120.     CarID = CreateVehicle(model, X,Y,Z,Angle, -1, -1, -1);
  2121.     new id = mysql_insert_id();
  2122.     vehicleinfo[CarID][vModel] = model;
  2123.     vehicleinfo[CarID][vParkPos1] = X;
  2124.     vehicleinfo[CarID][vParkPos2] = Y;
  2125.     vehicleinfo[CarID][vParkPos3] = Z;
  2126.     vehicleinfo[CarID][vParkPos4] = Angle;
  2127.     vehicleinfo[CarID][vColors1] = -1;
  2128.     vehicleinfo[CarID][vColors2] = -1;
  2129.     vehicleinfo[CarID][vHealth] = 1000.0;
  2130.     vehicleinfo[CarID][vFuel] = 100;
  2131.     vehicleinfo[CarID][vFCarID] = -1;
  2132.     vehicleinfo[CarID][vJob] = -1;
  2133.     vehicleinfo[CarID][vLock] = 0;
  2134.     vehicleinfo[CarID][vSpawned] = 1;
  2135.     vehicleinfo[CarID][vAlarm] = 0;
  2136.     vehicleinfo[CarID][vImmobiliser] = 0;
  2137.     vehicleinfo[CarID][vOwnerID] = playerid;
  2138.     vehicleinfo[CarID][vWeapons1] = 0;
  2139.     vehicleinfo[CarID][vWeapons2] = 0;
  2140.     vehicleinfo[CarID][vWeapons3] = 0;
  2141.     vehicleinfo[CarID][vAmmo1] = 0;
  2142.     vehicleinfo[CarID][vAmmo2] = 0;
  2143.     vehicleinfo[CarID][vAmmo3] = 0;
  2144.     vehicleinfo[CarID][vXMRadio] = 0;
  2145.     vehicleinfo[CarID][vType] = 0;
  2146.     vehicleinfo[CarID][vInsurance] = 3;
  2147.     playerinfo[playerid][pMoney] -= price;    
  2148.     GivePlayerMoney(playerid, -price);
  2149.     vehicleinfo[CarID][vBuyable] = 0;
  2150.     strmid(vehicleinfo[CarID][vOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);
  2151.     vehicleinfo[CarID][vSQLID] = id;
  2152.     vehicleinfo[CarID][vBought] = 1;
  2153.     vehicleinfo[CarID][vInsurance] = 3;
  2154.     SaveVehicle(id, CarID);
  2155.     return 1;
  2156. }
  2157.  
  2158. function:ResetVariables(playerid)
  2159. {
  2160.     invite[playerid] = 0;    
  2161.     playerinfo[playerid][pLogado] = 0;    
  2162.     playerinfo[playerid][pMuted] = 0;
  2163.     playerinfo[playerid][pBlockPm] = 0;      
  2164.     playerinfo[playerid][pSpectating] = 0;
  2165.     playerinfo[playerid][pHelp] = 0;      
  2166.     strmid(playerinfo[playerid][pHelpStr],"",0,strlen(""),255);  
  2167.     playerinfo[playerid][pAdminDuty] = 0;
  2168.     playerinfo[playerid][pTesterDuty] = 0;                  
  2169.     Delete3DTextLabel(MaskText[playerid]);    
  2170.     playerinfo[playerid][pBizEnteredType] = 0;
  2171.     SendClientMessage(callinfo[playerid][Caller], COLOR_ERROR, "A ligação foi encerrada!");        
  2172.     callinfo[playerid][Caller] = 0;
  2173.     callinfo[playerid][Calling] = 0;    
  2174.     callinfo[playerid][InaCall] = 0;    
  2175.     playerinfo[playerid][pRinging] = 0;    
  2176.     RingingTime[playerid] = 0;              
  2177.     playerinfo[playerid][pCuffed] = 0;
  2178.     return 1;
  2179. }
  2180.  
  2181. function:SendAdminMessage(color, messages[])
  2182. {
  2183.     for(new i = 0; i < MAX_PLAYERS; i++)    
  2184.     {    
  2185.         if(playerinfo[i][pAdmin] > 0)        
  2186.         {        
  2187.             SendClientMessage(i, color, messages);
  2188.         }
  2189.     }    
  2190.     return 1;
  2191. }
  2192.  
  2193. function:SendTesterMessage(color, messages[])
  2194. {
  2195.     for(new i = 0; i < MAX_PLAYERS; i++)    
  2196.     {    
  2197.         if(playerinfo[i][pTester] > 0)        
  2198.         {        
  2199.             SendClientMessage(i, color, messages);
  2200.         }
  2201.     }    
  2202.     return 1;
  2203. }
  2204.  
  2205. function:GetVehicleName(modelid,name[],namesize)
  2206. {
  2207.     if(modelid < 400 || modelid > 611) return 0;
  2208.     modelid -= 400;
  2209.     for(new sxt, len = strlen(VehicleNames[modelid]); sxt < len && sxt < namesize; sxt++)
  2210.         name[sxt] = VehicleNames[modelid][sxt];
  2211.     return 1;
  2212. }
  2213.  
  2214. function:LoadWeaponData()
  2215. {
  2216.     mysql_function_query(MYSQLConnection, "SELECT * FROM weapondata", true, "r@LoadWeaponData", "d", 11);
  2217.     return 1;    
  2218. }
  2219.  
  2220. function:r@LoadWeaponData()
  2221. {
  2222.     new rows, fields;    
  2223.     cache_get_data(rows, fields);
  2224.     for(new i; i < rows; i++)
  2225.     {        
  2226.         new valores[128];        
  2227.         cache_get_field_content(i, "ID", valores, MYSQLConnection);        
  2228.         weapondata[i][wSQLID] = strval(valores);      
  2229.         cache_get_field_content(i, "Name", weapondata[i][wName], MYSQLConnection);    
  2230.         cache_get_field_content(i, "Price", valores, MYSQLConnection);        
  2231.         weapondata[i][wPrice] = strval(valores);                              
  2232.         cache_get_field_content(i, "Damage", valores, MYSQLConnection);        
  2233.         weapondata[i][wDamage] = strval(valores);    
  2234.         cache_get_field_content(i, "Ammo", valores, MYSQLConnection);        
  2235.         weapondata[i][wAmmo] = strval(valores);                
  2236.         cache_get_field_content(i, "Weight", valores, MYSQLConnection);        
  2237.         weapondata[i][wWeight] = strval(valores);  
  2238.         cache_get_field_content(i, "Type", valores, MYSQLConnection);        
  2239.         weapondata[i][wType] = strval(valores);                
  2240.     }                                                          
  2241.     printf("[SC-RP] Loaded %i WeaponDatas.", rows);
  2242.     return 1;
  2243. }
  2244.  
  2245. function:SaveWeaponData()
  2246. {
  2247.     mysql_function_query(MYSQLConnection, "SELECT * FROM `weapondata`", true, "r@SaveWeaponData", "d", 0);    
  2248.     return 1;
  2249. }
  2250.  
  2251. function:r@SaveWeaponData()
  2252. {
  2253.     new rows, fields;
  2254.     cache_get_data(rows, fields);
  2255.     for(new i = 0; i < rows; i++)    
  2256.     {              
  2257.         format(query, sizeof(query), "UPDATE `weapondata` SET Name = '%s', Price = '%d', Damage = '%f', Ammo = '%d', Weight = '%d', Type = '%d' WHERE `ID` = '%d'",
  2258.         weapondata[i][wName], weapondata[i][wPrice], weapondata[i][wDamage], weapondata[i][wAmmo], weapondata[i][wWeight], weapondata[i][wType], i+1);
  2259.         mysql_function_query(MYSQLConnection, query, false, "noReturnQuery", "d", i+1);  
  2260.     }      
  2261.     return 1;
  2262. }
  2263.  
  2264. public OnPlayerDisconnect(playerid, reason)
  2265. {
  2266.     if(playerinfo[playerid][pLogado] == 1)    
  2267.     {
  2268.         playerinfo[playerid][pLogado] = 0;                                
  2269.         new dmsg[128];
  2270.         if(reason == 0)    
  2271.         {                    
  2272.             format(dmsg, sizeof(dmsg), "%s foi desconectado. [Crashed]", GetName(playerid));
  2273.         }                                                                                      
  2274.         if(reason == 1)    
  2275.         {    
  2276.             format(dmsg, sizeof(dmsg), "%s foi desconectado. [Quit]", GetName(playerid));  
  2277.         }                                                            
  2278.         if(reason == 2)    
  2279.         {    
  2280.             format(dmsg, sizeof(dmsg), "%s foi desconectado. [Kick/Ban]", GetName(playerid));
  2281.         }    
  2282.         ProxDetector(20.0, playerid, dmsg, COLOR_FADE4, COLOR_FADE4, COLOR_FADE4, COLOR_FADE4, COLOR_FADE5);
  2283.         SaveUser(playerid);
  2284.         ResetVariables(playerid);                
  2285.         format(string, sizeof(string), "[%s] %s", getDateEx(), dmsg);
  2286.         Log("Disconnect.log", string);
  2287.         return 1;        
  2288.     }
  2289.     return 1;
  2290. }
  2291.  
  2292. public OnPlayerSpawn(playerid)
  2293. {
  2294.     SetPlayerColor(playerid, -1);    
  2295.     if(playerinfo[playerid][pMorto] == 1)    
  2296.     {    
  2297.         SetPlayerCameraPos(playerid,dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]+5);
  2298.         SetPlayerCameraLookAt(playerid, dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]);
  2299.         SetPlayerPos(playerid,  dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]);
  2300.         ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
  2301.         SendClientMessage(playerid, COLOR_ERROR, "Você está gravemente ferido!");
  2302.         SendClientMessage(playerid, COLOR_SOS, "Contudo, você pode aguardar por ajuda médica ou digitar /aceitarmorte!");
  2303.         SendClientMessage(playerid, COLOR_SOS, "Ao utilizar o comando, você irá perder $350");      
  2304.         SetPlayerSkin(playerid, playerinfo[playerid][pSkin]);
  2305.         return 1;
  2306.     }
  2307.     return 1;
  2308. }
  2309.  
  2310. public OnPlayerDeath(playerid, killerid, reason)
  2311. {
  2312.     format(string, sizeof(string), "[KILL] %s matou %s (%d)", GetName(killerid), GetName(playerid), reason);
  2313.     Log("Mortes.log", string);          
  2314.     playerinfo[playerid][pMorto] = 1;    
  2315.     GetPlayerPos(playerid, dePos[playerid][0], dePos[playerid][1], dePos[playerid][2]);    
  2316.     TogglePlayerControllable(playerid, false);      
  2317.     SetTimerEx("DeathPlayer", 3000, 0, "d", playerid);
  2318.     return 1;
  2319. }
  2320.  
  2321. function:DeathPlayer(playerid)
  2322. {
  2323.     SpawnPlayer(playerid);      
  2324.     return 1;
  2325. }
  2326.  
  2327. public OnVehicleSpawn(vehicleid)
  2328. {
  2329.     return 1;
  2330. }
  2331.  
  2332. public OnVehicleDeath(vehicleid, killerid)
  2333. {
  2334.     format(string, sizeof(string), "[%s] %s - %i (%i insurances) [Explodiu]", getDateEx(), vehicleinfo[vehicleid][vOwner], vehicleinfo[vehicleid][vSQLID], vehicleinfo[vehicleid][vInsurance]);
  2335.     new log[45];
  2336.     format(log, 45, "%s Explosions.log", vehicleinfo[vehicleid][vOwner]);
  2337.     Log(log, string);
  2338.  
  2339.     if(vehicleinfo[vehicleid][vCreated] == 1) return 1;
  2340.     if(!strcmp(vehicleinfo[vehicleid][vOwner], "Faction", true))
  2341.     {
  2342.         SetVehicleToRespawn(vehicleid);
  2343.     }
  2344.     else
  2345.     {
  2346.         if(vehicleinfo[vehicleid][vInsurance] <= 3)
  2347.         {
  2348.             vehicleinfo[vehicleid][vInsurance]--;                  
  2349.             vehicleinfo[vehicleid][vTimesDestroyed]++;
  2350.             if(vehicleinfo[vehicleid][vInsurance] == 0)
  2351.             {
  2352.                 vehicleinfo[vehicleid][vDestroyed] = 1;
  2353.             }            
  2354.             for(new i = 0; i < 12; ++i) {
  2355.                 if(vehicleinfo[vehicleid][vMod][i] > 0)
  2356.                 {
  2357.                     vehicleinfo[vehicleid][vMod][i] = 0;
  2358.                 }
  2359.             }
  2360.             vehicleinfo[vehicleid][vXMRadio] = 0;
  2361.             SetVehicleVirtualWorld(vehicleid, vehicleid+1);
  2362.             SaveVehicle(vehicleinfo[vehicleid][vSQLID], vehicleid);
  2363.             SetVehicleToRespawn(vehicleid);
  2364.             return 1;
  2365.         }
  2366.         return 1;
  2367.     }
  2368.     return 1;
  2369. }
  2370.  
  2371. public OnPlayerText(playerid, text[])
  2372. {
  2373.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  2374.     if(playerinfo[playerid][pFerido] == 1) return SendClientMessage(playerid, COLOR_ERROR, FERIDO_ERROR);
  2375.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  2376.     if(callinfo[playerid][InaCall] == 1)
  2377.     {  
  2378.         if(playerinfo[playerid][pMascarado] == 0)
  2379.         {                      
  2380.             new string2[128];
  2381.             format(string, sizeof(string), "%s diz (Celular): %s", GetName(playerid), text);        
  2382.             Log("Chat.log", string2);              
  2383.             SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);  
  2384.             format(string, sizeof(string), "[Ligação] %s diz: %s", GetName(playerid), text);
  2385.             SendClientMessage(callinfo[playerid][Caller], COLOR_FADE1, string);        
  2386.         }        
  2387.         else        
  2388.         {                
  2389.             new string2[128];
  2390.             format(string, sizeof(string), "%s diz (Celular): %s", GetMaskID(playerid), text);
  2391.             format(string2, sizeof(string2), "%s (Mask) diz (Celular): %s", GetName(playerid), text);        
  2392.             Log("Chat.log", string2);
  2393.             SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);    
  2394.             format(string, sizeof(string), "[Ligação] %s diz: %s", GetMaskID(playerid), text);
  2395.             SendClientMessage(callinfo[playerid][Caller], COLOR_FADE1, string);  
  2396.         }
  2397.         return 0;
  2398.     }    
  2399.     if(GetPlayerState(playerid) == 2 || GetPlayerState(playerid) == 3)    
  2400.     {    
  2401.        new VehicleID = GetPlayerVehicleID(playerid);    
  2402.        if(vehicleinfo[VehicleID][vWindows] == 1)      
  2403.        {                        
  2404.             new string2[128];
  2405.             if(playerinfo[playerid][pMascarado] == 1)
  2406.             {                  
  2407.                 format(string, sizeof(string), "(Janela Fechada) %s diz: %s", GetMaskID(playerid), text);      
  2408.                 format(string2, sizeof(string2), "[%s] (Mask)%s - %s", getDateEx(), GetName(playerid), text);
  2409.                 Log("Chat.log", string2);
  2410.                 ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);        
  2411.             }    
  2412.             else    
  2413.             {    
  2414.                 format(string, sizeof(string), "(Janela Fechada) %s diz: %s", GetName(playerid), text);                          
  2415.                 format(string2, sizeof(string2), "[%s] %s", getDateEx(), string);
  2416.                 Log("Chat.log", string2);
  2417.                 ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);    
  2418.             }
  2419.        }      
  2420.        else      
  2421.        {      
  2422.             new string2[128];
  2423.             if(playerinfo[playerid][pMascarado] == 1)
  2424.             {    
  2425.                 format(string, sizeof(string), "(Janela Aberta) %s diz: %s", GetMaskID(playerid), text);                        
  2426.                 format(string2, sizeof(string2), "[%s] (Mask)%s - %s", getDateEx(), GetName(playerid), text);
  2427.                 Log("Chat.log", string2);
  2428.                 ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);        
  2429.             }    
  2430.             else    
  2431.             {    
  2432.                 format(string, sizeof(string), "(Janela Aberta) %s diz: %s", GetName(playerid), text);
  2433.                 format(string2, sizeof(string2), "[%s] %s", getDateEx(), string);
  2434.                 Log("Chat.log", string2);        
  2435.                 ProxDetector(7.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);    
  2436.             }
  2437.        }      
  2438.        return 0;
  2439.     }
  2440.     new string2[128];                
  2441.     if(playerinfo[playerid][pMascarado] == 1)
  2442.     {                                                
  2443.         format(string, sizeof(string), "%s diz: %s", GetMaskID(playerid), text);                                  
  2444.         format(string2, sizeof(string2), "[%s] (Mask)%s - %s", getDateEx(), GetName(playerid), text);
  2445.         Log("Chat.log", string2);
  2446.         ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);        
  2447.     }    
  2448.     else    
  2449.     {    
  2450.         format(string, sizeof(string), "%s diz: %s", GetName(playerid), text);                                      
  2451.         format(string2, sizeof(string2), "[%s] %s", getDateEx(), string);
  2452.         Log("Chat.log", string2);
  2453.         ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);    
  2454.     }
  2455.     return 0;
  2456. }
  2457.  
  2458. CMD:entrar(playerid, params[])
  2459. {
  2460.     if(playerinfo[playerid][pFerido] == 1) return SendClientMessage(playerid, COLOR_ERROR, FERIDO_ERROR);    
  2461.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);    
  2462.     for(new i = 0; i < MAX_HOUSES; i++)    
  2463.     {    
  2464.         if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ]))
  2465.         {
  2466.             if(houseinfo[i][hLocked] == 0 && houseinfo[i][hOwned] == 1)
  2467.             {
  2468.                 SetPlayerPos(playerid, houseinfo[i][hExitX], houseinfo[i][hExitY], houseinfo[i][hExitZ]);
  2469.                 SetPlayerInterior(playerid, houseinfo[i][hInterior]);
  2470.                 playerinfo[playerid][pVW] = i;
  2471.                 SetPlayerVirtualWorld(playerid, i);
  2472.                 playerinfo[playerid][pHouseEntered] = GetPlayerVirtualWorld(playerid);              
  2473.                 format(string, sizeof(string), "[%s] %s entrou na casa %d (Dono: %s)", getDateEx(), GetName(playerid), i, houseinfo[i][hOwner]);                    
  2474.                 Log("Entrar.log", string);
  2475.                 return 1;
  2476.             }
  2477.             else {
  2478.                 GameTextForPlayer(playerid, "~b~A casa esta trancada", 3000, 5);
  2479.                 return 1;
  2480.             }
  2481.         }
  2482.     }
  2483.     for(new i = 0; i < MAX_BUSINESSES; i++)    
  2484.     {    
  2485.         if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ]))
  2486.         {
  2487.             if(bizinfo[i][bLocked] == 0 && bizinfo[i][bOwned] == 1)
  2488.             {              
  2489.                 if(playerinfo[playerid][pMoney] < bizinfo[i][bFee]) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);                      
  2490.                 playerinfo[playerid][pMoney] -= bizinfo[i][bFee];
  2491.                 bizinfo[i][bSafe] += bizinfo[i][bFee];              
  2492.                 GivePlayerMoney(playerid, -bizinfo[i][bFee]);
  2493.                 SetPlayerPos(playerid, bizinfo[i][bExitX], bizinfo[i][bExitY], bizinfo[i][bExitZ]);
  2494.                 SetPlayerInterior(playerid, bizinfo[i][bInterior]);
  2495.                 playerinfo[playerid][pVW] = i;
  2496.                 SetPlayerVirtualWorld(playerid, i);
  2497.                 playerinfo[playerid][pBizEnteredType] = bizinfo[i][bType];                        
  2498.                 playerinfo[playerid][pBizEntered] = GetPlayerVirtualWorld(playerid);
  2499.                 format(string, sizeof(string), "[%s] %s entrou na empresa %d (Dono: %s)", getDateEx(), GetName(playerid), i, bizinfo[i][bOwner]);                    
  2500.                 Log("Entrar.log", string);
  2501.                 return 1;
  2502.             }
  2503.             else {
  2504.                 GameTextForPlayer(playerid, "~b~A empresa esta trancada", 3000, 5);
  2505.                 return 1;
  2506.             }
  2507.         }
  2508.     }
  2509.     return 1;
  2510. }
  2511.  
  2512. CMD:sair(playerid, params[])
  2513. {
  2514.     if(playerinfo[playerid][pFerido] == 1) return SendClientMessage(playerid, COLOR_ERROR, FERIDO_ERROR);    
  2515.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);    
  2516.     for(new i = 0; i < MAX_HOUSES; i++)    
  2517.     {              
  2518.         new vw = GetPlayerVirtualWorld(playerid);
  2519.         if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hExitX],houseinfo[i][hExitY],houseinfo[i][hExitZ]) && vw == playerinfo[playerid][pVW])
  2520.         {                                                  
  2521.             SetPlayerPos(playerid, houseinfo[i][hEntranceX], houseinfo[i][hEntranceY], houseinfo[i][hEntranceZ]);
  2522.             SetPlayerInterior(playerid, 0);
  2523.             playerinfo[playerid][pHouseEntered] = 0;
  2524.             playerinfo[playerid][pVW] = 0;
  2525.             SetPlayerVirtualWorld(playerid, 0);
  2526.             format(string, sizeof(string), "[%s] %s saiu da casa %d (Dono: %s)", getDateEx(), GetName(playerid), i, houseinfo[i][hOwner]);                    
  2527.             Log("Entrar.log", string);
  2528.             return 1;
  2529.         }
  2530.     }
  2531.     for(new i = 1; i < MAX_BUSINESSES; i++)    
  2532.     {                                
  2533.         new vw = GetPlayerVirtualWorld(playerid);
  2534.         if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bExitX],bizinfo[i][bExitY],bizinfo[i][bExitZ]) && vw == playerinfo[playerid][pVW])
  2535.         {                              
  2536.             playerinfo[playerid][pBizEntered] = 0;
  2537.             SetPlayerPos(playerid, bizinfo[i][bEntranceX], bizinfo[i][bEntranceY], bizinfo[i][bEntranceZ]);
  2538.             SetPlayerInterior(playerid, 0);
  2539.             playerinfo[playerid][pVW] = 0;
  2540.             SetPlayerVirtualWorld(playerid, 0);              
  2541.             playerinfo[playerid][pBizEnteredType] = 0;
  2542.             format(string, sizeof(string), "[%s] %s saiu da empresa %d (Dono: %s)", getDateEx(), GetName(playerid), i, bizinfo[i][bOwner]);                    
  2543.             Log("Entrar.log", string);
  2544.             return 1;
  2545.         }
  2546.     }
  2547.     return 1;    
  2548. }
  2549.  
  2550. CMD:casa(playerid, params[])
  2551. {
  2552.     new subcmd[32], interior, preco;
  2553.     if(sscanf(params, "s[32]D(-1)D(-1)", subcmd, interior, preco))
  2554.     {                                                                                                    
  2555.         if(playerinfo[playerid][pAdmin] < 5)        
  2556.         {
  2557.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa [comprar | vender | info | trancar]");            
  2558.         }        
  2559.         else        
  2560.         {        
  2561.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa [comprar | vender | info | trancar]");
  2562.             SendClientMessage(playerid, COLOR_ERROR, "ADMIN: /casa [criar | avender | ir]");          
  2563.         }        
  2564.         return 1;
  2565.     }      
  2566.     if(!strcmp(subcmd, "comprar", true))    
  2567.     {    
  2568.         for(new i = 0; i < MAX_HOUSES; i++)    
  2569.         {    
  2570.             if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ]))
  2571.             {
  2572.                 if(houseinfo[i][hOwned] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Esta casa não está a venda!");
  2573.                 if(playerinfo[playerid][pMoney] < houseinfo[i][hPrice]) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);            
  2574.                 houseinfo[i][hOwned] = 1;            
  2575.                 playerinfo[playerid][pMoney] -= houseinfo[i][hPrice];            
  2576.                 GivePlayerMoney(playerid, -houseinfo[i][hPrice]);                  
  2577.                 strmid(houseinfo[i][hOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);        
  2578.                 SendClientMessage(playerid, COLOR_SUCESS, "Parabéns por sua nova aquisição!");
  2579.                 DestroyPickup(HouseEstrutura2[i]);
  2580.                 Delete3DTextLabel(HouseEstrutura[i]);    
  2581.                 SaveHouse(i);                                        
  2582.                 if(playerinfo[playerid][pCasa1] == 9999 || playerinfo[playerid][pCasa2] == 9999)
  2583.                 {
  2584.                 }
  2585.                 else return SendClientMessage(playerid, COLOR_ERROR, "Você já possui duas casas!");
  2586.                 if(playerinfo[playerid][pCasa1] != 9999) { playerinfo[playerid][pCasa2] = houseinfo[i][hID]; }
  2587.                 else { playerinfo[playerid][pCasa1] = houseinfo[i][hID]; }        
  2588.                 format(string, sizeof(string), "[%s] %s comprou a propriedade [Casa] ID %d.", getDateEx(), GetName(playerid), i);
  2589.                 Log("Propriedades.log", string);              
  2590.             }
  2591.         }      
  2592.         return 1;
  2593.     }    
  2594.     if(!strcmp(subcmd, "info", true))    
  2595.     {    
  2596.         if(playerinfo[playerid][pCasa1] == 9999 && playerinfo[playerid][pCasa2] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma casa!");
  2597.         new hstats1[15];    
  2598.         if(houseinfo[playerinfo[playerid][pCasa1]][hLocked] == 1)
  2599.         {
  2600.             hstats1 = "Trancada";        
  2601.         }                            
  2602.         else    
  2603.         {    
  2604.             hstats1 = "Aberta";
  2605.         }                          
  2606.         format(string, sizeof(string), "Slot: Casa 1 | ID: %i | Porta: %s | Preço: $%d", playerinfo[playerid][pCasa1], hstats1, houseinfo[playerinfo[playerid][pCasa1]][hPrice]);
  2607.         SendClientMessage(playerid, COLOR_NEUTRAL, string);
  2608.         if(playerinfo[playerid][pCasa2] != 9999)
  2609.         {
  2610.             if(houseinfo[playerinfo[playerid][pCasa2]][hLocked] == 1)
  2611.             {
  2612.                 hstats1 = "Trancada";        
  2613.             }                            
  2614.             else    
  2615.             {    
  2616.                 hstats1 = "Aberta";
  2617.             }                          
  2618.             format(string, sizeof(string), "Slot: Casa 2 | ID: %i | Porta: %s | Preço: $%d", playerinfo[playerid][pCasa2], hstats1, houseinfo[playerinfo[playerid][pCasa2]][hPrice]);
  2619.             SendClientMessage(playerid, COLOR_NEUTRAL, string);  
  2620.         }            
  2621.         return 1;
  2622.     }    
  2623.     if(!strcmp(subcmd, "trancar", true))    
  2624.     {    
  2625.         for(new i = 0; i < MAX_HOUSES; i++)    
  2626.         {    
  2627.             if(IsPlayerInRangeOfPoint(playerid, 2.0, houseinfo[i][hEntranceX],houseinfo[i][hEntranceY],houseinfo[i][hEntranceZ]))
  2628.             {
  2629.                 if(playerinfo[playerid][pRent] == i || !strcmp(GetName(playerid), houseinfo[i][hOwner], true))            
  2630.                 {            
  2631.                     if(houseinfo[i][hLocked] == 0)                
  2632.                     {                                  
  2633.                         SendClientMessage(playerid, COLOR_SUCESS, "Porta trancada!");
  2634.                         houseinfo[i][hLocked] = 1;
  2635.                         SaveHouse(i);
  2636.                     }
  2637.                     else
  2638.                     {
  2639.                         houseinfo[i][hLocked] = 0;      
  2640.                         SendClientMessage(playerid, COLOR_SUCESS, "Porta destrancada!");
  2641.                         SaveHouse(i);
  2642.                     }
  2643.                 }            
  2644.                 else            
  2645.                 {            
  2646.                     SendClientMessage(playerid, COLOR_ERROR, "Você não possui as chaves desta casa!");  
  2647.                 }
  2648.             }    
  2649.         }        
  2650.         return 1;
  2651.     }
  2652.     if(!strcmp(subcmd, "criar", true))
  2653.     {    
  2654.         if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
  2655.         if(interior == -1 || preco == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa criar [InteriorID] [Preço] (/casa interiores)");
  2656.         new Float: x,
  2657.             Float: y,
  2658.             Float: z;        
  2659.         GetPlayerPos(playerid, x, y, z);
  2660.         CreateNewHouse(x, y, z, preco, interior);
  2661.         SendClientMessage(playerid, COLOR_SUCESS, "Você criou uma nova casa com sucesso!");
  2662.         format(query, sizeof(query), "Preço: %d | Interior: %d | Posição: %f, %f, %f", preco, interior, x, y, z);
  2663.         SendClientMessage(playerid, COLOR_NEUTRAL, query);        
  2664.         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);
  2665.         Log("AdminCMD.log", string);            
  2666.         return 1;
  2667.     }
  2668.     if(!strcmp(subcmd, "vender", true))
  2669.     {
  2670.         if(playerinfo[playerid][pCasa1] == 9999 && playerinfo[playerid][pCasa2] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma casa!");
  2671.         if(playerinfo[playerid][pCasa2] == 9999)
  2672.         {            
  2673.             new houseid = playerinfo[playerid][pCasa1];
  2674.             SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a única casa que você possuia!");                
  2675.             playerinfo[playerid][pMoney] += houseinfo[houseid][hPrice] - 3000;        
  2676.             format(string, sizeof(string), "Lucros obtidos: $%d", houseinfo[houseid][hPrice] - 3000);
  2677.             SendClientMessage(playerid, COLOR_SUCESS, string);
  2678.             GivePlayerMoney(playerid, houseinfo[houseid][hPrice] - 3000);      
  2679.             playerinfo[playerid][pCasa1] = 9999;          
  2680.             strmid(houseinfo[houseid][hOwner], "0", 0, strlen("0"), 255);
  2681.             format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por:  $%i", houseinfo[houseid][hPrice]);
  2682.             HouseEstrutura2[houseid] = CreateDynamicPickup(1239, 1, houseinfo[houseid][hEntranceX],houseinfo[houseid][hEntranceY],houseinfo[houseid][hEntranceZ],0, 0, -1, 15.0);
  2683.             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);        
  2684.             houseinfo[houseid][hOwned] = 0;
  2685.             SendClientMessageToAll(-1, houseinfo[houseid][hOwned]);
  2686.             SendClientMessageToAll(-1, houseinfo[houseid][hOwner]);            
  2687.             SaveHouse(houseid);
  2688.         }
  2689.         else
  2690.         {                                                    
  2691.             if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "Por possuir duas casas, digite o ID da casa que deseja vender. (/casa vender <1/2>)");        
  2692.             if(interior != 1 && interior != 2) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam entre 1 e 2 (/casa info para checar)");        
  2693.             if(interior == 1)        
  2694.             {        
  2695.                 new houseid4 = strval(playerinfo[playerid][pCasa1]);                        
  2696.                 SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a sua casa primária (ID 1)!");                
  2697.                 playerinfo[playerid][pMoney] += houseinfo[houseid4][hPrice] - 3000;        
  2698.                 format(string, sizeof(string), "Lucros obtidos: $%d", houseinfo[houseid4][hPrice] - 3000);
  2699.                 SendClientMessage(playerid, COLOR_SUCESS, string);
  2700.                 GivePlayerMoney(playerid, houseinfo[houseid4][hPrice] - 3000);          
  2701.                 strmid(houseinfo[houseid4][hOwner], "", 0, strlen(""), 255);
  2702.                 format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por:  $%i", houseinfo[houseid4][hPrice]);
  2703.                 HouseEstrutura2[houseid4] = CreateDynamicPickup(1239, 1, houseinfo[houseid4][hEntranceX],houseinfo[houseid4][hEntranceY],houseinfo[houseid4][hEntranceZ],0, 0, -1, 15.0);
  2704.                 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);        
  2705.                 houseinfo[houseid4][hOwned] = 0;
  2706.                 new houseid3 = strval(playerinfo[playerid][pCasa2]);    
  2707.                 playerinfo[playerid][pCasa1] = houseid3;
  2708.                 playerinfo[playerid][pCasa2] = 9999;
  2709.                 SendClientMessage(playerid, COLOR_SUCESS, "Automaticamente, sua casa secundária tornou-se sua casa primária !");
  2710.                 SaveHouse(interior);                    
  2711.                 return 1;
  2712.             }        
  2713.             if(interior == 2)        
  2714.             {        
  2715.                 new houseid3 = strval(playerinfo[playerid][pCasa2]);                        
  2716.                 SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a sua casa secundária (ID 2)!");                
  2717.                 playerinfo[playerid][pMoney] += houseinfo[houseid3][hPrice] - 3000;        
  2718.                 format(string, sizeof(string), "Lucros obtidos: $%d", houseinfo[houseid3][hPrice] - 3000);
  2719.                 SendClientMessage(playerid, COLOR_SUCESS, string);
  2720.                 GivePlayerMoney(playerid, houseinfo[houseid3][hPrice] - 3000);          
  2721.                 strmid(houseinfo[houseid3][hOwner], "", 0, strlen(""), 255);
  2722.                 format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por:  $%i", houseinfo[houseid3][hPrice]);
  2723.                 HouseEstrutura2[houseid3] = CreateDynamicPickup(1239, 1, houseinfo[houseid3][hEntranceX],houseinfo[houseid3][hEntranceY],houseinfo[houseid3][hEntranceZ],0, 0, -1, 15.0);
  2724.                 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);        
  2725.                 houseinfo[houseid3][hOwned] = 0;      
  2726.                 playerinfo[playerid][pCasa2] = 9999;                            
  2727.                 SaveHouse(interior);
  2728.                 return 1;
  2729.             }
  2730.         }    
  2731.         return 1;
  2732.     }
  2733.     if(!strcmp(subcmd, "avender", true))
  2734.     {                      
  2735.         if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
  2736.         if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa avender [ID da Casa]");                
  2737.         if(interior < 0 || interior > MAX_HOUSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam de 1 à 500!");
  2738.         if(houseinfo[interior][hOwned] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Esta casa não tem um dono!");        
  2739.         houseinfo[interior][hOwned] = 0;        
  2740.         strmid(houseinfo[interior][hOwner], "", 0, strlen(""), 255);                
  2741.         format(string, sizeof(string), "[Casa]\n{FFF000}Vende-se por:  $%i", houseinfo[interior][hPrice]);
  2742.         HouseEstrutura2[interior] = CreateDynamicPickup(1239, 1, houseinfo[interior][hEntranceX],houseinfo[interior][hEntranceY],houseinfo[interior][hEntranceZ],0, 0, -1, 15.0);
  2743.         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);        
  2744.         format(string, sizeof(string), "Você vendeu com sucesso a casa ID %i!", interior);  
  2745.         SendClientMessage(playerid, COLOR_SUCESS, string);      
  2746.         format(string, sizeof(string), "[AVender] O administrador %s vendeu a casa ID %d!", GetName(playerid), interior);        
  2747.         Log("AdminCMD.log", string);
  2748.         SaveHouse(interior);                                                                      
  2749.         return 1;
  2750.     }    
  2751.     if(!strcmp(subcmd, "ir", true))
  2752.     {                      
  2753.         if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
  2754.         if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /casa ir [ID da Casa]");                
  2755.         if(interior < 0 || interior > MAX_HOUSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam de 1 à 100!");      
  2756.         SetPlayerPos(playerid, houseinfo[interior][hEntranceX], houseinfo[interior][hEntranceY], houseinfo[interior][hEntranceZ]);        
  2757.         format(string, sizeof(string), "Você teleportou-se com sucesso para a entrada da casa %i!", interior);        
  2758.         SendClientMessage(playerid, COLOR_SUCESS, string);                                                              
  2759.         format(string, sizeof(string), "[Teleport] O administrador %s teleportou-se para a entrada da casa %i!", GetName(playerid), interior);
  2760.         Log("AdminCMD.log", string);        
  2761.         return 1;
  2762.     }  
  2763.     return 1;
  2764. }  
  2765.  
  2766. CMD:empresa(playerid, params[])
  2767. {
  2768.     new subcmd[32], interior, preco, tipo;
  2769.     if(sscanf(params, "s[32]D(-1)D(-1)D(-1)", subcmd, interior, preco, tipo))
  2770.     {                                                                                                    
  2771.         if(playerinfo[playerid][pAdmin] < 5)        
  2772.         {
  2773.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa [comprar | vender | info | trancar]");            
  2774.         }        
  2775.         else        
  2776.         {        
  2777.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa [comprar | vender | info | trancar]");
  2778.             SendClientMessage(playerid, COLOR_ERROR, "ADMIN: /empresa [criar | avender]");          
  2779.         }        
  2780.         return 1;
  2781.     }      
  2782.     if(!strcmp(subcmd, "comprar", true))    
  2783.     {    
  2784.         for(new i = 0; i < MAX_BUSINESSES; i++)    
  2785.         {    
  2786.             if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ]))
  2787.             {
  2788.                 if(bizinfo[i][bOwned] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Esta empresa não está a venda!");
  2789.                 if(playerinfo[playerid][pMoney] < bizinfo[i][bPrice]) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);                
  2790.                 if(playerinfo[playerid][pEmpresa] != 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você já possui uma empresa!");
  2791.                 playerinfo[playerid][pEmpresa] = bizinfo[i][bID];            
  2792.                 bizinfo[i][bOwned] = 1;            
  2793.                 playerinfo[playerid][pMoney] -= bizinfo[i][bPrice];            
  2794.                 GivePlayerMoney(playerid, -bizinfo[i][bPrice]);                  
  2795.                 strmid(bizinfo[i][bOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);        
  2796.                 SendClientMessage(playerid, COLOR_SUCESS, "Parabéns por sua nova aquisição!");
  2797.                 DestroyPickup(bizEstrutura2[i]);                
  2798.                 Delete3DTextLabel(bizEstrutura[i]);    
  2799.                 SaveBiz(i);                                                
  2800.                 format(string, sizeof(string), "[%s] %s comprou a propriedade [Empresa] ID %d.", getDateEx(), GetName(playerid), i);
  2801.                 Log("Propriedades.log", string);              
  2802.             }
  2803.         }      
  2804.         return 1;
  2805.     }    
  2806.     if(!strcmp(subcmd, "info", true))    
  2807.     {    
  2808.         if(playerinfo[playerid][pEmpresa] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma empresa!");
  2809.         new hstats1[15];    
  2810.         if(bizinfo[playerinfo[playerid][pEmpresa]][bLocked] == 1)
  2811.         {
  2812.             hstats1 = "Trancada";        
  2813.         }                            
  2814.         else    
  2815.         {    
  2816.             hstats1 = "Aberta";
  2817.         }              
  2818.         new id = playerinfo[playerid][pEmpresa];          
  2819.         format(string, sizeof(string), "Empresa | ID: %i | Porta: %s | Preço: $%d", id, hstats1, bizinfo[id][bPrice]);
  2820.         SendClientMessage(playerid, COLOR_NEUTRAL, string);        
  2821.         return 1;
  2822.     }    
  2823.     if(!strcmp(subcmd, "trancar", true))    
  2824.     {    
  2825.         for(new i = 0; i < MAX_BUSINESSES; i++)    
  2826.         {    
  2827.             if(IsPlayerInRangeOfPoint(playerid, 2.0, bizinfo[i][bEntranceX],bizinfo[i][bEntranceY],bizinfo[i][bEntranceZ]))
  2828.             {
  2829.                 if(!strcmp(GetName(playerid), bizinfo[i][bOwner], true))            
  2830.                 {            
  2831.                     if(bizinfo[i][bLocked] == 0)                
  2832.                     {                                  
  2833.                         SendClientMessage(playerid, COLOR_SUCESS, "Porta trancada!");
  2834.                         bizinfo[i][bLocked] = 1;
  2835.                         SaveBiz(i);
  2836.                     }
  2837.                     else
  2838.                     {
  2839.                         bizinfo[i][bLocked] = 0;      
  2840.                         SendClientMessage(playerid, COLOR_SUCESS, "Porta destrancada!");
  2841.                         SaveBiz(i);
  2842.                     }
  2843.                 }            
  2844.                 else            
  2845.                 {            
  2846.                     SendClientMessage(playerid, COLOR_ERROR, "Você não possui as chaves desta empresa!");  
  2847.                 }
  2848.             }    
  2849.         }        
  2850.         return 1;
  2851.     }
  2852.     if(!strcmp(subcmd, "criar", true))
  2853.     {
  2854.         if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
  2855.         if(interior == -1 || preco == -1 || tipo == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa criar [InteriorID] [Preço] [Tipo] (/empresa interiores)");
  2856.         new Float: x,
  2857.             Float: y,
  2858.             Float: z;        
  2859.         GetPlayerPos(playerid, x, y, z);
  2860.         CreateNewBiz(x, y, z, preco, interior, tipo);
  2861.         SendClientMessage(playerid, COLOR_SUCESS, "Você criou uma nova empresa com sucesso!");
  2862.         format(query, sizeof(query), "Preço: %d | Interior: %d | Posição: %f, %f, %f | Tipo: %d", preco, interior, x, y, z, tipo);
  2863.         SendClientMessage(playerid, COLOR_NEUTRAL, query);        
  2864.         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);
  2865.         Log("AdminCMD.log", string);            
  2866.         return 1;
  2867.     }
  2868.     if(!strcmp(subcmd, "vender", true))
  2869.     {
  2870.         if(playerinfo[playerid][pEmpresa] == 9999) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui nenhuma empresa!");        
  2871.         new houseid = playerinfo[playerid][pEmpresa];
  2872.         SendClientMessage(playerid, COLOR_SUCESS, "Você vendeu a única empresa que você possuia!");                
  2873.         playerinfo[playerid][pMoney] += bizinfo[houseid][bPrice]-3000;        
  2874.         format(string, sizeof(string), "Lucros obtidos: $%d", bizinfo[houseid][bPrice]-3000);
  2875.         SendClientMessage(playerid, COLOR_SUCESS, string);                      
  2876.         GivePlayerMoney(playerid, bizinfo[houseid][bPrice]-3000);      
  2877.         playerinfo[playerid][pEmpresa] = 9999;          
  2878.         strmid(bizinfo[houseid][bOwner], "0", 0, strlen("0"), 255);
  2879.         format(string, sizeof(string), "[Empresa]\n{FFF000}Vende-se por:  $%i", bizinfo[houseid][bPrice]);
  2880.         bizEstrutura2[houseid] = CreateDynamicPickup(1239, 1, bizinfo[houseid][bEntranceX],bizinfo[houseid][bEntranceY],bizinfo[houseid][bEntranceZ],0, 0, -1, 15.0);        
  2881.         Delete3DTextLabel(bizEstrutura[houseid]);
  2882.         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);        
  2883.         bizinfo[houseid][bOwned] = 0;          
  2884.         SaveBiz(houseid);
  2885.     }
  2886.     if(!strcmp(subcmd, "avender", true))
  2887.     {                      
  2888.         if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
  2889.         if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa avender [ID da Empresa]");                
  2890.         if(interior < 0 || interior > MAX_BUSINESSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das empresas alternam de 1 à 100!");
  2891.         if(bizinfo[interior][bOwned] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Esta empresa não tem um dono!");        
  2892.         bizinfo[interior][bOwned] = 0;        
  2893.         strmid(bizinfo[interior][bOwner], "", 0, strlen(""), 255);        
  2894.         bizEstrutura2[interior] = CreateDynamicPickup(1239, 1, bizinfo[interior][bEntranceX],bizinfo[interior][bEntranceY],bizinfo[interior][bEntranceZ],0, 0, -1, 15.0);        
  2895.         format(string, sizeof(string), "[Empresa a venda %s]\n$%i", GetBizType(bizinfo[interior][bType]), bizinfo[interior][bPrice]);
  2896.         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);        
  2897.         format(string, sizeof(string), "Você vendeu com sucesso a empresa ID %i!", interior);  
  2898.         SendClientMessage(playerid, COLOR_SUCESS, string);      
  2899.         format(string, sizeof(string), "[AVender] O administrador %s vendeu a empresa ID %d!", GetName(playerid), interior);        
  2900.         Log("AdminCMD.log", string);
  2901.         SaveBiz(interior);                                                                      
  2902.         return 1;
  2903.     }
  2904.     if(!strcmp(subcmd, "ir", true))
  2905.     {                      
  2906.         if(playerinfo[playerid][pAdmin] <=4) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este comando!");
  2907.         if(interior == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /empresa ir [ID da Empresa]");                
  2908.         if(interior < 0 || interior > MAX_BUSINESSES) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das casas alternam de 1 à 100!");      
  2909.         SetPlayerPos(playerid, bizinfo[interior][bEntranceX], bizinfo[interior][bEntranceY], bizinfo[interior][bEntranceZ]);        
  2910.         format(string, sizeof(string), "Você teleportou-se com sucesso para a entrada da empresa %i!", interior);        
  2911.         SendClientMessage(playerid, COLOR_SUCESS, string);                                                              
  2912.         format(string, sizeof(string), "[Teleport] O administrador %s teleportou-se para a entrada da empresa %i!", GetName(playerid), interior);
  2913.         Log("AdminCMD.log", string);        
  2914.         return 1;
  2915.     }  
  2916.     return 1;
  2917. }
  2918.  
  2919. CMD:ajuda(playerid,params[])
  2920. {
  2921.     if(playerinfo[playerid][pAdmin] > 0)    
  2922.     {    
  2923.         format(string, sizeof(string), "Comandos Gerais\nComandos Veiculares\nComandos de Faction\nComandos de Líder\nComandos de Donaters\nComandos de Tester\nComandos de Adminsitrador");
  2924.     }    
  2925.     ShowPlayerDialog(playerid, DIALOG_AJUDA, DIALOG_STYLE_LIST, "Central de Comandos", string, "Ok", "Cancelar");  
  2926.     return 1;
  2927. }
  2928.  
  2929. CMD:pm(playerid, params[])
  2930. {
  2931.     new id, message[128];
  2932.     if(sscanf(params, "us[128]", id, message)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /pm [PlayerID] [Mensagem]");    
  2933.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  2934.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  2935.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  2936.     if(playerinfo[id][pBlockPm] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador está com as PM's bloqueadas!");
  2937.     if(playerinfo[id][pBlockUser] == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador está bloqueando suas PM's no momento!");
  2938.     //if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode enviar PM's para si mesmo!");  
  2939.     if(playerinfo[id][pAdmin] > 0)    
  2940.     {        
  2941.         if(playerinfo[playerid][pPmAllowed] != id)        
  2942.         {              
  2943.             new string2[128];                                                                    
  2944.             format(string2, sizeof(string2), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);
  2945.             strmid(playerinfo[playerid][pString], string2, 0, strlen(string2), 255);
  2946.             format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);          
  2947.             strmid(playerinfo[playerid][pString2], string, 0, strlen(string), 255);  
  2948.             SendingPM[playerid] = id;    
  2949.             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.\
  2950.            \nVocê realmente deseja proceder e enviar a mensagem?", "Sim", "Não");            
  2951.         }        
  2952.         else        
  2953.         {        
  2954.             format(string, sizeof(string), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);        
  2955.             SendClientMessage(id, COLOR_PM, string);            
  2956.             format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);            
  2957.             SendClientMessage(playerid, COLOR_PM, string);  
  2958.             format(string, sizeof(string), "[%s] [PM] De %s para %s: %s", getDateEx(), GetName(playerid), GetName(id), message);
  2959.             Log("PM.log", string);
  2960.         }
  2961.         return 1;
  2962.     }        
  2963.     if(playerinfo[playerid][pAdmin] > 0)
  2964.     {
  2965.         playerinfo[playerid][pPmAllowed] = id;        
  2966.         format(string, sizeof(string), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);        
  2967.         SendClientMessage(id, COLOR_PM, string);            
  2968.         format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);            
  2969.         SendClientMessage(playerid, COLOR_PM, string);
  2970.         format(string, sizeof(string), "[%s] [PM] De %s para %s: %s", getDateEx(), GetName(playerid), GetName(id), message);
  2971.         Log("PM.log", string);  
  2972.     }  
  2973.     format(string, sizeof(string), "[PM] de %s(ID: %d): %s", GetName(playerid), playerid, message);        
  2974.     SendClientMessage(id, COLOR_PM, string);            
  2975.     format(string, sizeof(string), "[PM] para %s(ID: %d): %s", GetName(id), id, message);            
  2976.     SendClientMessage(playerid, COLOR_PM, string);
  2977.     format(string, sizeof(string), "[%s] [PM] De %s para %s: %s", getDateEx(), GetName(playerid), GetName(id), message);
  2978.     Log("PM.log", string);        
  2979.     return 1;
  2980. }
  2981.  
  2982. CMD:togpm(playerid, params[])
  2983. {
  2984.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  2985.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  2986.     if(playerinfo[playerid][pDonate] < 1) return SendClientMessage(playerid, COLOR_ERROR, " Você não é um donate Bronze+!");        
  2987.     if(playerinfo[playerid][pBlockPm] == 0)    
  2988.     {    
  2989.         playerinfo[playerid][pBlockPm] = 1;        
  2990.         SendClientMessage(playerid, COLOR_SUCESS, "Você agora está bloqueando as PM's de todos os players!");
  2991.     }    
  2992.     else    
  2993.     {    
  2994.         playerinfo[playerid][pBlockPm] = 0;        
  2995.         SendClientMessage(playerid, COLOR_SUCESS, "Você desbloqueou as PM's de todos os players!");  
  2996.     }
  2997.     return 1;
  2998. }
  2999.  
  3000. CMD:blockpm(playerid, params[])
  3001. {
  3002.     new id;
  3003.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /blockpm [PlayerID]");    
  3004.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  3005.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3006.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3007.     if(playerinfo[playerid][pDonate] < 1) return SendClientMessage(playerid, COLOR_ERROR, " Você não é um donate Bronze+!");    
  3008.     if(playerinfo[playerid][pBlockUser] == id)    
  3009.     {    
  3010.         playerinfo[playerid][pBlockUser] = -1;  
  3011.         format(string, sizeof(string), "Você desbloqueou as PM's de %s!", GetName(id));    
  3012.         SendClientMessage(playerid, COLOR_PM, string);      
  3013.         return 1;                                                            
  3014.     }
  3015.     playerinfo[playerid][pBlockUser] = id;    
  3016.     format(string, sizeof(string), "Você agora está bloqueando as PM's de %s!", GetName(id));    
  3017.     SendClientMessage(playerid, COLOR_PM, string);
  3018.     return 1;
  3019. }
  3020.  
  3021. CMD:o(playerid,params[])
  3022. {
  3023.     new message[128];
  3024.     if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /o [Mensagem]");  
  3025.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);        
  3026.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3027.     if(TogOOC == 0)    
  3028.     {    
  3029.         format(string, sizeof(string), "(([OOC] %s: %s))", GetName(playerid), message);        
  3030.         SendClientMessageToAll(COLOR_OOC, string);
  3031.     }    
  3032.     else    
  3033.     {    
  3034.         if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, "O Chat OOC está desativado no momento!");        
  3035.         format(string, sizeof(string), "(([OOC] %s: %s))", GetName(playerid), message);        
  3036.         SendClientMessageToAll(COLOR_OOC, string);
  3037.     }                                                  
  3038.     return 1;
  3039. }
  3040.  
  3041. CMD:ooc(playerid, params[])
  3042. {                          
  3043.     new blocked[32];
  3044.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3045.     if(sscanf(params, "s[128]", blocked)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /o [Abrir/Trancar]");      
  3046.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3047.     if(!strcmp(blocked, "abrir", true))
  3048.     {
  3049.         if(TogOOC == 0) return SendClientMessage(playerid, COLOR_ERROR, " O Chat OOC já está aberto!");        
  3050.         TogOOC = 0;        
  3051.         SendClientMessageToAll(COLOR_OOC, "Um administrador ativou o chat OOC!");              
  3052.         return 1;
  3053.     }
  3054.     if(!strcmp(blocked, "trancar", true))
  3055.     {
  3056.         if(TogOOC == 1) return SendClientMessage(playerid, COLOR_ERROR, " O Chat OOC já está fechado!");        
  3057.         TogOOC = 1;        
  3058.         SendClientMessageToAll(COLOR_OOC, "Um administrador desativou o chat OOC!");          
  3059.         return 1;
  3060.     }
  3061.     return 1;    
  3062. }
  3063.  
  3064. CMD:criarinfernus(playerid, params[])
  3065. {
  3066.     new Float: x,    
  3067.         Float: y,        
  3068.         Float: z;
  3069.     GetPlayerPos(playerid, x, y, z);
  3070.     new lol = CreateVehicle(411, x, y, z, 0, 0, 0, -1);
  3071.     vehicleinfo[lol][vFCarID] = -1;    
  3072.     return 1;
  3073. }
  3074.  
  3075. CMD:factionon(playerid, params[])
  3076. {
  3077.     new factionid;    
  3078.     new onlinemembers;
  3079.     if(sscanf(params, "d", factionid)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /factionon [ID da faction]");          
  3080.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3081.     if(factionid < 1 || factionid > 41) return SendClientMessage(playerid, COLOR_ERROR, " Os ID's de facções vão de 1 à 40!");
  3082.     for(new i = 0; i < MAX_PLAYERS; i++)
  3083.     {
  3084.         if(playerinfo[i][pFaction] == factionid)
  3085.         {
  3086.             onlinemembers++;            
  3087.         }
  3088.     }    
  3089.     format(string, sizeof(string), "(( %s | Membros online: %d/%d ))", factioninfo[factionid-1][fName], onlinemembers, factioninfo[factionid-1][fMembers]);    
  3090.     SendClientMessage(playerid, COLOR_NEUTRAL, string);
  3091.     return 1;  
  3092. }  
  3093.  
  3094. CMD:promover(playerid, params[])
  3095. {
  3096.     new id, cargo;    
  3097.     if(sscanf(params, "ud", id, cargo)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /promover [PlayerID] [Rank]");    
  3098.     if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
  3099.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");  
  3100.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);  
  3101.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);        
  3102.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);        
  3103.     if(playerinfo[id][pFaction] != playerinfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_ERROR, "Você pode promover apenas membros da SUA facção!");
  3104.     if(playerinfo[id][pRank] == 10) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode promover os líderes de sua facção!");
  3105.     if(playerinfo[id][pRank] >= cargo) return SendClientMessage(playerid, COLOR_ERROR, "Para diminuir o rank do player, utilize /rebaixar [PlayerID]");    
  3106.     format(string, sizeof(string), "Você foi promovido à rank %d pelo líder %s. Parabéns!", cargo, GetName(playerid));
  3107.     SendClientMessage(id, COLOR_SUCESS, string);
  3108.     format(string, sizeof(string), "Você promoveu o membro %s para o rank %d!", cargo, GetName(playerid));
  3109.     SendClientMessage(playerid, COLOR_SUCESS, string);
  3110.     playerinfo[id][pRank] = cargo;      
  3111.     return 1;
  3112. }
  3113.  
  3114. CMD:rebaixar(playerid, params[])
  3115. {
  3116.     new id, cargo;    
  3117.     if(sscanf(params, "ud", id, cargo)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /rebaixar [PlayerID] [Rank]");    
  3118.     if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
  3119.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");  
  3120.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);  
  3121.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);        
  3122.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);        
  3123.     if(playerinfo[id][pFaction] != playerinfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_ERROR, "Você pode rebaixar apenas membros da SUA facção!");
  3124.     if(playerinfo[id][pRank] == 10) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode rebaixar os líderes de sua facção!");
  3125.     if(playerinfo[id][pRank] <= cargo) return SendClientMessage(playerid, COLOR_ERROR, "Para aumentar o rank do player, utilize /promover [PlayerID]");    
  3126.     format(string, sizeof(string), "Você foi rebaixado à rank %d pelo líder %s.", cargo, GetName(playerid));
  3127.     SendClientMessage(id, COLOR_SUCESS, string);
  3128.     format(string, sizeof(string), "Você rebaixou o membro %s para o rank %d!", cargo, GetName(playerid));
  3129.     SendClientMessage(playerid, COLOR_SUCESS, string);
  3130.     playerinfo[id][pRank] = cargo;      
  3131.     return 1;
  3132. }
  3133.  
  3134. CMD:nomerank(playerid, params[])
  3135. {
  3136.     new id, rank[128];    
  3137.     if(sscanf(params, "ds[128]", id, rank)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /nomerank [RankID] [Nome]");    
  3138.     if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
  3139.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");  
  3140.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);  
  3141.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);    
  3142.     new faction = playerinfo[playerid][pFaction];    
  3143.     if(id < 1 || id > 10) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's dos ranks variam de 1 à 10 APENAS!");    
  3144.     switch(id)    
  3145.     {    
  3146.         case 1:
  3147.         {
  3148.             strmid(factioninfo[faction-1][fRank1], rank, 0, sizeof(rank), 128);            
  3149.             format(string, sizeof(string), "Você mudou com sucesso o nome do rank 1 para %s!", rank);
  3150.         }        
  3151.         case 2:
  3152.         {
  3153.              strmid(factioninfo[faction-1][fRank2], rank, 0, sizeof(rank), 128);                
  3154.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 2 para %s!", rank);
  3155.         }    
  3156.         case 3:        
  3157.         {        
  3158.              strmid(factioninfo[faction-1][fRank3], rank, 0, sizeof(rank), 128);
  3159.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 3 para %s!", rank);  
  3160.         }                                                                                
  3161.         case 4:        
  3162.         {
  3163.              strmid(factioninfo[faction-1][fRank4], rank, 0, sizeof(rank), 128);  
  3164.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 4 para %s!", rank);
  3165.         }                                                                                
  3166.         case 5:        
  3167.         {        
  3168.              strmid(factioninfo[faction-1][fRank5], rank, 0, sizeof(rank), 128);
  3169.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 5 para %s!", rank);  
  3170.         }                                                                                
  3171.         case 6:        
  3172.         {        
  3173.              strmid(factioninfo[faction-1][fRank6], rank, 0, sizeof(rank), 128);  
  3174.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 6 para %s!", rank);
  3175.         }                                                                                
  3176.         case 7:        
  3177.         {        
  3178.              strmid(factioninfo[faction-1][fRank7], rank, 0, sizeof(rank), 128);  
  3179.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 7 para %s!", rank);
  3180.         }                                                                                
  3181.         case 8:        
  3182.         {        
  3183.              strmid(factioninfo[faction-1][fRank8], rank, 0, sizeof(rank), 128);  
  3184.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 8 para %s!", rank);
  3185.         }                                                                                
  3186.         case 9:        
  3187.         {        
  3188.              strmid(factioninfo[faction-1][fRank9], rank, 0, sizeof(rank), 128);  
  3189.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 9 para %s!", rank);
  3190.         }                                                                                
  3191.         case 10:        
  3192.         {        
  3193.              strmid(factioninfo[faction-1][fRank10], rank, 0, sizeof(rank), 128);
  3194.              format(string, sizeof(string), "Você mudou com sucesso o nome do rank 10 para %s!", rank);  
  3195.         }          
  3196.     }                  
  3197.     SendClientMessage(playerid, COLOR_SUCESS, string);
  3198.     return 1;
  3199. }
  3200.  
  3201. CMD:membros(playerid, params[])
  3202. {
  3203.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está em nenhuma faction!");      
  3204.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);  
  3205.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);    
  3206.     new faction = playerinfo[playerid][pFaction];
  3207.     for(new i = 0; i < MAX_PLAYERS; i++)    
  3208.     {    
  3209.         if(playerinfo[i][pFaction] == faction)        
  3210.         {        
  3211.             format(string, sizeof(string), "%s (ID: %d) Rank: %s (%d)", GetName(i), i, GetRankName(i), playerinfo[playerid][pRank]);            
  3212.             SendClientMessage(playerid, COLOR_SOS, string);
  3213.         }  
  3214.     }    
  3215.     return 1;
  3216. }
  3217.  
  3218. CMD:convidar(playerid, params[])
  3219. {
  3220.     new id;
  3221.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /convidar [PlayerID]");
  3222.     if(playerinfo[playerid][pRank] < 10) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas líderes utilizem o comando!");
  3223.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERRO DESCONHECIDO] Você não está em nenhuma facção!");  
  3224.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);  
  3225.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);        
  3226.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  3227.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, " Você não pode se convidar!");            
  3228.     new faction;    
  3229.     faction = playerinfo[playerid][pFaction];
  3230.     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]);    
  3231.     SendClientMessage(id, COLOR_PM, string);                                                                                                                                      
  3232.     format(string, sizeof(string), "Você convidou %s a se unir à facção %s. Aguarde-o aceitar o convite!", GetName(id), factioninfo[faction-1][fName]);    
  3233.     SendClientMessage(playerid, COLOR_PM, string);    
  3234.     invite[id] = faction;      
  3235.     return 1;
  3236. }
  3237.  
  3238. CMD:aceitar(playerid, params[])
  3239. {
  3240.     new subcmd[32];
  3241.     if(sscanf(params, "s[32]", subcmd)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /aceitar [convite]");
  3242.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);                      
  3243.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3244.     if(!strcmp(subcmd, "convite", true))    
  3245.     {    
  3246.         if(invite[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não foi convidado para nenhuma facção!");        
  3247.         SendClientMessage(playerid, COLOR_PM, "Parabéns, você acaba de entrar na facção!");
  3248.         playerinfo[playerid][pFaction] = invite[playerid];
  3249.         invite[playerid] = 0;
  3250.         factioninfo[invite[playerid]][fMembers] ++;
  3251.         playerinfo[playerid][pRank] = 1;              
  3252.         return 1;
  3253.     }                
  3254.     return 1;
  3255. }
  3256.  
  3257. CMD:f(playerid, params[])
  3258. {
  3259.     new msg[256];    
  3260.     if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /f [Mensagem]");    
  3261.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não está em uma facção válida!");    
  3262.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3263.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3264.     new faction = playerinfo[playerid][pFaction];    
  3265.     if(playerinfo[playerid][pRank] == 1) { format(string, sizeof(string), "(( %s %s: %s ))",  factioninfo[faction-1][fRank1], GetName(playerid), msg); }
  3266.     else if(playerinfo[playerid][pRank] == 2) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank2], GetName(playerid), msg); }
  3267.     else if(playerinfo[playerid][pRank] == 3) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank3], GetName(playerid), msg); }
  3268.     else if(playerinfo[playerid][pRank] == 4) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank4], GetName(playerid), msg); }
  3269.     else if(playerinfo[playerid][pRank] == 5) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank5], GetName(playerid), msg); }
  3270.     else if(playerinfo[playerid][pRank] == 6) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank6], GetName(playerid), msg); }
  3271.     else if(playerinfo[playerid][pRank] == 7) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank7], GetName(playerid), msg); }
  3272.     else if(playerinfo[playerid][pRank] == 8) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank8], GetName(playerid), msg); }
  3273.     else if(playerinfo[playerid][pRank] == 9) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank9], GetName(playerid), msg); }
  3274.     else if(playerinfo[playerid][pRank] == 10) { format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank10], GetName(playerid), msg); }
  3275.     else
  3276.     {
  3277.         format(string, sizeof(string), "(( %s %s: %s ))", factioninfo[faction-1][fRank1], GetName(playerid), msg);  
  3278.     }
  3279.     for(new i = 0; i < MAX_PLAYERS; i++)
  3280.     {
  3281.         if(playerinfo[i][pFaction] == faction)        
  3282.         {    
  3283.             SendClientMessage(i, COLOR_FACTION, string);
  3284.         }
  3285.     }                                                              
  3286.     return 1;
  3287. }
  3288.  
  3289. CMD:d(playerid, params[])
  3290. {
  3291.     new msg[256];    
  3292.     if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /d [Mensagem de Rádio]");    
  3293.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não está em uma facção válida!");    
  3294.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3295.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3296.     new faction = playerinfo[playerid][pFaction];  
  3297.     if(factioninfo[faction-1][fType] != 1 && factioninfo[faction-1][fType] != 2 && factioninfo[faction-1][fType] != 3)
  3298.     {
  3299.         return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções governamentais desfrutem deste rádio!");
  3300.     }  
  3301.     new factionname[32];        
  3302.     if(playerinfo[playerid][pFaction] == 1)    
  3303.     {    
  3304.         format(factionname, sizeof(factionname), "LSPD");      
  3305.     }    
  3306.     if(playerinfo[playerid][pFaction] == 2)    
  3307.     {    
  3308.         format(factionname, sizeof(factionname), "LSFD");      
  3309.     }    
  3310.     if(playerinfo[playerid][pFaction] == 3)    
  3311.     {    
  3312.         format(factionname, sizeof(factionname), "GOV");      
  3313.     }      
  3314.     if(playerinfo[playerid][pMascarado] == 0)    
  3315.     {
  3316.         if(playerinfo[playerid][pRank] == 1) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetName(playerid), msg); }
  3317.         else if(playerinfo[playerid][pRank] == 2) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank2], GetName(playerid), msg); }
  3318.         else if(playerinfo[playerid][pRank] == 3) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank3], GetName(playerid), msg); }
  3319.         else if(playerinfo[playerid][pRank] == 4) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank4], GetName(playerid), msg); }
  3320.         else if(playerinfo[playerid][pRank] == 5) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank5], GetName(playerid), msg); }
  3321.         else if(playerinfo[playerid][pRank] == 6) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank6], GetName(playerid), msg); }
  3322.         else if(playerinfo[playerid][pRank] == 7) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank7], GetName(playerid), msg); }
  3323.         else if(playerinfo[playerid][pRank] == 8) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank8], GetName(playerid), msg); }
  3324.         else if(playerinfo[playerid][pRank] == 9) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank9], GetName(playerid), msg); }
  3325.         else if(playerinfo[playerid][pRank] == 10) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank10], GetName(playerid), msg); }
  3326.         else
  3327.         {
  3328.             format(string, sizeof(string), "[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetName(playerid), msg);  
  3329.         }
  3330.     }
  3331.     else
  3332.     {
  3333.         if(playerinfo[playerid][pRank] == 1) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetMaskID(playerid), msg); }
  3334.         else if(playerinfo[playerid][pRank] == 2) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank2], GetMaskID(playerid), msg); }
  3335.         else if(playerinfo[playerid][pRank] == 3) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank3], GetMaskID(playerid), msg); }
  3336.         else if(playerinfo[playerid][pRank] == 4) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank4], GetMaskID(playerid), msg); }
  3337.         else if(playerinfo[playerid][pRank] == 5) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank5], GetMaskID(playerid), msg); }
  3338.         else if(playerinfo[playerid][pRank] == 6) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank6], GetMaskID(playerid), msg); }
  3339.         else if(playerinfo[playerid][pRank] == 7) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank7], GetMaskID(playerid), msg); }
  3340.         else if(playerinfo[playerid][pRank] == 8) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank8], GetMaskID(playerid), msg); }
  3341.         else if(playerinfo[playerid][pRank] == 9) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank9], GetMaskID(playerid), msg); }
  3342.         else if(playerinfo[playerid][pRank] == 10) { format(string, sizeof(string), "*[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank10], GetMaskID(playerid), msg); }
  3343.         else
  3344.         {
  3345.             format(string, sizeof(string), "[%s]%s %s: %s", factionname, factioninfo[faction-1][fRank1], GetName(playerid), msg);  
  3346.         }
  3347.     }                                                                      
  3348.     for(new i = 0; i < MAX_PLAYERS; i++)
  3349.     {
  3350.         if(factioninfo[faction-1][fType] == 1 || factioninfo[faction-1][fType] == 2 || factioninfo[faction-1][fType] == 3)        
  3351.         {    
  3352.             SendClientMessage(i, COLOR_DEPARTMENT, string);            
  3353.         }
  3354.     }        
  3355.     if(playerinfo[playerid][pMascarado] == 0)    
  3356.     {
  3357.         format(string, sizeof(string), "*[Radio] %s diz: %s", GetName(playerid), msg);        
  3358.     }    
  3359.     else    
  3360.     {    
  3361.         format(string, sizeof(string), "*[Radio] %s diz: %s", GetMaskID(playerid), msg);
  3362.     }
  3363.     SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);                                                  
  3364.     return 1;
  3365. }
  3366.  
  3367. CMD:r(playerid, params[])
  3368. {
  3369.     new msg[256];    
  3370.     if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /r [Mensagem de rádio]");    
  3371.     if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Você não está em uma facção válida!");    
  3372.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3373.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);                  
  3374.     new faction = playerinfo[playerid][pFaction];
  3375.     if(factioninfo[faction-1][fType] != 1 && factioninfo[faction-1][fType] != 2 && factioninfo[faction-1][fType] != 3)
  3376.     {
  3377.         return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções governamentais desfrutem deste rádio!");
  3378.     }                                        
  3379.     if(playerinfo[playerid][pMascarado] == 0)    
  3380.     {
  3381.         format(string, sizeof(string), "*[CH:911 S:1] %s: %s", GetName(playerid), msg);      
  3382.     }    
  3383.     else    
  3384.     {    
  3385.         format(string, sizeof(string), "*[CH:911 S:1] %s: %s", GetMaskID(playerid), msg);
  3386.     }
  3387.     for(new i = 0; i < MAX_PLAYERS; i++)
  3388.     {
  3389.         if(playerinfo[i][pFaction] == faction)        
  3390.         {    
  3391.             SendClientMessage(i, COLOR_RADIO, string);
  3392.         }
  3393.     }                                      
  3394.     if(playerinfo[playerid][pMascarado] == 0)    
  3395.     {
  3396.         format(string, sizeof(string), "*[Radio] %s diz: %s", GetName(playerid), msg);        
  3397.     }    
  3398.     else    
  3399.     {    
  3400.         format(string, sizeof(string), "*[Radio] %s diz: %s", GetMaskID(playerid), msg);
  3401.     }
  3402.     SetPlayerChatBubble(playerid, string, 0xFFFFFFAA, 30.0, 5000);                                                    
  3403.     return 1;
  3404. }
  3405.  
  3406. CMD:me(playerid, params[])
  3407. {
  3408.     new action[128];    
  3409.     new string2[128];
  3410.     if(sscanf(params, "s[128]", action)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /me [Ação]");      
  3411.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3412.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3413.     if(playerinfo[playerid][pMascarado] == 0)
  3414.     {    
  3415.         format(string, sizeof(string), "* %s %s", GetName(playerid), action);
  3416.         format(string2, sizeof(string2), "[%s] [/ME] %s", getDateEx(), string);
  3417.         Log("Action.log", string2);      
  3418.     }    
  3419.     else    
  3420.     {    
  3421.         format(string, sizeof(string), "* %s %s", GetMaskID(playerid), action);  
  3422.         format(string2, sizeof(string2), "[%s] [/ME] (Masked)* %s %s", getDateEx(), GetName(playerid), action);
  3423.         Log("Action.log", string2);
  3424.     }
  3425.     ProxDetectorAction(20.0, playerid, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);    
  3426.     return 1;
  3427. }
  3428.  
  3429.  
  3430. CMD:eu(playerid, params[])
  3431. {
  3432.     new action[128];        
  3433.     new string2[128];
  3434.     if(sscanf(params, "s[128]", action)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /eu [Ação]");      
  3435.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3436.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3437.     if(playerinfo[playerid][pMascarado] == 0)
  3438.     {    
  3439.         format(string, sizeof(string), "* %s %s", GetName(playerid), action);
  3440.         format(string2, sizeof(string2), "[%s] [/ME] %s", getDateEx(), string);
  3441.         Log("Action.log", string2);        
  3442.     }    
  3443.     else    
  3444.     {    
  3445.         format(string, sizeof(string), "* %s %s", GetMaskID(playerid), action);  
  3446.         format(string2, sizeof(string2), "[%s] [/ME] (Masked)* %s %s", getDateEx(), GetName(playerid), action);
  3447.         Log("Action.log", string2);  
  3448.     }
  3449.     ProxDetectorAction(20.0, playerid, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);    
  3450.     return 1;    
  3451. }
  3452.  
  3453. CMD:do(playerid, params[])
  3454. {
  3455.     new action[128];    
  3456.     new string2[128];
  3457.     if(sscanf(params, "s[128]", action)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /do [Ação]");      
  3458.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3459.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);  
  3460.     if(playerinfo[playerid][pMascarado] == 0)
  3461.     {    
  3462.         format(string, sizeof(string), "* %s ( %s )", action, GetName(playerid));
  3463.         format(string2, sizeof(string2), "[%s] [/DO] %s", getDateEx(), string);
  3464.         Log("Action.log", string2);    
  3465.     }    
  3466.     else    
  3467.     {    
  3468.         format(string, sizeof(string), "* %s ( %s )", action, GetMaskID(playerid));
  3469.         format(string2, sizeof(string2), "[%s] [/DO] (Masked)* %s ( %s )", getDateEx(), action, GetName(playerid));
  3470.         Log("Action.log", string2);  
  3471.     }  
  3472.     ProxDetector(20.0, playerid, string, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION);    
  3473.     return 1;    
  3474. }
  3475.  
  3476. CMD:sos(playerid, params[])
  3477. {
  3478.     new sos[128];    
  3479.     if(sscanf(params, "s[128]", sos)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /sos [Pergunta]");    
  3480.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3481.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3482.     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!");    
  3483.     playerinfo[playerid][pHelp] = 1;    
  3484.     format(string, sizeof(string), "[SOS] %s [%d]: %s (/ah | /rh)", GetName(playerid), playerid, sos);
  3485.     for(new i = 0; i < MAX_PLAYERS; i++)
  3486.     {
  3487.         if(playerinfo[i][pTesterDuty] == 1)            
  3488.         {            
  3489.             SendClientMessage(i, COLOR_SOS, string);  
  3490.         }                                                      
  3491.     }    
  3492.     strmid(playerinfo[playerid][pHelpStr], string, 0, sizeof(string), 255);
  3493.     SendClientMessage(playerid, COLOR_SUCESS, "Sua dúvida foi enviada para os Testers disponíveis, seja paciente!");  
  3494.     return 1;
  3495. }
  3496.  
  3497. CMD:ah(playerid, params[])
  3498. {
  3499.     new id;
  3500.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ah [PlayerID]");  
  3501.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3502.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3503.     if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
  3504.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);        
  3505.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Tester aceitar o SEU pedido de ajuda!");
  3506.     if(playerinfo[id][pHelp] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não solicitou um pedido de ajuda!");    
  3507.     playerinfo[id][pHelp] = 0;              
  3508.     strmid(playerinfo[id][pHelpStr], "", 0, strlen(""), 255);
  3509.     format(string, sizeof(string), "O Tester %s está ciente sobre sua pergunta e te responderá quando possível!", GetName(playerid));    
  3510.     SendClientMessage(id, COLOR_SOS, string);                                                                                            
  3511.     format(string, sizeof(string), "Você está ciente sobre o pedido de ajuda de %s. Responda assim que possível!", GetName(id));    
  3512.     SendClientMessage(playerid, COLOR_SOS, string);    
  3513.     return 1;
  3514. }
  3515.  
  3516. CMD:rh(playerid, params[])
  3517. {
  3518.     new id;
  3519.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /rh [PlayerID]");  
  3520.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3521.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3522.     if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
  3523.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Tester recusar o SEU pedido de ajuda!");
  3524.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);    
  3525.     if(playerinfo[id][pHelp] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não solicitou um pedido de ajuda!");    
  3526.     playerinfo[id][pHelp] = 0;              
  3527.     strmid(playerinfo[id][pHelpStr], "", 0, strlen(""), 255);
  3528.     format(string, sizeof(string), "O Tester %s recusou o seu pedido de ajuda!", GetName(playerid));    
  3529.     SendClientMessage(id, COLOR_SOS, string);                                                                                            
  3530.     format(string, sizeof(string), "Você recusou o pedido de ajuda de %s. Explique-o se possível o motivo!", GetName(id));    
  3531.     SendClientMessage(playerid, COLOR_SOS, string);    
  3532.     return 1;
  3533. }
  3534.  
  3535. CMD:checarsos(playerid, params[])
  3536. {
  3537.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3538.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3539.     if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
  3540.     SendClientMessage(playerid, COLOR_SOS, "        [Lista de SOS's ativos]");                  
  3541.     for(new i = 0; i < MAX_PLAYERS; i++)    
  3542.     {    
  3543.         if(playerinfo[i][pHelp] == 1)        
  3544.         {                
  3545.             SendClientMessage(playerid, COLOR_SOS, playerinfo[i][pHelpStr]);            
  3546.             return 1;
  3547.         }
  3548.     }
  3549.     return 1;    
  3550. }
  3551.  
  3552. CMD:testers(playerid, params[])
  3553. {
  3554.     SendClientMessage(playerid, COLOR_OFFDUTY, "               [Testers Online]");
  3555.     for(new i = 0; i < MAX_PLAYERS; i++)    
  3556.     {    
  3557.         if(playerinfo[i][pTester] > 0)        
  3558.         {        
  3559.             if(playerinfo[i][pTesterDuty] == 0)            
  3560.             {            
  3561.                 format(string, sizeof(string), "[Level: %d] %s [%d] (offDuty)", playerinfo[i][pTester], GetName(i), i);                
  3562.                 SendClientMessage(playerid, COLOR_OFFDUTY, string);
  3563.             }            
  3564.             else            
  3565.             {            
  3566.                 format(string, sizeof(string), "[Level: %d] %s [%d] (onDuty)", playerinfo[i][pTester], GetName(i), i);                
  3567.                 SendClientMessage(playerid, COLOR_ONDUTY, string);  
  3568.             }
  3569.         }
  3570.     }    
  3571.     return 1;
  3572. }
  3573.  
  3574. CMD:admins(playerid, params[])
  3575. {
  3576.     SendClientMessage(playerid, COLOR_OFFDUTY, "               [Administradores Online]");
  3577.     for(new i = 0; i < MAX_PLAYERS; i++)    
  3578.     {    
  3579.         if(playerinfo[i][pAdmin] > 0)        
  3580.         {        
  3581.             if(playerinfo[i][pAdminDuty] == 0)            
  3582.             {            
  3583.                 format(string, sizeof(string), "[Level: %d] %s [ID:%d] (offDuty)", playerinfo[i][pAdmin], GetName(i), i);                
  3584.                 SendClientMessage(playerid, COLOR_OFFDUTY, string);
  3585.             }            
  3586.             else            
  3587.             {            
  3588.                 format(string, sizeof(string), "[Level: %d] %s [%d] (onDuty)", playerinfo[i][pAdmin], GetName(i), i);                
  3589.                 SendClientMessage(playerid, COLOR_ONDUTY, string);  
  3590.             }
  3591.         }
  3592.     }    
  3593.     return 1;
  3594. }
  3595.  
  3596. CMD:aduty(playerid, params[])
  3597. {
  3598.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3599.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3600.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3601.     if(playerinfo[playerid][pAdminDuty] == 0)
  3602.     {
  3603.         playerinfo[playerid][pAdminDuty] = 1;        
  3604.         SetPlayerColor(playerid, COLOR_ADM);  
  3605.         SendClientMessage(playerid, COLOR_ADM, "Você entrou em Admin Duty!");      
  3606.     }                                                  
  3607.     else    
  3608.     {    
  3609.         playerinfo[playerid][pAdminDuty] = 0;        
  3610.         SetPlayerColor(playerid, COLOR_CIVILIAN);
  3611.         SendClientMessage(playerid, COLOR_ADM, "Você saiu do Admin Duty!");  
  3612.     }          
  3613.     return 1;
  3614. }
  3615.  
  3616. CMD:tduty(playerid, params[])
  3617. {
  3618.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3619.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3620.     if(playerinfo[playerid][pTester] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Testers tenham acesso à este comando! ");
  3621.     if(playerinfo[playerid][pTesterDuty] == 0)
  3622.     {
  3623.         playerinfo[playerid][pTesterDuty] = 1;        
  3624.         SetPlayerColor(playerid, COLOR_TESTER);
  3625.         SendClientMessage(playerid, COLOR_TESTER, "Você entrou em Tester Duty!");        
  3626.     }                                                  
  3627.     else    
  3628.     {    
  3629.         playerinfo[playerid][pTesterDuty] = 0;        
  3630.         SetPlayerColor(playerid, COLOR_CIVILIAN);
  3631.         SendClientMessage(playerid, COLOR_TESTER, "Você saiu do Tester Duty!");  
  3632.     }          
  3633.     return 1;
  3634. }
  3635.  
  3636. CMD:mascara(playerid, params[])
  3637. {
  3638.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3639.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3640.     if(playerinfo[playerid][pMask] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui uma máscara!");            
  3641.     new subcmd[128];
  3642.     if(sscanf(params, "s[128]", subcmd)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /mascara [colocar | retirar]");
  3643.     if(!strcmp(subcmd, "colocar", true))
  3644.     {
  3645.         if(playerinfo[playerid][pMascarado] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você já está utilizando a sua máscara!");        
  3646.         playerinfo[playerid][pMascarado] = 1;
  3647.         GameTextForPlayer(playerid, "Voce colocou sua mascara", 3000, 5);
  3648.         Delete3DTextLabel(MaskText[playerid]);
  3649.         format(string, sizeof(string), "[Desconhecido_%s]", GetMaskID(playerid));        
  3650.         return 1;
  3651.     }
  3652.     if(!strcmp(subcmd, "retirar", true))
  3653.     {
  3654.         if(playerinfo[playerid][pMascarado] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está utilizando a sua máscara!");        
  3655.         playerinfo[playerid][pMascarado] = 0;
  3656.         GameTextForPlayer(playerid, "Voce retirou sua mascara", 3000, 5);
  3657.         Delete3DTextLabel(MaskText[playerid]);              
  3658.         return 1;
  3659.     }                
  3660.     return 1;
  3661. }
  3662.  
  3663. CMD:mascarados(playerid, params[])
  3664. {
  3665.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3666.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  3667.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");    
  3668.     SendClientMessage(playerid, COLOR_SOS, "        [Usuários Mascarados]");
  3669.     for(new i = 0; i < MAX_PLAYERS; i++)
  3670.     {
  3671.         if(playerinfo[i][pMascarado] == 1)        
  3672.         {        
  3673.             format(string, sizeof(string), "%s [ID:%d] MaskID: %s", GetName(i), i, playerinfo[i][pMaskID]);            
  3674.             SendClientMessage(playerid, COLOR_SOS, string);            
  3675.             return 1;
  3676.         }
  3677.     }                    
  3678.     return 1;
  3679. }
  3680.  
  3681. CMD:reportar(playerid, params[])
  3682. {
  3683.     new sos[128], id;    
  3684.     if(sscanf(params, "us[128]", id, sos)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /reportar [ID] [Motivo]");    
  3685.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3686.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);  
  3687.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode se reportar!");
  3688.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);                    
  3689.     if(playerinfo[playerid][pReport] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você já reportou um player! Aguarde uma resposta da equipe administrativa!");
  3690.     format(string, sizeof(string), "[Report] %s [%d] reportou %s [ID: %d]. Motivo: %s (/ar | /rr)", GetName(playerid), playerid, GetName(id), id, sos);
  3691.     for(new i = 0; i < MAX_PLAYERS; i++)
  3692.     {
  3693.         if(playerinfo[i][pAdminDuty] == 1)            
  3694.         {            
  3695.             SendClientMessage(i, COLOR_SOS, string);  
  3696.         }                                                      
  3697.     }                                              
  3698.     playerinfo[playerid][pReport] = 1;                                                                                          
  3699.     strmid(playerinfo[playerid][pReportStr], string, 0, sizeof(string), 255);
  3700.     SendClientMessage(playerid, COLOR_SUCESS, "Seu report foi encaminhado para os Administradores disponíveis, seja paciente!");  
  3701.     return 1;    
  3702. }
  3703.  
  3704. CMD:ar(playerid, params[])
  3705. {
  3706.     new id;
  3707.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ar [PlayerID]");  
  3708.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3709.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3710.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3711.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);        
  3712.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Admin aceitar o SEU report!");
  3713.     if(playerinfo[id][pReport] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não enviou um report!");    
  3714.     playerinfo[id][pReport] = 0;              
  3715.     strmid(playerinfo[id][pReportStr], "", 0, strlen(""), 255);
  3716.     format(string, sizeof(string), "O Admin %s está ciente sobre sua report e te responderá quando possível!", GetName(playerid));    
  3717.     SendClientMessage(id, COLOR_SOS, string);                                                                                            
  3718.     format(string, sizeof(string), "Você está ciente sobre o report de %s. Resolva que possível!", GetName(id));    
  3719.     SendClientMessage(playerid, COLOR_SOS, string);    
  3720.     return 1;
  3721. }
  3722.  
  3723. CMD:rr(playerid, params[])
  3724. {
  3725.     new id;
  3726.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /rr [PlayerID]");  
  3727.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3728.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3729.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3730.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Aguarde outro Admin recusar o SEU report!");
  3731.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);    
  3732.     if(playerinfo[id][pReport] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não enviou um report!");    
  3733.     playerinfo[id][pReport] = 0;              
  3734.     strmid(playerinfo[id][pReportStr], "", 0, strlen(""), 255);
  3735.     format(string, sizeof(string), "O Admin %s recusou a sua report!", GetName(playerid));    
  3736.     SendClientMessage(id, COLOR_SOS, string);                                                                                            
  3737.     format(string, sizeof(string), "Você recusou report de %s. Explique-o se possível o motivo!", GetName(id));    
  3738.     SendClientMessage(playerid, COLOR_SOS, string);    
  3739.     return 1;
  3740. }        
  3741.  
  3742. CMD:checarreports(playerid, params[])
  3743. {
  3744.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3745.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3746.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3747.     SendClientMessage(playerid, COLOR_SOS, "        [Lista de Report's ativas]");                  
  3748.     for(new i = 0; i < MAX_PLAYERS; i++)    
  3749.     {    
  3750.         if(playerinfo[i][pReport] == 1)        
  3751.         {                
  3752.             SendClientMessage(playerid, COLOR_SOS, playerinfo[i][pReportStr]);            
  3753.         }
  3754.     }
  3755.     return 1;    
  3756. }
  3757.  
  3758. CMD:ajail(playerid, params[])
  3759. {
  3760.     new id, time, reason[128];
  3761.     if(sscanf(params, "uds[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ajail [PlayerID] [Minutos] [Motivo]");
  3762.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3763.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3764.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3765.     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!");
  3766.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);    
  3767.     format(string, sizeof(string), "[ADMCMD] %s foi preso por %d minutos pelo administrador %s. Motivo: %s", GetName(id), time, GetName(playerid), reason);        
  3768.     SendClientMessageToAll(COLOR_BAN, string);            
  3769.     format(string, sizeof(string), "[%s] [Ajail] O Administrador %s prendeu %s por %d minutos. Motivo: %s", getDateEx(), GetName(playerid), GetName(id), time, reason);
  3770.     Log("AdminCMD.log", string);            
  3771.     SetPlayerInterior(id, 5);        
  3772.     SetPlayerPos(id, 322.197998, 302.497985, 999.148437);        
  3773.     playerinfo[id][pJailTime] = time*60;
  3774.     playerinfo[id][pJailed] = 1;
  3775.     playerinfo[id][pJailType] = 3;                
  3776.     SendClientMessage(id, COLOR_NEUTRAL2, "Eu recomendaria você a rever as regras que você quebrou!");        
  3777.     SendClientMessage(id, COLOR_NEUTRAL2, "Se você importunar muito o administrador que te puniu, ele poderá dobrar o seu tempo!");
  3778.     format(string, sizeof(string), "%s_AdminRecord.log", GetName(id));
  3779.     new text[512];
  3780.     format(text, sizeof(text), "[Ajail] %s foi preso pelo Administrador %s por %d minutos. Motivo: %s", GetName(id), GetName(playerid), time, reason);  
  3781.     Log(string, text);        
  3782.     SaveUser(id);          
  3783.     return 1;
  3784. }
  3785.  
  3786. CMD:kick(playerid, params[])
  3787. {
  3788.     new id, reason[128];
  3789.     if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /kick [PlayerID] [Motivo]");
  3790.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3791.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3792.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3793.     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!");    
  3794.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  3795.     format(string, sizeof(string), "[ADMCMD] %s foi kickado pelo administrador %s. Motivo: %s", GetName(id), GetName(playerid), reason);
  3796.     SendClientMessageToAll(COLOR_BAN, string);                                                                                                                        
  3797.     Kick(id);        
  3798.     format(string, sizeof(string), "[%s] [Kick] O Administrador %s kickou %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(id), reason);
  3799.     Log("AdminCMD.log", string);                  
  3800.     format(string, sizeof(string), "%s_AdminRecord.log", GetName(id));
  3801.     new text[512];
  3802.     format(text, sizeof(text), "[Kick] %s foi kickado pelo Administrador %s Motivo: %s", GetName(id), GetName(playerid), reason);  
  3803.     Log(string, text);
  3804.     return 1;
  3805. }
  3806.  
  3807. CMD:ban(playerid, params[])
  3808. {
  3809.     new id, reason[128];
  3810.     if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ban [PlayerID] [Motivo]");
  3811.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3812.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3813.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3814.     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!");    
  3815.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  3816.     format(string, sizeof(string), "[ADMCMD] %s foi banido pelo administrador %s. Motivo: %s", GetName(id), GetName(playerid), reason);
  3817.     SendClientMessageToAll(COLOR_BAN, string);                                                                                                                        
  3818.     Ban(id);        
  3819.     format(string, sizeof(string), "[%s] [Ban] O Administrador %s baniu %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(id), reason);
  3820.     Log("AdminCMD.log", string);  
  3821.     format(string, sizeof(string), "%s_AdminRecord.log", GetName(id));
  3822.     new text[512];
  3823.     format(text, sizeof(text), "[Ban] %s foi Banido pelo Administrador %s Motivo: %s", GetName(id), GetName(playerid), reason);  
  3824.     Log(string, text);        
  3825.     return 1;
  3826. }
  3827.  
  3828. CMD:tapa(playerid, params[])
  3829. {
  3830.     new id;
  3831.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /tapa [PlayerID]");
  3832.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3833.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3834.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3835.     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!");    
  3836.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  3837.     SendClientMessage(playerid, COLOR_SUCESS, "O jogador foi tapeado!");            
  3838.     new Float: x,            
  3839.         Float: y,                
  3840.         Float: z;                
  3841.                                
  3842.     GetPlayerPos(id, x, y, z);            
  3843.     SetPlayerPos(id, x, y, z+10.0);            
  3844.     PlayerPlaySound(id, 1130, 0.0, 0.0, 0.0);            
  3845.     format(string, sizeof(string), "[%s] [Slap] O Administrador %s tapeou %s!", getDateEx(), GetName(playerid), GetName(id));
  3846.     Log("AdminCMD.log", string);        
  3847.     return 1;
  3848. }
  3849.  
  3850. CMD:ir(playerid, params[])
  3851. {
  3852.     new id;
  3853.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ir [PlayerID]");
  3854.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3855.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3856.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");    
  3857.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  3858.     new Float: X,            
  3859.         Float: Y,                
  3860.         Float: Z;                
  3861.                                
  3862.     GetPlayerPos(id, X, Y, Z);            
  3863.     SetPlayerPos(playerid, X, Y, Z);                                    
  3864.     format(string, sizeof(string), "[%s] [Ir] O Administrador %s teleportou-se até %s!", getDateEx(), GetName(playerid), GetName(id));
  3865.     Log("AdminCMD.log", string);      
  3866.     return 1;
  3867. }
  3868.  
  3869. CMD:spec(playerid, params[])
  3870. {
  3871.     new id;
  3872.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ir [PlayerID]");
  3873.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3874.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3875.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");    
  3876.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  3877.     TogglePlayerSpectating(playerid, 1);
  3878.     if(IsPlayerInAnyVehicle(id))
  3879.     {
  3880.         PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
  3881.     }
  3882.     else
  3883.     {
  3884.         PlayerSpectatePlayer(playerid, id);
  3885.     }                                                  
  3886.     GameTextForPlayer(playerid, "Para sair de Spec, pressione ~k~~PED_DUCK~", 5000, 5);
  3887.     format(string, sizeof(string), "[%s] [Spec] %s espiou %s", getDateEx(), GetName(playerid), GetName(id));            
  3888.     playerinfo[playerid][pSpectating] = 1;
  3889.     Log("AdminCMD.log", string);
  3890.     return 1;  
  3891. }
  3892.  
  3893. CMD:darlider(playerid, params[])
  3894. {
  3895.     new id, factionid;    
  3896.     if(sscanf(params, "ud", id, factionid)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /darlider [PlayerID] [FactionID]");    
  3897.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3898.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3899.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");
  3900.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);    
  3901.     playerinfo[id][pFaction] = factionid;    
  3902.     playerinfo[id][pRank] = 10;    
  3903.     format(string, sizeof(string), "Você tornou %s o líder da facção ID %d (Nome: %s)", GetName(id), factionid, factioninfo[factionid-1][fName]);    
  3904.     SendClientMessage(playerid, COLOR_SUCESS, string);                                                                                              
  3905.     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]);    
  3906.     SendClientMessage(playerid, COLOR_SUCESS, string);
  3907.     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]);  
  3908.     Log("AdminCMD.log", string);
  3909.     return 1;
  3910. }
  3911.  
  3912. CMD:ircarro(playerid, params[])
  3913. {
  3914.     new vehid;    
  3915.     if(sscanf(params, "d", vehid)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ircarro [VehicleID]");    
  3916.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3917.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3918.     if(playerinfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins tenham acesso à este comando! ");      
  3919.     if(vehid < 1 || vehid > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");  
  3920.     new Float: x,
  3921.         Float: y,
  3922.         Float: z;  
  3923.     GetVehiclePos(vehid, x, y, z);                                                                                                                
  3924.     if(vehicleinfo[vehid][vSQLID] == 0 && vehicleinfo[vehid][vCreated] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe no sistema!");
  3925.     SetPlayerPos(playerid, x+3, y, z);
  3926.     format(string, sizeof(string), "[Teleporte] O Administrador %s teleportou-se ao veículo %d.", GetName(playerid), vehid);  
  3927.     Log("AdminCMD.log", string);
  3928.     return 1;
  3929. }
  3930.  
  3931. CMD:editar(playerid, params[])
  3932. {
  3933.     new targetid, subcmd[128], value;
  3934.     if(sscanf(params, "us[128]d(-1)", targetid, subcmd, value))
  3935.     {
  3936.         SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [StatName] [Valor]");        
  3937.         SendClientMessage(playerid, COLOR_SOS, "      [Funções]");        
  3938.         SendClientMessage(playerid, COLOR_SOS, "Level | Dinheiro | Banco | Tester | Faction");        
  3939.         SendClientMessage(playerid, COLOR_SOS, "Rank | Skin | SpawnType | Emprego");
  3940.     }              
  3941.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  3942.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  3943.     if(playerinfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins (5+) tenham acesso à este comando! ");
  3944.     if(!strcmp(subcmd, "level", true))
  3945.     {
  3946.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Level] [Valor]");
  3947.         if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");        
  3948.         playerinfo[targetid][pLevel] = value;        
  3949.         format(string, sizeof(string), "Você editou com sucesso o Level de %s para %d!", GetName(targetid), value);        
  3950.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  3951.         format(string, sizeof(string), "O Administrador %s editou seu Level para %d!", GetName(playerid), value);        
  3952.         SendClientMessage(targetid, COLOR_SUCESS, string);
  3953.         return 1;        
  3954.     }    
  3955.     if(!strcmp(subcmd, "dinheiro", true))
  3956.     {
  3957.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Dinheiro] [Valor]");  
  3958.         if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");    
  3959.         playerinfo[targetid][pMoney] = value;        
  3960.         format(string, sizeof(string), "Você editou com sucesso o Dinheiro de %s para %d!", GetName(targetid), value);        
  3961.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  3962.         format(string, sizeof(string), "O Administrador %s editou seu Dinheiro para %d!", GetName(playerid), value);        
  3963.         SendClientMessage(targetid, COLOR_SUCESS, string);        
  3964.         ResetPlayerMoney(targetid);        
  3965.         GivePlayerMoney(targetid, value);
  3966.         return 1;        
  3967.     }
  3968.     if(!strcmp(subcmd, "banco", true))
  3969.     {
  3970.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Banco] [Valor]");                    
  3971.         if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");
  3972.         playerinfo[targetid][pBank] = value;        
  3973.         format(string, sizeof(string), "Você editou com sucesso o Banco de %s para %d!", GetName(targetid), value);        
  3974.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  3975.         format(string, sizeof(string), "O Administrador %s editou seu Banco para %d!", GetName(playerid), value);        
  3976.         SendClientMessage(targetid, COLOR_SUCESS, string);
  3977.         return 1;        
  3978.     }      
  3979.     if(!strcmp(subcmd, "tester", true))
  3980.     {
  3981.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Tester] [Valor]");      
  3982.         if(value == 0 || value < -1 || value > 4) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 4!");  
  3983.         playerinfo[targetid][pTester] = value;        
  3984.         format(string, sizeof(string), "Você editou com sucesso o Level de Tester %s para %d!", GetName(targetid), value);        
  3985.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  3986.         format(string, sizeof(string), "O Administrador %s editou seu Level de Tester para %d!", GetName(playerid), value);        
  3987.         SendClientMessage(targetid, COLOR_SUCESS, string);
  3988.         return 1;        
  3989.     }      
  3990.     if(!strcmp(subcmd, "faction", true))
  3991.     {
  3992.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Faction] [Valor]");                  
  3993.         if(value == 0 || value < -1 || value > 40) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 40!");
  3994.         playerinfo[targetid][pFaction] = value;        
  3995.         format(string, sizeof(string), "Você editou com sucesso a Faction de %s para %d!", GetName(targetid), value);        
  3996.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  3997.         format(string, sizeof(string), "O Administrador %s editou sua Faction para %d!", GetName(playerid), value);        
  3998.         SendClientMessage(targetid, COLOR_SUCESS, string);
  3999.         return 1;        
  4000.     }    
  4001.     if(!strcmp(subcmd, "rank", true))
  4002.     {
  4003.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Rank] [Valor]");    
  4004.         if(value == 0 || value < -1 || value > 10) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 10!");  
  4005.         playerinfo[targetid][pRank] = value;        
  4006.         format(string, sizeof(string), "Você editou com sucesso o Rank de %s para %d!", GetName(targetid), value);        
  4007.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  4008.         format(string, sizeof(string), "O Administrador %s editou seu Rank para %d!", GetName(playerid), value);        
  4009.         SendClientMessage(targetid, COLOR_SUCESS, string);
  4010.         return 1;        
  4011.     }    
  4012.     if(!strcmp(subcmd, "skin", true))
  4013.     {
  4014.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Skin] [Valor]");
  4015.         if(value < -1 || value == 0 || value > 299) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 299!");        
  4016.         playerinfo[targetid][pSkin] = value;        
  4017.         format(string, sizeof(string), "Você editou com sucesso a Skin de %s para %d!", GetName(targetid), value);        
  4018.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  4019.         format(string, sizeof(string), "O Administrador %s editou sua Skin para %d!", GetName(playerid), value);        
  4020.         SendClientMessage(targetid, COLOR_SUCESS, string);                        
  4021.         SetPlayerSkin(targetid, value);
  4022.         return 1;        
  4023.     }    
  4024.     if(!strcmp(subcmd, "spawntype", true))
  4025.     {
  4026.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [SpawnType] [Valor]");    
  4027.         if(value == 0 || value < -1 || value > 3) return SendClientMessage(playerid, COLOR_ERROR, "Os valores variam de 1 à 3!");  
  4028.         playerinfo[targetid][pSpawnType] = value;        
  4029.         format(string, sizeof(string), "Você editou com sucesso o SpawnType de %s para %d!", GetName(targetid), value);        
  4030.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  4031.         format(string, sizeof(string), "O Administrador %s editou seu SpawnType para %d!", GetName(playerid), value);        
  4032.         SendClientMessage(targetid, COLOR_SUCESS, string);
  4033.         return 1;        
  4034.     }    
  4035.     if(!strcmp(subcmd, "emprego", true))
  4036.     {
  4037.         if(value == -1) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /editar [PlayerID] [Emprego] [Valor]");                                        
  4038.         if(value == 0 || value < -1) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 1!");
  4039.         playerinfo[targetid][pJob] = value;        
  4040.         format(string, sizeof(string), "Você editou com sucesso o Emprego de %s para %d!", GetName(targetid), value);        
  4041.         SendClientMessage(playerid, COLOR_SUCESS, string);        
  4042.         format(string, sizeof(string), "O Administrador %s editou seu Emprego para %d!", GetName(playerid), value);        
  4043.         SendClientMessage(targetid, COLOR_SUCESS, string);
  4044.         return 1;        
  4045.     }
  4046.     return 1;    
  4047. }
  4048.  
  4049. CMD:darvip(playerid, params[])
  4050. {
  4051.     new targetid, level, dias;    
  4052.     if(sscanf(params, "udd", targetid, level, dias))    
  4053.     {    
  4054.         SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /darvip [PlayerID] [Level] [Dias]");                            
  4055.         return SendClientMessage(playerid, COLOR_SOS, "[Leveis] 1(Bronze) | 2(Prata) | 3(Ouro) | 4(Diamante)");
  4056.     }              
  4057.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4058.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  4059.     if(playerinfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, " O script permite que apenas Admins level 5 tenham acesso à este comando! ");
  4060.     if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);        
  4061.     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!");        
  4062.     if(dias < 0 || dias > 365 ) return SendClientMessage(playerid, COLOR_ERROR, " O limite de Dias varia de 1 à 365 APENAS!");        
  4063.     if(level < 1 || level > 4) return SendClientMessage(playerid, COLOR_ERROR, " O level de donate varia entre 1 e 4 APENAS!");
  4064.     new levelnome[20];    
  4065.     if(level == 1)
  4066.     {  
  4067.         format(levelnome, sizeof(levelnome), "Bronze");
  4068.     }    
  4069.     if(level == 2)
  4070.     {  
  4071.         format(levelnome, sizeof(levelnome), "Prata");
  4072.     }  
  4073.     if(level == 3)
  4074.     {
  4075.         format(levelnome, sizeof(levelnome), "Ouro");
  4076.     }  
  4077.     if(level == 4)
  4078.     {
  4079.         format(levelnome, sizeof(levelnome), "Diamante");        
  4080.     }
  4081.     format(string, sizeof(string), "O Administrador %s modificou o seu vip para %s por %d dias.", GetName(playerid), levelnome, dias);
  4082.     SendClientMessage(targetid, COLOR_SOS, string);    
  4083.     format(string, sizeof(string), "Você modificou o Vip de %s para %s por %d dias.", GetName(targetid), levelnome, dias);
  4084.     SendClientMessage(playerid, COLOR_SUCESS, string);
  4085.     playerinfo[targetid][pDonate] = level;
  4086.     playerinfo[targetid][pDonatorExpire] = (86400*dias)+gettime();              
  4087.     printf("Dias: %d ( %d )", (86400*dias)+gettime(), dias);  
  4088.     SaveUser(targetid);    
  4089.     return 1;
  4090. }
  4091.  
  4092. CMD:v(playerid, params[])
  4093. {
  4094.     new subcmd[32], id;    
  4095.     if(sscanf(params, "s[32]I(-1)", subcmd, id))    
  4096.     {    
  4097.         SendClientMessage(playerid, COLOR_NEUTRAL2, "________________[Subcomandos Veiculares]________________");        
  4098.         SendClientMessage(playerid, COLOR_SOS, "SINTAXE: /v [Utilidade]");        
  4099.         SendClientMessage(playerid, COLOR_SOS, "[Utilidades]: lista | comprar | spawn | seguro | estacionar");
  4100.         SendClientMessage(playerid, COLOR_SOS, "[Utilidades]: comprarvaga (Custa $2500) | procurar | rebocar | ferrovelho");  
  4101.         SendClientMessage(playerid, COLOR_SOS, "[Utilidades]: trancar");      
  4102.         return 1;
  4103.     }            
  4104.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4105.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);    
  4106.     if(!strcmp(subcmd, "lista", true))    
  4107.     {    
  4108.         format(string, 128, "[Veículos de %s]", GetName(playerid));
  4109.         SendClientMessage(playerid, COLOR_NEUTRAL2, string);        
  4110.         new cars = 0;        
  4111.         new vstats[32] = "Não";                              
  4112.         new Name[128];
  4113.         for(new i = 0; i <= MAX_VEHICLES; i++ )
  4114.         {
  4115.             if(!strcmp(vehicleinfo[i][vOwner], GetName(playerid), true))
  4116.             {
  4117.                 if(vehicleinfo[i][vLocked] == 1)
  4118.                 {
  4119.                     vstats = "Sim";
  4120.                 }                              
  4121.                 GetVehicleName(vehicleinfo[i][vModel], Name, sizeof(Name));
  4122.                 cars = cars+1;
  4123.                 format(string, sizeof(string), "(ID:%i) [%i] | Modelo : %s, Alarme: %i, Tranca: %i, Immobiliser: %i, Trancado: %s, Seguro: %i, Vezes Destruído: %i", i,
  4124.                 vehicleinfo[i][vSQLID], Name, vehicleinfo[i][vAlarm],vehicleinfo[i][vLock],vehicleinfo[i][vImmobiliser], vstats, vehicleinfo[i][vInsurance], vehicleinfo[i][vTimesDestroyed]);
  4125.                 if(vehicleinfo[i][vInsurance] > 0 && GetVehicleVirtualWorld(i) > 0)
  4126.                 {
  4127.                     SendClientMessage(playerid, COLOR_NEUTRAL, string);                    
  4128.                 }                            
  4129.                 if(vehicleinfo[i][vInsurance] > 0 && GetVehicleVirtualWorld(i) == 0)
  4130.                 {
  4131.                     SendClientMessage(playerid, COLOR_SUCESS, string);                      
  4132.                 }                    
  4133.             }
  4134.         }
  4135.         if(cars == 0)
  4136.         {
  4137.             SendClientMessage(playerid, COLOR_ERROR, "Você atualmente não possui nenhum veículo!");
  4138.         }        
  4139.         return 1;
  4140.     }
  4141.     if(!strcmp(subcmd, "comprar", true))
  4142.     {
  4143.         if(!id || id == -1)
  4144.         {
  4145.             Dealerships(playerid);
  4146.             return 1;
  4147.         }            
  4148.         new preco = DealershipPrice(id), Nome[35];
  4149.         GetVehicleName(id, Nome, 35);
  4150.         if(DealershipValid(id, 1))
  4151.         {
  4152.             if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1702.9060,-1469.3427,13.5469)) return SendClientMessage(playerid, COLOR_ERROR, "Você não está na concessionária!");
  4153.             if(!DealershipPrice(id)) return SendClientMessage(playerid, COLOR_ERROR, "Você digitou um ID incorreto!");        
  4154.             if(playerinfo[playerid][pMoney] < preco) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4155.             format(string, 128, "Você comprou um %s por %i$, faça bom proveito do seu novo veículo.", Nome, DealershipPrice(id));
  4156.             SendClientMessage(playerid, COLOR_SUCESS, string);
  4157.             AddForSaleVehicle(playerid, id, 1700.2917,-1502.0557,13.3828,178.8378, preco);
  4158.             return 1;
  4159.         }
  4160.         if(DealershipValid(id, 2) == 1)
  4161.         {
  4162.             if(!IsPlayerInRangeOfPoint(playerid, 5.0, 411.9653,-1729.3180,9.3693)) return SendClientMessage(playerid, COLOR_ERROR, "Você não está na concessionária!");
  4163.             if(!DealershipPrice(id)) return SendClientMessage(playerid, COLOR_ERROR, "Voce digitou um ID incorreto!");
  4164.  
  4165.             format(string, 128, "Você comprou um %s por %i$, faça bom proveito do seu novo veículo.", Nome, DealershipPrice(id));
  4166.             SendClientMessage(playerid, COLOR_SUCESS, string);
  4167.             AddForSaleVehicle(playerid, id, 416.8412,-1722.7974,8.7789,178.8378, preco);
  4168.             return 1;
  4169.         }
  4170.         if(DealershipValid(id, 3) == 1)
  4171.         {
  4172.             if(!IsPlayerInRangeOfPoint(playerid, 5.0, 145.8890,-1834.8905,2.0585)) return SendClientMessage(playerid, COLOR_ERROR, "Você não está na concessionária.");
  4173.             if(!DealershipPrice(id)) return SendClientMessage(playerid, COLOR_ERROR, "Você digitou um ID incorreto!");
  4174.  
  4175.             format(string, 128, "Você comprou um %s por %i$, faça bom proveito do seu novo veículo.", Nome, DealershipPrice(id));
  4176.             SendClientMessage(playerid, COLOR_SUCESS, string);
  4177.             AddForSaleVehicle(playerid, id, 89.8989,-1834.7538,-0.5048,88.7344, preco);
  4178.             return 1;
  4179.         }
  4180.         return 1;    
  4181.     }
  4182.     if(!strcmp(subcmd, "spawn", true))
  4183.     {                
  4184.         if(!id || id == -1)
  4185.         {
  4186.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v spawn [vID]");
  4187.             return 1;
  4188.         }                                                                                                                          
  4189.         if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
  4190.         if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");                                                                        
  4191.         if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
  4192.         {                                                                                                                                
  4193.             if(vehicleinfo[id][vInsurance] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este veículo foi destruído por estar sem seguros!");
  4194.             if(GetVehicleVirtualWorld(id) == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este veículo já está spawnado!");
  4195.             new Fuel, OwnerName[32];
  4196.             Fuel = vehicleinfo[id][vFuel];  
  4197.             strmid(OwnerName, vehicleinfo[id][vOwner], 0, strlen(vehicleinfo[id][vOwner]), 255);
  4198.             DestroyVehicle(id);
  4199.             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);
  4200.             SetVehiclePos(vehicle, vehicleinfo[id][vParkPos1], vehicleinfo[id][vParkPos2], vehicleinfo[id][vParkPos3]);
  4201.             SetVehicleZAngle(vehicle, vehicleinfo[id][vParkPos4]);
  4202.             ChangeVehicleColor(vehicle, vehicleinfo[id][vColors1], vehicleinfo[id][vColors2]);
  4203.             strmid(vehicleinfo[vehicle][vOwner], OwnerName, 0, strlen(OwnerName), 255);
  4204.             SetVehicleVirtualWorld(vehicle, 0);
  4205.             vehicleinfo[vehicle][vFuel] = Fuel;                          
  4206.             SendClientMessage(playerid, COLOR_SUCESS, "Você spawnou seu veículo com sucesso!");  
  4207.             SetVehicleParamsEx(vehicle, 0, 0, 0, 1, 0, 0, 0);
  4208.             vehicleinfo[id][vLocked] = 1;
  4209.             vehicleinfo[id][vSpawned] = 1;        
  4210.         }        
  4211.         return 1;
  4212.     }
  4213.     if(!strcmp(subcmd, "seguro", true))
  4214.     {          
  4215.         if(!id || id == -1)
  4216.         {
  4217.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v seguro [vID]");
  4218.             return 1;
  4219.         }                                                                                                  
  4220.         if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
  4221.         if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
  4222.         if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");      
  4223.         new insurances = vehicleinfo[id][vInsurance];
  4224.         new model = vehicleinfo[id][vModel];        
  4225.         if(playerinfo[playerid][pMoney] < GetInsurancePrice(model, insurances)) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4226.         playerinfo[playerid][pMoney] -= GetInsurancePrice(model, insurances);
  4227.         GivePlayerMoney(playerid, -GetInsurancePrice(model, insurances));
  4228.         vehicleinfo[id][vInsurance] ++;    
  4229.         new Name[128];                                                                      
  4230.         GetVehicleName(vehicleinfo[id][vModel], Name, sizeof(Name));
  4231.         format(string, sizeof(string), "Você adiquiriu 1 seguro para seu %s por %d!", Name, GetInsurancePrice(model, insurances));
  4232.         SendClientMessage(playerid, COLOR_SUCESS, string);          
  4233.         return 1;
  4234.     }
  4235.     if(!strcmp(subcmd, "estacionar", true))
  4236.     {                                              
  4237.         if(!id || id == -1)
  4238.         {                    
  4239.             new vid = GetPlayerVehicleID(playerid);                                                                                                                                  
  4240.             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!");
  4241.             if(strcmp(GetName(playerid), vehicleinfo[vid][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");                  
  4242.             if(IsPlayerInRangeOfPoint(playerid, 5.0, vehicleinfo[vid][vParkPos1], vehicleinfo[vid][vParkPos2], vehicleinfo[vid][vParkPos3]))        
  4243.             {        
  4244.                 SetVehicleToRespawn(vid);            
  4245.                 SetVehicleVirtualWorld(vid, vid+1);            
  4246.                 SendClientMessage(playerid, COLOR_SUCESS, " Você estacionou o seu veículo nesta posição!");            
  4247.                 vehicleinfo[vid][vSpawned] = 0;
  4248.             }                                        
  4249.             else        
  4250.             {        
  4251.                 SendClientMessage(playerid, COLOR_ERROR, " O Script requer que você esteja perto da vaga comprada para utilizar este comando!");            
  4252.                 SetPlayerCheckpoint(playerid, vehicleinfo[vid][vParkPos1], vehicleinfo[vid][vParkPos2], vehicleinfo[vid][vParkPos3], 5.0);
  4253.             }
  4254.         }
  4255.         else
  4256.         {
  4257.             SendClientMessage(playerid, COLOR_ERROR, " Não utilize ID's para estacionar o veículo!");
  4258.         }                    
  4259.         return 1;
  4260.     }    
  4261.     if(!strcmp(subcmd, "comprarvaga", true))
  4262.     {
  4263.         if(!id || id == -1)
  4264.         {                    
  4265.             new vid = GetPlayerVehicleID(playerid);                                                                                                                                  
  4266.             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!");
  4267.             if(strcmp(GetName(playerid), vehicleinfo[vid][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
  4268.             if(playerinfo[playerid][pMoney] < 2500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);                  
  4269.             new Float: w,
  4270.                 Float: x,
  4271.                 Float: y,
  4272.                 Float: z;
  4273.                
  4274.             GetVehiclePos(vid, x, y, z);
  4275.             GetVehicleZAngle(vid, w);        
  4276.             vehicleinfo[vid][vParkPos1] = x;
  4277.             vehicleinfo[vid][vParkPos2] = y;
  4278.             vehicleinfo[vid][vParkPos3] = z;
  4279.             vehicleinfo[vid][vParkPos4] = w;  
  4280.             SetVehicleToRespawn(vid);            
  4281.             SetVehicleVirtualWorld(vid, vid+1);            
  4282.             SendClientMessage(playerid, COLOR_SUCESS, " Você estacionou o seu veículo nesta posição!");    
  4283.             playerinfo[playerid][pMoney] -= 2500;
  4284.             GivePlayerMoney(playerid, -2500);        
  4285.             vehicleinfo[vid][vSpawned] = 0;
  4286.         }
  4287.         else
  4288.         {
  4289.             SendClientMessage(playerid, COLOR_ERROR, " Não utilize ID's para comprar a vaga!");
  4290.         }                                                        
  4291.         return 1;
  4292.     }
  4293.     if(!strcmp(subcmd, "procurar", true))
  4294.     {      
  4295.         if(!id || id == -1)
  4296.         {
  4297.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v procurar [vID]");
  4298.             return 1;
  4299.         }
  4300.         if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
  4301.         if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
  4302.         if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");        
  4303.         new block;
  4304.         for(new i = 0; i < MAX_PLAYERS; i++)
  4305.         {
  4306.             if(IsPlayerInVehicle(i, id))            
  4307.             {            
  4308.                 block = 1;                  
  4309.                 return 1;
  4310.             }
  4311.         }      
  4312.         if(block == 0)
  4313.         {  
  4314.             new Float: x, Float: y, Float: z;
  4315.             GetVehiclePos(id, x, y, z);
  4316.             SetPlayerCheckpoint(playerid, x, y, z, 3.0);
  4317.             SendClientMessage(playerid, COLOR_SOS, "Siga o checkpoint para encontrar o seu veículo!");            
  4318.             return 1;
  4319.         }
  4320.         if(block == 1)
  4321.         {
  4322.             SendClientMessage(playerid, COLOR_ERROR, "Existe alguém dentro do seu veículo, não posso encontrá-lo!");                    
  4323.             return 1;
  4324.         }                
  4325.         return 1;
  4326.     }                
  4327.     if(!strcmp(subcmd, "rebocar", true))        
  4328.     {          
  4329.         if(!id || id == -1)
  4330.         {
  4331.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v rebocar [vID]");
  4332.             return 1;
  4333.         }
  4334.         if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
  4335.         if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
  4336.         if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");    
  4337.         if(playerinfo[playerid][pMoney] < 1000) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);                    
  4338.         new block;
  4339.         for(new i = 0; i < MAX_PLAYERS; i++)
  4340.         {
  4341.             if(IsPlayerInVehicle(i, id))            
  4342.             {            
  4343.                 block = 1;                  
  4344.                 return 1;
  4345.             }
  4346.         }      
  4347.         if(block == 0)
  4348.         {  
  4349.             TowingCar[playerid] = 10;            
  4350.             TowedCar[playerid] = id;            
  4351.             return 1;
  4352.         }
  4353.         if(block == 1)
  4354.         {
  4355.             SendClientMessage(playerid, COLOR_ERROR, "Existe alguém dentro do seu veículo, não posso rebocá-lo!");            
  4356.             return 1;
  4357.         }                
  4358.         return 1;
  4359.     }
  4360.     if(!strcmp(subcmd, "ferrovelho", true))
  4361.     {      
  4362.         if(!id || id == -1)
  4363.         {
  4364.             SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /v ferrovelho [vID]");            
  4365.             SendClientMessage(playerid, COLOR_SOS, "ATENÇÃO: Este comando DELETARÁ o seu veículo e você receberá 50 porcento do valor do mesmo!");
  4366.             return 1;
  4367.         }
  4368.         if(id < 1 || id > 2001) return SendClientMessage(playerid, COLOR_ERROR, " As ID's dos veículos alternam entre 1 e 2000 APENAS!");
  4369.         if(vehicleinfo[id][vSQLID] == 0) return SendClientMessage(playerid, COLOR_ERROR, " Este veículo não existe!");
  4370.         if(strcmp(GetName(playerid), vehicleinfo[id][vOwner], true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não é o dono deste veículo!");
  4371.         strmid(vehicleinfo[id][vOwner], "FerroVelho", 0, 10, 255);
  4372.         SetVehicleToRespawn(id);
  4373.         SetVehicleVirtualWorld(id, id+1);    
  4374.         new Name[128];                                                  
  4375.         new price = DealershipPrice(vehicleinfo[id][vModel]);
  4376.         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);        
  4377.         SendClientMessage(playerid, COLOR_SOS, string);                                                                                                                                        
  4378.         playerinfo[playerid][pMoney] += price/2;        
  4379.         GivePlayerMoney(playerid, price/2);
  4380.         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);
  4381.         Log("FerroVelho.log", string);                    
  4382.         return 1;              
  4383.     }  
  4384.     if(!strcmp(subcmd, "trancar", true))
  4385.     {                  
  4386.         new Float: x,        
  4387.             Float: y,            
  4388.             Float: z,            
  4389.             engine, lights, alarm, doors, bonnet, boot, objective;
  4390.         for(new i = 0; i < MAX_VEHICLES; i++)        
  4391.         {                                                                                    
  4392.             if(!strcmp(vehicleinfo[i][vOwner], GetName(playerid), true) && vehicleinfo[i][vSpawned] == 1)            
  4393.             {
  4394.                 GetVehiclePos(i, x, y, z);                
  4395.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))                
  4396.                 {                
  4397.                     if(vehicleinfo[i][vLocked] == 1)                    
  4398.                     {                    
  4399.                         vehicleinfo[i][vLocked] = 0;                        
  4400.                         GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);                            
  4401.                         SetVehicleParamsEx(i, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);                        
  4402.                         new name[128];                        
  4403.                         GetVehicleName(vehicleinfo[i][vModel], name, 128);
  4404.                         format(string, sizeof(string), "~g~%s destrancado", name);                        
  4405.                         GameTextForPlayer(playerid, string, 1000, 5);                                        
  4406.                         return 1;
  4407.                     }                    
  4408.                     if(vehicleinfo[i][vLocked] == 0)                    
  4409.                     {                    
  4410.                         vehicleinfo[i][vLocked] = 1;                        
  4411.                         GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);                            
  4412.                         SetVehicleParamsEx(i, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);    
  4413.                         new name[128];                        
  4414.                         GetVehicleName(vehicleinfo[i][vModel], name, 128);                        
  4415.                         format(string, sizeof(string), "~r~%s trancado", name);                        
  4416.                         GameTextForPlayer(playerid, string, 1000, 5);
  4417.                     }
  4418.                 }
  4419.             }    
  4420.         }              
  4421.         return 1;              
  4422.     }
  4423.     return 1;
  4424. }
  4425.  
  4426. CMD:motor(playerid, params[])
  4427. {
  4428.     new engine, lights, alarm, doors, bonnet, boot, objective;
  4429.     new i = GetPlayerVehicleID(playerid);
  4430.     if(strcmp(vehicleinfo[i][vOwner], GetName(playerid), true)) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui as chaves deste veículo!");    
  4431.     if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_ERROR, "Você não está dentro de seu veículo!");
  4432.     GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);    
  4433.     if(vehicleinfo[i][vEngine] == 0)    
  4434.     {
  4435.         SetVehicleParamsEx(i, 1, lights, alarm, doors, bonnet, boot, objective);
  4436.         format(string, sizeof(string), "* %s vira a chave na ignição, ligando o veículo", GetName(playerid));
  4437.         SetPlayerChatBubble(playerid, string, COLOR_ACTION, 30.0, 5000);          
  4438.         vehicleinfo[i][vEngine] = 1;        
  4439.         return 1;
  4440.     }
  4441.     if(vehicleinfo[i][vEngine] == 1)    
  4442.     {
  4443.         SetVehicleParamsEx(i, 0, lights, alarm, doors, bonnet, boot, objective);
  4444.         format(string, sizeof(string), "* %s vira a chave na ignição, desligando o veículo", GetName(playerid));
  4445.         SetPlayerChatBubble(playerid, string, COLOR_ACTION, 30.0, 5000);              
  4446.         vehicleinfo[i][vEngine] = 0;
  4447.     }          
  4448.     return 1;
  4449. }
  4450.  
  4451. CMD:stats(playerid, params[])
  4452. {
  4453.     ShowStats(playerid, playerid);
  4454.     return 1;
  4455. }
  4456.  
  4457. CMD:darpayday(playerid, params[])
  4458. {
  4459.     if(playerinfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas adminsitradores level 1338+ desfrutem deste comando!");    
  4460.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4461.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4462.     Payday();
  4463.     return 1;
  4464. }
  4465.  
  4466. CMD:minhasdrogas(playerid, params[])
  4467. {
  4468.     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],
  4469.     druginfo[playerid][pHeroina], druginfo[playerid][pCachimbo], druginfo[playerid][pLSD], druginfo[playerid][pMaconha], druginfo[playerid][pHaxixe], druginfo[playerid][pAgulhas]);
  4470.     SendClientMessage(playerid, COLOR_SOS, string);
  4471.     return 1;    
  4472. }
  4473.  
  4474. CMD:dararma(playerid, params[])
  4475. {
  4476.     new id, weapon, ammo;
  4477.     if(playerinfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas adminsitradores level 3+ desfrutem deste comando!");    
  4478.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4479.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);                                      
  4480.     if(sscanf(params, "udd", id, weapon, ammo)) return SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /dararma [PlayerID] [WeaponID] [Munição]");          
  4481.     if(weapon < 1 || weapon > 46) return SendClientMessage(playerid, COLOR_ERROR, "Os ID's das armas variam de 1 à 46 APENAS!");    
  4482.     GivePlayerWeapon(id, weapon, ammo);    
  4483.     return 1;
  4484. }
  4485.  
  4486. CMD:aceitarmorte(playerid, params[])
  4487. {
  4488.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4489.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);              
  4490.     if(playerinfo[playerid][pMorto] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está morto!");
  4491.     playerinfo[playerid][pMorto] = 0;
  4492.     SetPlayerPos(playerid, 0, 0, 0);
  4493.     ClearAnimations(playerid);
  4494.     SetCameraBehindPlayer(playerid);
  4495.     SetPlayerInterior(playerid, 0);
  4496.     SetPlayerVirtualWorld(playerid, 0);
  4497.     TogglePlayerControllable(playerid, true);
  4498.     SendClientMessage(playerid, COLOR_SUCESS, "Você aceitou a morte e o Viih não terminou o comando para sugar seu dinheiro!");          
  4499.     return 1;
  4500. }
  4501.  
  4502. CMD:revistar(playerid, params[])
  4503. {
  4504.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4505.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);        
  4506.     new faction = playerinfo[playerid][pFaction];
  4507.     if(factioninfo[faction-1][fType] != 1) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções governamentais desfrutem deste comando!");
  4508.     new id;              
  4509.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /revistar [PlayerID]");    
  4510.     if(!IsPlayerNearPlayer(3.5, playerid, id)) return SendClientMessage(playerid, COLOR_ERROR, " Você não está perto desta pessoa!");    
  4511.     FriskPlayer(playerid, id);    
  4512.     return 1;
  4513. }
  4514.  
  4515. CMD:editarweaponinfo(playerid, params[])
  4516. {
  4517.     new id, type, info;
  4518.     if(sscanf(params, "udd", id, type, info))
  4519.     {        
  4520.         SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /editarweaponinfo [PlayerID] [WeaponType] [Weapon]");                
  4521.         SendClientMessage(playerid, COLOR_SOS, " WeaponTypes: 1(Pistola), 2(Rifles), 3(Submetralhadoras)");              
  4522.         return 1;
  4523.     }
  4524.     switch(type)
  4525.     {
  4526.         case 1: { playerinfo[id][pPistolType] = info; }
  4527.         case 2: { playerinfo[id][pRifleType] = info; }
  4528.         case 3: { playerinfo[id][pSubType] = info; }
  4529.     }              
  4530.     return 1;
  4531. }
  4532.  
  4533. CMD:dmv(playerid, params[])
  4534. {
  4535.     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!");    
  4536.     playerinfo[playerid][pCheckpointReason] = 1;    
  4537.     playerinfo[playerid][pCheckpointNumber] = 1;    
  4538.     SetPlayerCheckpoint(playerid, 2126.853759, -1125.523559, 25.218969, 5.0);
  4539.     return 1;    
  4540. }
  4541.  
  4542. CMD:encomendararma(playerid, params[])
  4543. {
  4544.     new faction = playerinfo[playerid][pFaction];
  4545.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4546.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);            
  4547.     if(factioninfo[faction-1][fType] != 5) return SendClientMessage(playerid, COLOR_ERROR, " O Script permite que apenas facções mafiosas desfrutem deste comando!");      
  4548.     if(playerinfo[playerid][pBizEnteredType] != 4) return SendClientMessage(playerid, COLOR_ERROR, "Você não está dentro de uma Weapon House!");
  4549.     new weapon[128];    
  4550.     if(sscanf(params, "s[128]", weapon))
  4551.     {
  4552.         SendClientMessage(playerid, COLOR_ERROR, " SINTAXE: /encomendararma [Nome]");
  4553.         SendClientMessage(playerid, COLOR_ERROR, " [Nomes] SW40VE($7500) | Glock23($8200) | SWMagnum($8500) [Eagle]");            
  4554.         SendClientMessage(playerid, COLOR_ERROR, " [Nomes] ColtM1911($5500) | Beretta92FS($5000) [Colt 45]");        
  4555.         SendClientMessage(playerid, COLOR_ERROR, " [Nomes] ColtM4Carbine($12500) [M4]");        
  4556.         SendClientMessage(playerid, COLOR_ERROR, " [Nomes] HecklerKochMP5($11250) [MP5]");        
  4557.         return 1;
  4558.     }                
  4559.     if(!strcmp(weapon, "sw40ve", true))    
  4560.     {                        
  4561.         if(playerinfo[playerid][pMoney] < 7500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4562.         playerinfo[playerid][pPistolType] = 1;        
  4563.         playerinfo[playerid][pPistol] = 24;  
  4564.         playerinfo[playerid][pPistolAmmo] = 100;      
  4565.         GivePlayerWeapon(playerid, 24, 100);        
  4566.         playerinfo[playerid][pMoney] -= 7500;        
  4567.         GivePlayerMoney(playerid, -7500);        
  4568.         SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Smith & Wesson SW40VE com 100 munições por $7500!");        
  4569.         format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Smith & Wesson SW40VE com 100 munições por $7500!", GetName(playerid));        
  4570.         Log("Weapon.log", string);            
  4571.         return 1;
  4572.     }                  
  4573.     if(!strcmp(weapon, "glock23", true))    
  4574.     {                        
  4575.         if(playerinfo[playerid][pMoney] < 8200) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4576.         playerinfo[playerid][pPistolType] = 2;        
  4577.         playerinfo[playerid][pPistol] = 24;
  4578.         playerinfo[playerid][pPistolAmmo] = 100;      
  4579.         GivePlayerWeapon(playerid, 24, 100);        
  4580.         playerinfo[playerid][pMoney] -= 8200;        
  4581.         GivePlayerMoney(playerid, -8200);        
  4582.         SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Glock 23 com 100 munições por $8200!");        
  4583.         format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Glock 23 com 100 munições por $8200!", GetName(playerid));        
  4584.         Log("Weapon.log", string);          
  4585.         return 1;
  4586.     }    
  4587.     if(!strcmp(weapon, "swmagnum", true))    
  4588.     {                        
  4589.         if(playerinfo[playerid][pMoney] < 8500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4590.         playerinfo[playerid][pPistolType] = 3;        
  4591.         playerinfo[playerid][pPistol] = 24;  
  4592.         playerinfo[playerid][pPistolAmmo] = 100;      
  4593.         GivePlayerWeapon(playerid, 24, 100);        
  4594.         playerinfo[playerid][pMoney] -= 8500;        
  4595.         GivePlayerMoney(playerid, -8500);        
  4596.         SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Smith & Wesson .500 S&W Magnum com 100 munições por $8500!");        
  4597.         format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Smith & Wesson .500 S&W Magnum com 100 munições por $8500!", GetName(playerid));        
  4598.         Log("Weapon.log", string);            
  4599.         return 1;
  4600.     }    
  4601.     if(!strcmp(weapon, "coltm1911", true))    
  4602.     {                        
  4603.         if(playerinfo[playerid][pMoney] < 5500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4604.         playerinfo[playerid][pPistolType] = 4;        
  4605.         playerinfo[playerid][pPistol] = 22;
  4606.         playerinfo[playerid][pPistolAmmo] = 100;      
  4607.         GivePlayerWeapon(playerid, 22, 100);        
  4608.         playerinfo[playerid][pMoney] -= 5500;        
  4609.         GivePlayerMoney(playerid, -5500);        
  4610.         SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Colt M1911 com 100 munições por $5500!");        
  4611.         format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Colt M1911 com 100 munições por $5500!", GetName(playerid));        
  4612.         Log("Weapon.log", string);            
  4613.         return 1;
  4614.     }    
  4615.     if(!strcmp(weapon, "beretta92fs", true))    
  4616.     {                        
  4617.         if(playerinfo[playerid][pMoney] < 5000) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4618.         playerinfo[playerid][pPistolType] = 5;        
  4619.         playerinfo[playerid][pPistol] = 22;
  4620.         playerinfo[playerid][pPistolAmmo] = 100;      
  4621.         GivePlayerWeapon(playerid, 22, 100);        
  4622.         playerinfo[playerid][pMoney] -= 5000;        
  4623.         GivePlayerMoney(playerid, -5000);        
  4624.         SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Beretta 92 FS com 100 munições por $5000!");        
  4625.         format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Beretta 92 FS com 100 munições por $5000!", GetName(playerid));        
  4626.         Log("Weapon.log", string);              
  4627.         return 1;
  4628.     }    
  4629.     if(!strcmp(weapon, "coltm4carbine", true))    
  4630.     {                        
  4631.         if(playerinfo[playerid][pMoney] < 12500) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4632.         playerinfo[playerid][pRifleType] = 1;        
  4633.         playerinfo[playerid][pRifle] = 31;  
  4634.         playerinfo[playerid][pRifleAmmo] = 120;      
  4635.         GivePlayerWeapon(playerid, 31, 120);        
  4636.         playerinfo[playerid][pMoney] -= 12500;        
  4637.         GivePlayerMoney(playerid, -12500);        
  4638.         SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Colt M4 Carbine com 120 munições por $12500!");        
  4639.         format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Colt M4 Carbine com 120 munições por $12500!", GetName(playerid));        
  4640.         Log("Weapon.log", string);          
  4641.         return 1;
  4642.     }    
  4643.     if(!strcmp(weapon, "hecklerkochmp5", true))    
  4644.     {                        
  4645.         if(playerinfo[playerid][pMoney] < 11250) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4646.         playerinfo[playerid][pSubType] = 1;        
  4647.         playerinfo[playerid][pSub] = 29;      
  4648.         playerinfo[playerid][pRifleAmmo] = 120;  
  4649.         GivePlayerWeapon(playerid, 29, 120);        
  4650.         playerinfo[playerid][pMoney] -= 11250;        
  4651.         GivePlayerMoney(playerid, -11250);        
  4652.         SendClientMessage(playerid, COLOR_SOS, "Você adiquiriu uma Heckler & Koch MP5 Submachine Gun com 120 munições por $11250!");        
  4653.         format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Heckler & Koch MP5 Submachine Gun com 120 munições por $11250!", GetName(playerid));        
  4654.         Log("Weapon.log", string);          
  4655.         return 1;
  4656.     }
  4657.     return 1;
  4658. }
  4659.  
  4660. CMD:ligar(playerid, params[])
  4661. {
  4662.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4663.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4664.     if(playerinfo[playerid][pCellphone] == -1) return SendClientMessage(playerid, COLOR_ERROR, " Você não possui um celular!");    
  4665.     new number;
  4666.     if(sscanf(params, "d", number)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /ligar [Número]");
  4667.     if(number < 555 || number > 999999) return SendClientMessage(playerid, COLOR_ERROR, "Operadora informa: Este número de telefone não existe!");    
  4668.     new looped;
  4669.     for(new i = 0; i < MAX_PLAYERS; i++)
  4670.     {
  4671.         if(playerinfo[i][pCellphone] == number)        
  4672.         {        
  4673.             playerinfo[i][pRinging] = 1;            
  4674.             callinfo[i][Caller] = playerid;
  4675.             looped ++;          
  4676.             SendClientMessage(i, COLOR_SOS, "O seu celular está tocando, utilize /atender");
  4677.         }
  4678.     }                    
  4679.     if(looped == 0) return SendClientMessage(playerid, COLOR_ERROR, "Operadora informa: Este número de telefone não existe ou está ocupado!");    
  4680.     return 1;
  4681. }
  4682.  
  4683. CMD:atender(playerid, params[])
  4684. {
  4685.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4686.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4687.     if(playerinfo[playerid][pCellphone] == -1) return SendClientMessage(playerid, COLOR_ERROR, " Você não possui um celular!");
  4688.     if(playerinfo[playerid][pRinging] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Ninguém está te ligando no momento!");
  4689.     playerinfo[playerid][pRinging] = 0;
  4690.     SendClientMessage(playerid, COLOR_SOS, "Você atendeu a chamada.");
  4691.     SendClientMessage(callinfo[playerid][Caller], COLOR_SOS, "Atenderam a chamada.");
  4692.     callinfo[playerid][InaCall] = 1;
  4693.     callinfo[callinfo[playerid][Caller]][InaCall] = 1;  
  4694.     return 1;
  4695. }
  4696.  
  4697. CMD:desligar(playerid, params[])
  4698. {
  4699.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4700.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4701.     if(playerinfo[playerid][pCellphone] == -1) return SendClientMessage(playerid, COLOR_ERROR, " Você não possui um celular!");
  4702.     if(callinfo[playerid][InaCall] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Você não está em uma ligação!");
  4703.     callinfo[playerid][InaCall] = 0;                  
  4704.     SendClientMessage(callinfo[playerid][Caller], COLOR_ERROR, "A ligação foi encerrada!");
  4705.     callinfo[callinfo[playerid][Caller]][InaCall] = 0;
  4706.     callinfo[playerid][Caller] = 0;
  4707.     SendClientMessage(playerid, COLOR_ERROR, "A ligação foi encerrada!");  
  4708.     return 1;  
  4709. }
  4710.  
  4711. CMD:editarnumero(playerid, params[])
  4712. {
  4713.     new id, cell;
  4714.     if(sscanf(params, "ud", id, cell)) return 1;    
  4715.     playerinfo[id][pCellphone] = cell;    
  4716.     return 1;
  4717. }
  4718.  
  4719. CMD:comprar(playerid, params[])
  4720. {
  4721.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4722.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4723.     new i = playerinfo[playerid][pBizEntered];        
  4724.     new sscanfinput[128];        
  4725.     if(sscanf(params, "s[128]", sscanfinput))
  4726.     {          
  4727.         if(playerinfo[playerid][pBizEnteredType] == 1)        
  4728.         {
  4729.             SendClientMessage(playerid, COLOR_NEUTRAL2, "______________[24/7]______________");
  4730.             SendClientMessage(playerid, COLOR_SOS, "[Sintáxe] /comprar <produto>");
  4731.             SendClientMessage(playerid, COLOR_NEUTRAL2, "____________[Produtos]____________");
  4732.             SendClientMessage(playerid, COLOR_SOS, "Faca - $35");
  4733.             SendClientMessage(playerid, COLOR_SOS, "Bastão de Baseball - $35");
  4734.             SendClientMessage(playerid, COLOR_SOS, "Mascara - $300");
  4735.             SendClientMessage(playerid, COLOR_SOS, "Spray - $25");
  4736.             SendClientMessage(playerid, COLOR_SOS, "Câmera - $50");            
  4737.         }        
  4738.         if(playerinfo[playerid][pBizEnteredType] == 2)        
  4739.         {        
  4740.             SendClientMessage(playerid, COLOR_NEUTRAL2, "______________[Bar]______________");
  4741.             SendClientMessage(playerid, COLOR_SOS, "[Sintáxe] /comprar <produto>");
  4742.             SendClientMessage(playerid, COLOR_NEUTRAL2, "____________[Produtos]____________");
  4743.             SendClientMessage(playerid, COLOR_SOS, "Água - $10");
  4744.             SendClientMessage(playerid, COLOR_SOS, "Café - $15");
  4745.             SendClientMessage(playerid, COLOR_SOS, "Vodka - $25");
  4746.             SendClientMessage(playerid, COLOR_SOS, "Whisky - $40");
  4747.             SendClientMessage(playerid, COLOR_SOS, "Tequila - $50");    
  4748.         }
  4749.         return 1;
  4750.     }
  4751.     if(playerinfo[playerid][pBizEnteredType] == 1)
  4752.     {          
  4753.         if(!strcmp(sscanfinput, "Mascara", true))
  4754.         {
  4755.             if(playerinfo[playerid][pMask]) return SendClientMessage(playerid, COLOR_ERROR, "Você já tem uma Máscara.");
  4756.             if(playerinfo[playerid][pMoney] < 300) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4757.             if(playerinfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_ERROR, "Você precisa ser level 5+!");
  4758.             playerinfo[playerid][pMoney] -= 300;
  4759.             GivePlayerMoney(playerid, -300);
  4760.             playerinfo[playerid][pMask] = randomEx(10000, 80000);
  4761.             format(string, sizeof(string), "Máscara adiquirida. ID: %d.", playerinfo[playerid][pMask]);
  4762.             SendClientMessage(playerid, COLOR_SOS, string);          
  4763.             bizinfo[i][bSafe] += 300;              
  4764.             bizinfo[i][bProducts] --;
  4765.             SaveBiz(i);
  4766.         }
  4767.         else if(!strcmp(sscanfinput, "Faca", true))
  4768.         {
  4769.             if(playerinfo[playerid][pMoney] < 35) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4770.             playerinfo[playerid][pMoney] -= 35;
  4771.             GivePlayerMoney(playerid, -35);
  4772.             SaveUser(playerid);
  4773.             bizinfo[i][bSafe] += 35;
  4774.             bizinfo[i][bProducts] --;
  4775.             SaveBiz(i);            
  4776.             GivePlayerWeapon(playerid, 4, 1);          
  4777.             SendClientMessage(playerid, COLOR_SOS, "Faca adiquirida!");
  4778.         }
  4779.         else if(!strcmp(sscanfinput, "Bastão de Baseball", true))
  4780.         {
  4781.             if(playerinfo[playerid][pMoney] < 35) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4782.             GivePlayerMoney(playerid, -35);
  4783.             playerinfo[playerid][pMoney] -= 35;
  4784.             SaveUser(playerid);
  4785.             bizinfo[i][bSafe] += 35;
  4786.             bizinfo[i][bProducts] --;
  4787.             SaveBiz(i);
  4788.             GivePlayerWeapon(playerid, 5, 1);  
  4789.             SendClientMessage(playerid, COLOR_SOS, "Bastão de Baseball adiquirido!"); 
  4790.         }
  4791.         else if(!strcmp(sscanfinput, "Spray", true))
  4792.         {
  4793.             if(playerinfo[playerid][pMoney] < 25) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4794.             GivePlayerMoney(playerid, -25);
  4795.             playerinfo[playerid][pMoney] -= 25;
  4796.             SaveUser(playerid);
  4797.             bizinfo[i][bSafe] += 25;
  4798.             bizinfo[i][bProducts] --;
  4799.             SaveBiz(i);
  4800.             GivePlayerWeapon(playerid, 41, 150);   
  4801.             SendClientMessage(playerid, COLOR_SOS, "Spray adiquirido!");           
  4802.         }
  4803.         else if(!strcmp(sscanfinput, "Câmera", true))
  4804.         {
  4805.             if(playerinfo[playerid][pMoney] < 50) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4806.             GivePlayerMoney(playerid, -50);
  4807.             playerinfo[playerid][pMoney] -= 50;
  4808.             GivePlayerWeapon(playerid, 43, 10);
  4809.             SaveUser(playerid);
  4810.             bizinfo[i][bSafe] += 50;
  4811.             bizinfo[i][bProducts] --;
  4812.             SaveBiz(i);
  4813.             SendClientMessage(playerid, COLOR_SOS, "Câmera adiquirida!");
  4814.         }    
  4815.     }    
  4816.     if(playerinfo[playerid][pBizEnteredType] == 2)    
  4817.     {    
  4818.         if(!strcmp(sscanfinput, "Água", true))
  4819.         {
  4820.             if(playerinfo[playerid][pMoney] < 10) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4821.             playerinfo[playerid][pMoney] -= 10;
  4822.             GivePlayerMoney(playerid, -10);      
  4823.             bizinfo[i][bSafe] += 10;              
  4824.             bizinfo[i][bProducts] --;
  4825.             SaveBiz(i);      
  4826.             SendClientMessage(playerid, COLOR_SOS, "Garrafa de água adiquirida!");            
  4827.             SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");              
  4828.             playerinfo[playerid][pBebida] = 1;
  4829.         }
  4830.         else if(!strcmp(sscanfinput, "Café", true))
  4831.         {
  4832.             if(playerinfo[playerid][pMoney] < 15) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4833.             playerinfo[playerid][pMoney] -= 15;
  4834.             GivePlayerMoney(playerid, -15);
  4835.             SaveUser(playerid);
  4836.             bizinfo[i][bSafe] += 15;
  4837.             bizinfo[i][bProducts] --;
  4838.             SaveBiz(i);                    
  4839.             SendClientMessage(playerid, COLOR_SOS, "Copo de café adiquirido!");            
  4840.             SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-lo ((/beber))");            
  4841.             playerinfo[playerid][pBebida] = 2;
  4842.         }
  4843.         else if(!strcmp(sscanfinput, "Vodka", true))
  4844.         {
  4845.             if(playerinfo[playerid][pMoney] < 25) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4846.             GivePlayerMoney(playerid, -25);
  4847.             playerinfo[playerid][pMoney] -= 25;
  4848.             SaveUser(playerid);
  4849.             bizinfo[i][bSafe] += 25;
  4850.             bizinfo[i][bProducts] --;
  4851.             SaveBiz(i);    
  4852.             SendClientMessage(playerid, COLOR_SOS, "Garrafa de Vodka adiquirida!");            
  4853.             SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");              
  4854.             playerinfo[playerid][pBebida] = 3;
  4855.         }
  4856.         else if(!strcmp(sscanfinput, "Whisky", true))
  4857.         {
  4858.             if(playerinfo[playerid][pMoney] < 40) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4859.             GivePlayerMoney(playerid, -40);
  4860.             playerinfo[playerid][pMoney] -= 40;
  4861.             SaveUser(playerid);
  4862.             bizinfo[i][bSafe] += 40;
  4863.             bizinfo[i][bProducts] --;
  4864.             SaveBiz(i);
  4865.             SendClientMessage(playerid, COLOR_SOS, "Garrafa de Whisky adiquirida!");            
  4866.             SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");
  4867.             playerinfo[playerid][pBebida] = 4;         
  4868.         }
  4869.         else if(!strcmp(sscanfinput, "Tequila", true))
  4870.         {
  4871.             if(playerinfo[playerid][pMoney] < 50) return SendClientMessage(playerid, COLOR_ERROR, MONEY_ERROR);
  4872.             GivePlayerMoney(playerid, -50);
  4873.             playerinfo[playerid][pMoney] -= 50;
  4874.             SaveUser(playerid);
  4875.             bizinfo[i][bSafe] += 50;
  4876.             bizinfo[i][bProducts] --;
  4877.             SaveBiz(i);
  4878.             SendClientMessage(playerid, COLOR_SOS, "Garrafa de Tequila adiquirida!");            
  4879.             SendClientMessage(playerid, COLOR_SOS, "Agora você pode bebê-la ((/beber))");            
  4880.             playerinfo[playerid][pBebida] = 5;
  4881.         }  
  4882.     }
  4883.     return 1;
  4884. }
  4885.  
  4886. CMD:depositar(playerid, params[])
  4887. {
  4888.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4889.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4890.     new quantia;
  4891.     if(sscanf(params, "d", quantia)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /depositar [Quantia]");
  4892.     if(quantia <= 0) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 0!");        
  4893.     if(playerinfo[playerid][pMoney] < quantia) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui esta quantia de dinheiro com você!");    
  4894.     playerinfo[playerid][pMoney] -= quantia;    
  4895.     playerinfo[playerid][pBank] += quantia;    
  4896.     GivePlayerMoney(playerid, -quantia);    
  4897.     format(string, sizeof(string), "Você depositou com sucesso um valor de $%d", quantia);    
  4898.     SendClientMessage(playerid, COLOR_SUCESS, string);
  4899.     format(string, sizeof(string), "[WEAPONHOUSE] %s adiquiriu uma Smith & Wesson SW40VE com 100 munições por $7500!", GetName(playerid));        
  4900.     Log("Weapon.log", string);    
  4901.     return 1;
  4902. }
  4903.  
  4904. CMD:sacar(playerid, params[])
  4905. {
  4906.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4907.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4908.     new quantia;
  4909.     if(sscanf(params, "d", quantia)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /sacar [Quantia]");
  4910.     if(quantia <= 0) return SendClientMessage(playerid, COLOR_ERROR, "Os valores iniciam-se em 0!");        
  4911.     if(playerinfo[playerid][pBank] < quantia) return SendClientMessage(playerid, COLOR_ERROR, "Você não possui esta quantia de dinheiro em sua conta bancária!");    
  4912.     playerinfo[playerid][pBank] -= quantia;    
  4913.     playerinfo[playerid][pMoney] += quantia;    
  4914.     GivePlayerMoney(playerid, quantia);    
  4915.     format(string, sizeof(string), "Você sacou com sucesso um valor de $%d", quantia);    
  4916.     SendClientMessage(playerid, COLOR_SUCESS, string);    
  4917.     return 1;
  4918. }
  4919.  
  4920. CMD:extrato(playerid, params[])
  4921. {
  4922.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4923.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);      
  4924.     SendClientMessage(playerid, COLOR_SOS, "_______________[Extrato Bancário]_______________");
  4925.     format(string, sizeof(string), "Saldo: $%d", playerinfo[playerid][pBank]);
  4926.     SendClientMessage(playerid, COLOR_NEUTRAL2, string);
  4927.     return 1;      
  4928. }
  4929.  
  4930. CMD:algemar(playerid, params[])
  4931. {
  4932.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4933.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);        
  4934.     new id;    
  4935.     new faction = playerinfo[playerid][pFaction];
  4936.     if(factioninfo[faction-1][fType] != 1) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que apenas facções policiais executem este comando!");      
  4937.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /algemar [PlayerID]");      
  4938.     if(playerinfo[id][pLogado] == 0 || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  4939.     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ê!");
  4940.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode se algemar!");
  4941.     faction = playerinfo[id][pFaction];      
  4942.     if(factioninfo[faction-1][fType] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode algemar outros oficiais!");    
  4943.     if(playerinfo[playerid][pCuffed] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador já está algemado! (/desalgemar)");
  4944.     SetPlayerAttachedObject(id, 4, 19418, 6, -0.031999, 0.024000,-0.024000,-7.900000,-32.000011,-72.299987, 1.115998, 1.322000, 1.406000);                            
  4945.     SetPlayerSpecialAction(id, 24);    
  4946.     return 1;
  4947. }
  4948.  
  4949. CMD:desalgemar(playerid, params[])
  4950. {
  4951.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4952.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);        
  4953.     new id;    
  4954.     new faction = playerinfo[playerid][pFaction];
  4955.     if(factioninfo[faction-1][fType] != 1) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que apenas facções policiais executem este comando!");      
  4956.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /desalgemar [PlayerID]");      
  4957.     if(playerinfo[id][pLogado] == 0 || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, ID_ERROR);
  4958.     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ê!");
  4959.     if(id == playerid) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode se desalgemar!");
  4960.     faction = playerinfo[id][pFaction];      
  4961.     if(factioninfo[faction-1][fType] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Você não pode desalgemar outros oficiais!");    
  4962.     if(playerinfo[playerid][pCuffed] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Este jogador não está algemado! (/algemar)");
  4963.     SetPlayerSpecialAction(id, 0);
  4964.     RemovePlayerAttachedObject(id, 4);
  4965.     return 1;
  4966. }
  4967.  
  4968. CMD:portamalas(playerid, params[])
  4969. {
  4970.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  4971.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);
  4972.     if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_ERROR, "O Script permite que apenas motoristas executem este comando!");  
  4973.     new vid = GetPlayerVehicleID(playerid);        
  4974.     new subcmd[128], wid;                                                                                      
  4975.     if(sscanf(params, "s[128],d(-1)", subcmd, wid))    
  4976.     {    
  4977.         SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /portamalas [Função]");        
  4978.         return SendClientMessage(playerid, COLOR_ERROR, "[Funções]: Abrir | Fechar | ColocarArma | RetirarArma | ColocarDroga | RetirarDroga | Checar");
  4979.     }                                                                                                                                          
  4980.     if(!strcmp(subcmd, "abrir", true))    
  4981.     {    
  4982.         if(GetVehicleParameters(vid, 5) == 1)
  4983.         {
  4984.             SendClientMessage(playerid, COLOR_ERROR, "Este portamalas já está aberto. ((/portamalas fechar))");
  4985.             return 1;
  4986.         }      
  4987.         if(wid == -1)
  4988.         {                                                                              
  4989.             if(vehicleinfo[vid][vFCarID] > 0) return SendClientMessage(playerid, COLOR_ERROR, "O Script bloqueia este comando em veículos de faction!");
  4990.             new engine, lights, alarm, doors, bonnet, boot, objective;        
  4991.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  4992.             SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,1,objective);
  4993.         }                          
  4994.         return 1;
  4995.     }      
  4996.     if(!strcmp(subcmd, "fechar", true))    
  4997.     {    
  4998.         if(GetVehicleParameters(vid, 5) == 0)
  4999.         {
  5000.             SendClientMessage(playerid, COLOR_ERROR, "Este portamalas já está fechado. ((/portamalas abrir))");
  5001.             return 1;
  5002.         }                                                                                                                                                  
  5003.         if(wid == -1)
  5004.         {
  5005.             if(vehicleinfo[vid][vFCarID] > 0) return SendClientMessage(playerid, COLOR_ERROR, "O Script bloqueia este comando em veículos de faction!");
  5006.             new engine, lights, alarm, doors, bonnet, boot, objective;        
  5007.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  5008.             SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,0,objective);
  5009.         }                          
  5010.         return 1;
  5011.     }    
  5012.     return 1;
  5013. }
  5014.  
  5015. CMD:entregararma(playerid, params[])
  5016. {
  5017.     if(playerinfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_ERROR, MUTED_ERROR);
  5018.     if(playerinfo[playerid][pLogado] == 0) return SendClientMessage(playerid, COLOR_ERROR, LOGIN_ERROR);                
  5019.     new id;
  5020.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ERROR, "SINTAXE: /entregararma [PlayerID]");
  5021.     new gunID = GetPlayerWeapon(playerid);
  5022.     new gunAmmo = GetPlayerAmmo(playerid);
  5023.     if(gunID == 22 || gunID == 24)
  5024.     {
  5025.         playerinfo[id][pPistolType] = playerinfo[playerid][pPistolType];        
  5026.         playerinfo[playerid][pPistolType] = 0;
  5027.     }                                            
  5028.     if(gunID == 31)  
  5029.     {
  5030.         playerinfo[id][pRifleType] = playerinfo[playerid][pRifleType];        
  5031.         playerinfo[playerid][pRifleType] = 0;
  5032.     }  
  5033.     if(gunID == 29)    
  5034.     {    
  5035.         playerinfo[id][pSubType] = playerinfo[playerid][pRifleType];        
  5036.         playerinfo[playerid][pSubType] = 0;
  5037.     }
  5038.     GivePlayerWeapon(id, gunID, gunAmmo);
  5039.     RemovePlayerWeapon(playerid, gunID);    
  5040.     return 1;    
  5041. }
  5042.  
  5043. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  5044. {    
  5045.     return 1;
  5046. }
  5047.  
  5048. public OnPlayerExitVehicle(playerid, vehicleid)
  5049. {
  5050.     return 1;
  5051. }
  5052.  
  5053. public OnPlayerStateChange(playerid, newstate, oldstate)
  5054. {
  5055.     new vehicleid = GetPlayerVehicleID(playerid);
  5056.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)    
  5057.     {
  5058.         if(vehicleinfo[vehicleid][vFCarID] != -1)
  5059.         {
  5060.             if(playerinfo[playerid][pFaction] != vehicleinfo[vehicleid][vFCarID])
  5061.             {
  5062.                 if(playerinfo[playerid][pAdminDuty] == 0)
  5063.                 {
  5064.                     SendClientMessage(playerid, COLOR_ERROR, "Você não pode utilizar este veículo [Faction]!");
  5065.                     new Float:ppos[3];
  5066.                     GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
  5067.                     SetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]+1);
  5068.  
  5069.                 }
  5070.             }
  5071.         }
  5072.     }
  5073.     return 1;
  5074. }
  5075.  
  5076. public OnPlayerEnterCheckpoint(playerid)
  5077. {
  5078.     if(playerinfo[playerid][pCheckpointReason] == 0)    
  5079.     {    
  5080.         DisablePlayerCheckpoint(playerid);        
  5081.         return 1;
  5082.     }    
  5083.     if(playerinfo[playerid][pCheckpointReason] == 1)    
  5084.     {    
  5085.         DisablePlayerCheckpoint(playerid);
  5086.         if(playerinfo[playerid][pCheckpointNumber] == 1)
  5087.         {
  5088.             SetPlayerCheckpoint(playerid, 2194.265625, -1127.350952, 24.806684, 5.0);            
  5089.             playerinfo[playerid][pCheckpointNumber] = 2;                            
  5090.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ok, vamos começar o seu exame. Dobre à direita com cautela.");              
  5091.             return 1;
  5092.         }
  5093.         if(playerinfo[playerid][pCheckpointNumber] == 2)
  5094.         {
  5095.             SetPlayerCheckpoint(playerid, 2312.474609, -1153.993164, 26.524555, 5.0);              
  5096.             playerinfo[playerid][pCheckpointNumber] = 3;    
  5097.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Siga em frente. Cruze com cuidado nos trilhos.");                      
  5098.             return 1;
  5099.         }
  5100.         if(playerinfo[playerid][pCheckpointNumber] == 3)
  5101.         {
  5102.             SetPlayerCheckpoint(playerid, 2368.512207, -1221.064331, 27.156768, 5.0);                
  5103.             playerinfo[playerid][pCheckpointNumber] = 4;    
  5104.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ótimo. Agora, vire à direita.");                                  
  5105.             return 1;
  5106.         }
  5107.         if(playerinfo[playerid][pCheckpointNumber] == 4)
  5108.         {
  5109.             SetPlayerCheckpoint(playerid, 2315.188964, -1217.386962, 23.580661, 5.0);              
  5110.             playerinfo[playerid][pCheckpointNumber] = 5;                  
  5111.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Vire novamente à direita, dentro do estacionamento.");            
  5112.             return 1;
  5113.         }
  5114.         if(playerinfo[playerid][pCheckpointNumber] == 5)
  5115.         {
  5116.             SetPlayerCheckpoint(playerid, 2263.132568, -1142.357421, 26.549264, 5.0);            
  5117.             playerinfo[playerid][pCheckpointNumber] = 6;                                        
  5118.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Muito bom. Dobre à direita, e nos trilhos, à esquerda.");                  
  5119.             return 1;
  5120.         }
  5121.         if(playerinfo[playerid][pCheckpointNumber] == 6)
  5122.         {
  5123.             SetPlayerCheckpoint(playerid, 2021.039306, -1026.977905, 35.217605, 5.0);            
  5124.             playerinfo[playerid][pCheckpointNumber] = 7;                                          
  5125.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Mantenha à direita e pegue a adjacente.");              
  5126.             return 1;
  5127.         }
  5128.         if(playerinfo[playerid][pCheckpointNumber] == 7)
  5129.         {
  5130.             SetPlayerCheckpoint(playerid, 1918.079833, -1021.020385, 34.544483, 5.0);                  
  5131.             playerinfo[playerid][pCheckpointNumber] = 8;                                      
  5132.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ok. Você foi muito bem até agora. Vamos tentar na interestadual.");                    
  5133.             return 1;
  5134.         }
  5135.         if(playerinfo[playerid][pCheckpointNumber] == 8)
  5136.         {
  5137.             SetPlayerCheckpoint(playerid, 1779.353881, -946.320190, 44.413249, 5.0);                    
  5138.             playerinfo[playerid][pCheckpointNumber] = 9;                                                                                        
  5139.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Mantenha-se ainda à direita para entrar na rodovia.");                
  5140.             return 1;
  5141.         }
  5142.         if(playerinfo[playerid][pCheckpointNumber] == 9)
  5143.         {
  5144.             SetPlayerCheckpoint(playerid, 1707.737182, -744.599670, 50.794456, 5.0);              
  5145.             playerinfo[playerid][pCheckpointNumber] = 10;                                        
  5146.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Diminua a velocidade para entrar, e sempre entre com cuidado.");                    
  5147.             return 1;
  5148.         }
  5149.         if(playerinfo[playerid][pCheckpointNumber] == 10)
  5150.         {
  5151.             SetPlayerCheckpoint(playerid, 1659.918090, -38.740947, 36.141929, 5.0);            
  5152.             playerinfo[playerid][pCheckpointNumber] = 11;                          
  5153.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ótimo. Aqui, você pode dirigir até 120 kilômetros por hora.");              
  5154.             return 1;
  5155.         }
  5156.         if(playerinfo[playerid][pCheckpointNumber] == 11)
  5157.         {
  5158.             SetPlayerCheckpoint(playerid, 1712.067016, 249.732650, 18.113079, 5.0);                    
  5159.             playerinfo[playerid][pCheckpointNumber] = 12;                                                            
  5160.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Mantenha a direita para pegar o conector para Palomino Creek.");            
  5161.             return 1;
  5162.         }
  5163.         if(playerinfo[playerid][pCheckpointNumber] == 12)
  5164.         {
  5165.             SetPlayerCheckpoint(playerid, 2135.144775, 311.238372, 33.436832, 5.0);                    
  5166.             playerinfo[playerid][pCheckpointNumber] = 13;                            
  5167.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Entre com cuidado. A máxima desta rodovia é 110 kilômetros por hora.");              
  5168.             return 1;
  5169.         }
  5170.         if(playerinfo[playerid][pCheckpointNumber] == 13)
  5171.         {
  5172.             SetPlayerCheckpoint(playerid, 2874.805908, -731.757263, 10.563012, 5.0);                
  5173.             playerinfo[playerid][pCheckpointNumber] = 14;                                    
  5174.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Siga reto até a entrada de Las Colinas pela East Beach highway.");                  
  5175.             return 1;
  5176.         }
  5177.         if(playerinfo[playerid][pCheckpointNumber] == 14)
  5178.         {
  5179.             SetPlayerCheckpoint(playerid, 2867.733398, -1016.851379, 10.602074, 5.0);              
  5180.             playerinfo[playerid][pCheckpointNumber] = 15;                          
  5181.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Diminua a velocidade e prepare-se para dobrar à direita.");            
  5182.             return 1;
  5183.         }
  5184.         if(playerinfo[playerid][pCheckpointNumber] == 15)
  5185.         {
  5186.             SetPlayerCheckpoint(playerid, 2388.708740, -1150.836303, 27.991292, 5.0);                
  5187.             playerinfo[playerid][pCheckpointNumber] = 16;      
  5188.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Dobre à direita e siga reto até a Auto Escola.");              
  5189.             return 1;
  5190.         }
  5191.         if(playerinfo[playerid][pCheckpointNumber] == 16)
  5192.         {
  5193.             SetPlayerCheckpoint(playerid, 2127.324951, -1130.787597, 25.269168, 5.0);    
  5194.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Não se esqueça de cruzar com cuidado nos trilhos!");
  5195.             playerinfo[playerid][pCheckpointNumber] = 17;                                        
  5196.             return 1;
  5197.         }
  5198.         if(playerinfo[playerid][pCheckpointNumber] == 17)
  5199.         {
  5200.             SendClientMessage(playerid, COLOR_FADE2, "Instrutor diz: Ótimo. Terminamos.");
  5201.             playerinfo[playerid][pCheckpointNumber] = 0;            
  5202.             playerinfo[playerid][pCheckpointReason] = 0;  
  5203.         }    
  5204.         return 1;
  5205.     }
  5206.     return 1;
  5207. }
  5208.  
  5209. public OnPlayerLeaveCheckpoint(playerid)
  5210. {
  5211.     return 1;
  5212. }
  5213.  
  5214. public OnPlayerEnterRaceCheckpoint(playerid)
  5215. {
  5216.     return 1;
  5217. }
  5218.  
  5219. public OnPlayerLeaveRaceCheckpoint(playerid)                                                                                        
  5220. {
  5221.     return 1;
  5222. }
  5223.  
  5224. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  5225. {
  5226.     new WeaponUsed[128];                                                  
  5227.     new Float: Health;    
  5228.     GetPlayerHealth(damagedid, Health);
  5229.     if(weaponid == 24)    
  5230.     {    
  5231.         if(playerinfo[playerid][pPistolType] == 1)        
  5232.         {                    
  5233.             strmid(WeaponUsed, weapondata[0][wName], 0, 128, 255);
  5234.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
  5235.             SendClientMessageToAll(0xFFFFFFFF, string);
  5236.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[0][wDamage], GetName(damagedid), WeaponUsed);
  5237.             SendClientMessageToAll(0xFFFFFFFF, string);  
  5238.             SetPlayerHealth(damagedid, Health - weapondata[0][wDamage]);        
  5239.         }          
  5240.         if(playerinfo[playerid][pPistolType] == 2)        
  5241.         {                    
  5242.             strmid(WeaponUsed, weapondata[1][wName], 0, 128, 255);
  5243.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
  5244.             SendClientMessageToAll(0xFFFFFFFF, string);
  5245.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[1][wDamage], GetName(damagedid), WeaponUsed);
  5246.             SendClientMessageToAll(0xFFFFFFFF, string);  
  5247.             SetPlayerHealth(damagedid, Health - weapondata[1][wDamage]);        
  5248.         }        
  5249.         if(playerinfo[playerid][pPistolType] == 3)        
  5250.         {                    
  5251.             strmid(WeaponUsed, weapondata[2][wName], 0, 128, 255);
  5252.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
  5253.             SendClientMessageToAll(0xFFFFFFFF, string);
  5254.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[2][wDamage], GetName(damagedid), WeaponUsed);
  5255.             SendClientMessageToAll(0xFFFFFFFF, string);  
  5256.             SetPlayerHealth(damagedid, Health - weapondata[2][wDamage]);        
  5257.         }                
  5258.     }                        
  5259.     if(weaponid == 22)
  5260.     {
  5261.         if(playerinfo[playerid][pPistolType] == 4)        
  5262.         {                    
  5263.             strmid(WeaponUsed, weapondata[3][wName], 0, 128, 255);
  5264.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
  5265.             SendClientMessageToAll(0xFFFFFFFF, string);
  5266.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[3][wDamage], GetName(damagedid), WeaponUsed);
  5267.             SendClientMessageToAll(0xFFFFFFFF, string);  
  5268.             SetPlayerHealth(damagedid, Health - weapondata[3][wDamage]);        
  5269.         }        
  5270.         if(playerinfo[playerid][pPistolType] == 5)        
  5271.         {                    
  5272.             strmid(WeaponUsed, weapondata[4][wName], 0, 128, 255);
  5273.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
  5274.             SendClientMessageToAll(0xFFFFFFFF, string);
  5275.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[4][wDamage], GetName(damagedid), WeaponUsed);
  5276.             SendClientMessageToAll(0xFFFFFFFF, string);  
  5277.             SetPlayerHealth(damagedid, Health - weapondata[4][wDamage]);        
  5278.         }
  5279.     }
  5280.     if(weaponid == 31)
  5281.     {
  5282.         if(playerinfo[playerid][pRifleType] == 1)        
  5283.         {                    
  5284.             strmid(WeaponUsed, weapondata[5][wName], 0, 128, 255);
  5285.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
  5286.             SendClientMessageToAll(0xFFFFFFFF, string);
  5287.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[5][wDamage], GetName(damagedid), WeaponUsed);
  5288.             SendClientMessageToAll(0xFFFFFFFF, string);  
  5289.             SetPlayerHealth(damagedid, Health - weapondata[5][wDamage]);        
  5290.         }        
  5291.     }
  5292.     if(weaponid == 29)
  5293.     {
  5294.         if(playerinfo[playerid][pSubType] == 1)        
  5295.         {                    
  5296.             strmid(WeaponUsed, weapondata[6][wName], 0, 128, 255);
  5297.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), amount, GetName(damagedid), WeaponUsed);
  5298.             SendClientMessageToAll(0xFFFFFFFF, string);
  5299.             format(string, sizeof(string), "%s fez %.0f de dano em %s, arma: %s", GetName(playerid), weapondata[6][wDamage], GetName(damagedid), WeaponUsed);
  5300.             SendClientMessageToAll(0xFFFFFFFF, string);  
  5301.             SetPlayerHealth(damagedid, Health - weapondata[6][wDamage]);        
  5302.         }        
  5303.     }  
  5304.     return 1;
  5305. }
  5306.  
  5307. public OnRconCommand(cmd[])
  5308. {
  5309.     return 1;
  5310. }
  5311.  
  5312. public OnPlayerRequestSpawn(playerid)
  5313. {
  5314.     return 0;
  5315. }
  5316.  
  5317. public OnObjectMoved(objectid)
  5318. {
  5319.     return 1;
  5320. }
  5321.  
  5322. public OnPlayerObjectMoved(playerid, objectid)
  5323. {
  5324.     return 1;
  5325. }
  5326.  
  5327. public OnPlayerPickUpPickup(playerid, pickupid)
  5328. {
  5329.     return 1;
  5330. }
  5331.  
  5332. public OnVehicleMod(playerid, vehicleid, componentid)
  5333. {
  5334.     return 1;
  5335. }
  5336.  
  5337. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  5338. {
  5339.     return 1;
  5340. }
  5341.  
  5342. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  5343. {
  5344.     return 1;
  5345. }
  5346.  
  5347. public OnPlayerSelectedMenuRow(playerid, row)
  5348. {
  5349.     return 1;
  5350. }
  5351.  
  5352. public OnPlayerExitedMenu(playerid)
  5353. {
  5354.     return 1;
  5355. }
  5356.  
  5357. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  5358. {
  5359.     return 1;
  5360. }
  5361.  
  5362. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  5363. {
  5364.     if(PRESSED(KEY_CROUCH))    
  5365.     {    
  5366.         if(playerinfo[playerid][pAdmin] < 1) return 1;        
  5367.         if(playerinfo[playerid][pSpectating] == 0) return 1;        
  5368.         TogglePlayerSpectating(playerid, 0);                                                                    
  5369.         SetPlayerSkin(playerid, playerinfo[playerid][pSkin]);
  5370.         playerinfo[playerid][pSpectating] = 0;            
  5371.         if(playerinfo[playerid][pSpawnType] == 0) //Normal        
  5372.         {        
  5373.             SetPlayerPos(playerid, 0, 0, 0);  
  5374.             return 1;                        
  5375.         }                                                                          
  5376.         if(playerinfo[playerid][pSpawnType] == 1) //Casa 1      
  5377.         {    
  5378.             new id;
  5379.             id = playerinfo[playerid][pCasa1];
  5380.             SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);  
  5381.             return 1;                                                          
  5382.         }
  5383.         if(playerinfo[playerid][pSpawnType] == 2) //Casa 2      
  5384.         {            
  5385.             new id;
  5386.             id = playerinfo[playerid][pCasa2];    
  5387.             SetPlayerPos(playerid, houseinfo[id][hEntranceX], houseinfo[id][hEntranceY], houseinfo[id][hEntranceZ]);                
  5388.             return 1;
  5389.         }            
  5390.         if(playerinfo[playerid][pSpawnType] == 3) //Faction
  5391.         {  
  5392.             new id;    
  5393.             id = strval(playerinfo[playerid][pFaction]);                              
  5394.             SetPlayerPos(playerid, factioninfo[id][fSpawnX], factioninfo[id][fSpawnY], factioninfo[id][fSpawnZ]);  
  5395.             return 1;          
  5396.         }
  5397.         if(playerinfo[playerid][pJailed] == 1)
  5398.         {
  5399.             if(playerinfo[playerid][pJailType] == 1) //County Jail            
  5400.             {            
  5401.                 SetPlayerPos(playerid, 30, 30, 30);        
  5402.                 SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");  
  5403.                 return 1;        
  5404.             }            
  5405.             if(playerinfo[playerid][pJailType] == 2) //LSP            
  5406.             {            
  5407.                 SetPlayerPos(playerid, 7, 7, 7);
  5408.                 SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena!");
  5409.                 return 1;              
  5410.             }            
  5411.             if(playerinfo[playerid][pJailType] == 3) //AJAIL            
  5412.             {                                            
  5413.                 SetPlayerInterior(playerid, 5);
  5414.                 SetPlayerPos(playerid, 322.197998, 302.497985, 999.148437);      
  5415.                 SendClientMessage(playerid, COLOR_NEUTRAL2, "Você não cumpriu sua pena (OOCly)");    
  5416.                 return 1;              
  5417.             }              
  5418.         }
  5419.     }
  5420.     return 1;
  5421. }
  5422.  
  5423. public OnRconLoginAttempt(ip[], password[], success)
  5424. {
  5425.     return 1;
  5426. }
  5427.  
  5428. public OnPlayerUpdate(playerid)
  5429. {
  5430.     return 1;
  5431. }
  5432.  
  5433. public OnPlayerStreamIn(playerid, forplayerid)
  5434. {
  5435.     return 1;
  5436. }
  5437.  
  5438. public OnPlayerStreamOut(playerid, forplayerid)
  5439. {
  5440.     return 1;
  5441. }
  5442.  
  5443. public OnVehicleStreamIn(vehicleid, forplayerid)
  5444. {
  5445.     return 1;
  5446. }
  5447.  
  5448. public OnVehicleStreamOut(vehicleid, forplayerid)
  5449. {
  5450.     return 1;
  5451. }
  5452.  
  5453. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  5454. {
  5455.     if(dialogid == DIALOG_LOGIN)    
  5456.     {    
  5457.         if(!response) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Scarlett Roleplay (Login)", "Digite sua senha abaixo para logar-se!", "Login", "Logout");        
  5458.         Login(playerid, inputtext);
  5459.         playerinfo[playerid][pCameraInterpol] = 0;
  5460.     }    
  5461.     if(dialogid == DIALOG_ADMPM)    
  5462.     {    
  5463.         if(!response) return 1;          
  5464.         SendClientMessage(playerid, COLOR_PM, playerinfo[playerid][pString2]);
  5465.         SendClientMessage(SendingPM[playerid], COLOR_PM, playerinfo[playerid][pString]);    
  5466.         SendingPM[playerid] = 0;
  5467.         strmid(playerinfo[playerid][pString], "", 0, strlen(""), 255);
  5468.         strmid(playerinfo[playerid][pString2], "", 0, strlen(""), 255);  
  5469.     }    
  5470.     if(dialogid == DIALOG_ADMACTIONS)    
  5471.     {    
  5472.         if(!response) return 1;        
  5473.         if(listitem == 0) //Spec      
  5474.         {        
  5475.             TogglePlayerSpectating(playerid, 1);
  5476.             if(IsPlayerInAnyVehicle(targetclick[playerid]))
  5477.             {
  5478.                 PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetclick[playerid]));
  5479.             }
  5480.             else
  5481.             {
  5482.                 PlayerSpectatePlayer(playerid, targetclick[playerid]);
  5483.             }                                                  
  5484.             GameTextForPlayer(playerid, "Para sair de Spec, pressione ~k~~PED_DUCK~", 5000, 5);
  5485.             format(string, sizeof(string), "[%s] [Spec] %s espiou %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]));            
  5486.             playerinfo[playerid][pSpectating] = 1;
  5487.             Log("AdminCMD.log", string);
  5488.         }        
  5489.         if(listitem == 1) //Ir      
  5490.         {        
  5491.             new Float: X,            
  5492.                 Float: Y,                
  5493.                 Float: Z;                
  5494.                                
  5495.             GetPlayerPos(targetclick[playerid], X, Y, Z);            
  5496.             SetPlayerPos(playerid, X, Y, Z);                                    
  5497.             format(string, sizeof(string), "[%s] [Ir] O Administrador %s teleportou-se até %s!", getDateEx(), GetName(playerid), GetName(targetclick[playerid]));
  5498.             Log("AdminCMD.log", string);
  5499.         }        
  5500.         if(listitem == 2)  //Kick      
  5501.         {        
  5502.             ShowPlayerDialog(playerid, DIALOG_ADMKICK, DIALOG_STYLE_INPUT, "Kick Player", "Digite o motivo do kick abaixo", "Confirmar", "Cancelar");
  5503.         }        
  5504.         if(listitem == 3) //Ban      
  5505.         {        
  5506.             ShowPlayerDialog(playerid, DIALOG_ADMKICK, DIALOG_STYLE_INPUT, "Ban Player", "Digite o motivo do ban abaixo", "Confirmar", "Cancelar");
  5507.         }                    
  5508.         if(listitem == 4) //Ajail        
  5509.         {    
  5510.             ShowPlayerDialog(playerid, DIALOG_ADMAJAIL, DIALOG_STYLE_INPUT, "Ajail Player", "Digite o tempo da ajail abaixo", "Confirmar", "Cancelar");  
  5511.             return 1;
  5512.         }        
  5513.         if(listitem == 5) //Slap        
  5514.         {                                      
  5515.             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!");
  5516.             SendClientMessage(playerid, COLOR_SUCESS, "O jogador foi tapeado!");            
  5517.             new Float: x,            
  5518.                 Float: y,                
  5519.                 Float: z;                
  5520.                                
  5521.             GetPlayerPos(targetclick[playerid], x, y, z);            
  5522.             SetPlayerPos(targetclick[playerid], x, y, z+10.0);            
  5523.             PlayerPlaySound(targetclick[playerid], 1130, 0.0, 0.0, 0.0);            
  5524.             format(string, sizeof(string), "[%s] [Slap] O Administrador %s tapeou %s!", getDateEx(), GetName(playerid), GetName(targetclick[playerid]));
  5525.             Log("AdminCMD.log", string);
  5526.         }        
  5527.         if(listitem == 6) //Editar        
  5528.         {  
  5529.             if(playerinfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, "Apenas administradores de level maiores que 5 podem utilizar esta função!");            
  5530.             ShowPlayerDialog(playerid, DIALOG_ADMEDIT, DIALOG_STYLE_LIST, "Edição de Usuario", "Nickname\nLevel\nSenha\nDinheiro\nBanco\nCasas\nSkin\nFaction\nRank\nTester\nDonate", "Confirmar","Cancelar");
  5531.         }
  5532.     }      
  5533.     if(dialogid == DIALOG_ADMKICK)    
  5534.     {    
  5535.         if(!response) return 1;          
  5536.         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!");                
  5537.         format(string, sizeof(string), "[ADMCMD] %s foi kickado pelo administrador %s. Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);
  5538.         SendClientMessageToAll(COLOR_BAN, string);                                                                                                                        
  5539.         Kick(targetclick[playerid]);              
  5540.         format(string, sizeof(string), "[%s] [Kick] O Administrador %s kickou %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), inputtext);
  5541.         Log("AdminCMD.log", string);                      
  5542.         format(string, sizeof(string), "%s_AdminRecord.log", GetName(targetclick[playerid]));
  5543.         new text[512];
  5544.         format(text, sizeof(text), "[Kick] %s foi kickado pelo Administrador %s Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);  
  5545.         Log(string, text);
  5546.     }    
  5547.     if(dialogid == DIALOG_ADMBAN)    
  5548.     {    
  5549.         if(!response) return 1;                                          
  5550.         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!");
  5551.         format(string, sizeof(string), "[ADMCMD] %s foi banido pelo administrador %s. Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);
  5552.         SendClientMessageToAll(COLOR_BAN, string);                                                                                                                        
  5553.         Ban(targetclick[playerid]);        
  5554.         format(string, sizeof(string), "[%s] [Ban] O Administrador %s baniu %s. Motivo: %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), inputtext);
  5555.         Log("AdminCMD.log", string);          
  5556.         format(string, sizeof(string), "%s_AdminRecord.log", GetName(targetclick[playerid]));
  5557.         new text[512];
  5558.         format(text, sizeof(text), "[Ban] %s foi banido pelo Administrador %s Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), inputtext);  
  5559.         Log(string, text);
  5560.     }            
  5561.     if(dialogid == DIALOG_ADMAJAIL)    
  5562.     {    
  5563.         if(!response) return 1;        
  5564.         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");        
  5565.         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!");
  5566.         PlaceAjail[playerid] = strval(inputtext);
  5567.         ShowPlayerDialog(playerid, DIALOG_ADMAJAILR, DIALOG_STYLE_INPUT, "Ajail Player", "Digite o motivo da Ajail abaixo", "Confirmar", "Cancelar");
  5568.     }              
  5569.     if(dialogid == DIALOG_ADMAJAILR)    
  5570.     {    
  5571.         if(!response) return 1;  
  5572.         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!");      
  5573.         format(string, sizeof(string), "[ADMCMD] %s foi preso por %d minutos pelo administrador %s. Motivo: %s", GetName(targetclick[playerid]), PlaceAjail[playerid], GetName(playerid), inputtext);        
  5574.         SendClientMessageToAll(COLOR_BAN, string);            
  5575.         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);
  5576.         Log("AdminCMD.log", string);            
  5577.         SetPlayerInterior(targetclick[playerid], 5);        
  5578.         SetPlayerPos(targetclick[playerid], 322.197998, 302.497985, 999.148437);        
  5579.         playerinfo[targetclick[playerid]][pJailTime] = PlaceAjail[playerid]*60;
  5580.         playerinfo[targetclick[playerid]][pJailed] = 1;
  5581.         playerinfo[targetclick[playerid]][pJailType] = 3;          
  5582.         SendClientMessage(playerid, COLOR_NEUTRAL2, "Eu recomendaria você a rever as regras que você quebrou!");        
  5583.         SendClientMessage(playerid, COLOR_NEUTRAL2, "Se você importunar muito o administrador que te puniu, ele poderá dobrar o seu tempo!");            
  5584.         SaveUser(targetclick[playerid]);                
  5585.         format(string, sizeof(string), "%s_AdminRecord.log", GetName(targetclick[playerid]));
  5586.         new text[512];
  5587.         format(text, sizeof(text), "[Ajail] %s foi preso pelo Administrador %s por %d minutos.Motivo: %s", GetName(targetclick[playerid]), GetName(playerid), PlaceAjail[playerid], inputtext);  
  5588.         Log(string, text);                              
  5589.         PlaceAjail[playerid] = 0;
  5590.     }
  5591.     if(dialogid == DIALOG_ADMEDIT)    
  5592.     {    
  5593.         if(!response) return 1;
  5594.         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!");                                                          
  5595.         if(listitem == 0)        
  5596.         {        
  5597.             ShowPlayerDialog(playerid, DIALOG_ADMNAMEEDIT, DIALOG_STYLE_INPUT, "Edição de Nickname", "Digite o novo nickname do jogador 'Sem _'", "Confirmar", "Cancelar");
  5598.         }                                                                                                                                                                          
  5599.         if(listitem == 1)        
  5600.         {        
  5601.             ShowPlayerDialog(playerid, DIALOG_ADMLEVELEDIT, DIALOG_STYLE_INPUT, "Edição de Level", "Digite o novo Level do jogador", "Confirmar", "Cancelar");  
  5602.         }        
  5603.         if(listitem == 2)        
  5604.         {        
  5605.             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");  
  5606.         }                  
  5607.         if(listitem == 3)        
  5608.         {        
  5609.             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");  
  5610.         }
  5611.         if(listitem == 4)
  5612.         {
  5613.             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");  
  5614.         }
  5615.         if(listitem == 5)
  5616.         {
  5617.             ShowPlayerDialog(playerid, DIALOG_HOUSEEDIT1, DIALOG_STYLE_LIST, "Edição de Casas", "Casa 1\nCasa2", "Confirmar", "Cancelar");
  5618.         }        
  5619.         if(listitem == 6)        
  5620.         {        
  5621.             ShowPlayerDialog(playerid, DIALOG_ADMEDITSKIN, DIALOG_STYLE_INPUT, "Edição de Skin", "Digite o número da nova skin do jogador", "Confirmar", "Cancelar");
  5622.         }        
  5623.         if(listitem == 7)        
  5624.         {        
  5625.             ShowPlayerDialog(playerid, DIALOG_ADMEDITGROUP, DIALOG_STYLE_INPUT, "Edição de Faction", "Digite o número da nova faction do jogador", "Confirmar", "Cancelar");  
  5626.         }        
  5627.         if(listitem == 8)        
  5628.         {        
  5629.             ShowPlayerDialog(playerid, DIALOG_ADMEDITRANK, DIALOG_STYLE_INPUT, "Edição de Rank(Faction)", "Digite o número do novo rank do jogador", "Confirmar", "Cancelar");  
  5630.         }        
  5631.         if(listitem == 9)        
  5632.         {        
  5633.             ShowPlayerDialog(playerid, DIALOG_ADMEDITTESTER, DIALOG_STYLE_INPUT, "Edição de Tester", "Digite o número do novo Tester Level do jogador", "Confirmar", "Cancelar");  
  5634.         }          
  5635.         if(listitem == 10)        
  5636.         {        
  5637.             ShowPlayerDialog(playerid, DIALOG_ADMEDITDONATE, DIALOG_STYLE_INPUT, "Edição de Donate", "Digite o número do level de Donate do jogador", "Confirmar", "Cancelar");  
  5638.         }
  5639.     }  
  5640.     if(dialogid == DIALOG_ADMNAMEEDIT)
  5641.     {
  5642.         if(!response) return 1;        
  5643.         if(IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Não utilize números no nome");                        
  5644.         format(string, sizeof(string), "Você acaba de trocar o nome de %s para %s!", GetName(targetclick[playerid]), inputtext);
  5645.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5646.         format(string, sizeof(string), "Seu nome foi trocado de %s para %s pelo Administrador %s!", GetName(targetclick[playerid]), inputtext, GetName(playerid));
  5647.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);
  5648.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, "Não esqueça de trocar o seu nick no SA-MP para se logar novamente!");                          
  5649.         SetPlayerName(targetclick[playerid], playerinfo[targetclick[playerid]][pName]);                                        
  5650.         strmid(playerinfo[targetclick[playerid]][pName], inputtext, 0, strlen(inputtext), 255);                
  5651.         SaveUser(targetclick[playerid]);                                                              
  5652.         format(string, sizeof(string), "[%s] [Editar][NOME] O Administrador %s editou o NOME de %s para %s", getDateEx(), GetName(playerid), GetName(targetclick[playerid]), inputtext);
  5653.         Log("AdminCMD.log", string);
  5654.         Kick(targetclick[playerid]);          
  5655.        
  5656.     }
  5657.     if(dialogid == DIALOG_ADMLEVELEDIT)
  5658.     {
  5659.         if(!response) return 1;        
  5660.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5661.         format(string, sizeof(string), "Você acaba de trocar o Level de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
  5662.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5663.         format(string, sizeof(string), "Seu Level foi editado para %d pelo Administrador %s!", strval(inputtext), GetName(playerid));
  5664.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5665.         playerinfo[targetclick[playerid]][pLevel] = strval(inputtext);
  5666.         SetPlayerScore(targetclick[playerid], playerinfo[targetclick[playerid]][pLevel]);        
  5667.         SaveUser(targetclick[playerid]);                                                      
  5668.         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));
  5669.         Log("AdminCMD.log", string);
  5670.     }
  5671.     if(dialogid == DIALOG_ADMPASSEDIT)
  5672.     {
  5673.         if(!response) return 1;        
  5674.         format(string, sizeof(string), "Você acaba de trocar a senha de %s para %s!", GetName(targetclick[playerid]), strval(inputtext));
  5675.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5676.         format(string, sizeof(string), "Sua senha foi editada para %s pelo Administrador %s!", strval(inputtext), GetName(playerid));
  5677.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5678.         strmid(playerinfo[targetclick[playerid]][pPassword], inputtext, 0, strlen(inputtext), 255);      
  5679.         SaveUser(targetclick[playerid]);
  5680.     }
  5681.     if(dialogid == DIALOG_ADMMONEYEDIT)
  5682.     {
  5683.         if(!response) return 1;        
  5684.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5685.         format(string, sizeof(string), "Você acaba de dar %d de dinheiro para %s!", strval(inputtext), GetName(targetclick[playerid]));
  5686.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5687.         format(string, sizeof(string), "O Administrador %s te deu %d de dinheiro!", GetName(playerid), strval(inputtext));
  5688.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5689.         playerinfo[targetclick[playerid]][pMoney] += strval(inputtext);        
  5690.         new money = strval(inputtext);
  5691.         GivePlayerMoney(playerid, money);        
  5692.         SaveUser(targetclick[playerid]);        
  5693.         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));
  5694.         Log("AdminCMD.log", string);
  5695.     }
  5696.     if(dialogid == DIALOG_ADMBANKEDIT)
  5697.     {
  5698.         if(!response) return 1;        
  5699.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5700.         format(string, sizeof(string), "Você acaba de dar %d de dinheiro para %s (Banco)!", strval(inputtext), GetName(targetclick[playerid]));
  5701.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5702.         format(string, sizeof(string), "O Administrador %s te deu %d de dinheiro (Banco)!", GetName(playerid), strval(inputtext));
  5703.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5704.         playerinfo[targetclick[playerid]][pBank] += strval(inputtext);            
  5705.         SaveUser(targetclick[playerid]);                                
  5706.         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));
  5707.         Log("AdminCMD.log", string);
  5708.     }
  5709.     if(dialogid == DIALOG_ADMEDITSKIN)
  5710.     {
  5711.         if(!response) return 1;        
  5712.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5713.         format(string, sizeof(string), "Você acaba de setar a skin de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
  5714.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5715.         format(string, sizeof(string), "O Administrador %s setou sua skin para %d!", GetName(playerid), strval(inputtext));
  5716.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5717.         playerinfo[targetclick[playerid]][pSkin] = strval(inputtext);        
  5718.         new skin = strval(inputtext);
  5719.         SetPlayerSkin(targetclick[playerid], skin);            
  5720.         SaveUser(targetclick[playerid]);                    
  5721.         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));
  5722.         Log("AdminCMD.log", string);
  5723.     }                              
  5724.     if(dialogid == DIALOG_ADMEDITGROUP)
  5725.     {
  5726.         if(!response) return 1;        
  5727.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5728.         format(string, sizeof(string), "Você acaba de setar a faction de %d para %s!", strval(inputtext), GetName(targetclick[playerid]));
  5729.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5730.         format(string, sizeof(string), "O Administrador %s setou sua faction para %d!", GetName(playerid), strval(inputtext));
  5731.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5732.         playerinfo[targetclick[playerid]][pFaction] = strval(inputtext);                  
  5733.         SaveUser(targetclick[playerid]);                                      
  5734.         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));
  5735.         Log("AdminCMD.log", string);
  5736.     }                                
  5737.     if(dialogid == DIALOG_ADMEDITRANK)
  5738.     {
  5739.         if(!response) return 1;        
  5740.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5741.         format(string, sizeof(string), "Você acaba de setar o rank(faction) de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
  5742.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5743.         format(string, sizeof(string), "O Administrador %s setou seu rank(faction) para %d!", GetName(playerid), strval(inputtext));
  5744.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5745.         playerinfo[targetclick[playerid]][pRank] = strval(inputtext);                  
  5746.         SaveUser(targetclick[playerid]);                                      
  5747.         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));
  5748.         Log("AdminCMD.log", string);
  5749.     }    
  5750.     if(dialogid == DIALOG_ADMEDITTESTER)
  5751.     {
  5752.         if(!response) return 1;        
  5753.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5754.         format(string, sizeof(string), "Você acaba de dar Tester nível %d para %s!", strval(inputtext), GetName(targetclick[playerid]));
  5755.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5756.         format(string, sizeof(string), "O Administrador %s te deu Tester nível %d. Parabéns!", GetName(playerid), strval(inputtext));
  5757.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5758.         playerinfo[targetclick[playerid]][pTester] += strval(inputtext);            
  5759.         SaveUser(targetclick[playerid]);                    
  5760.         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));
  5761.         Log("AdminCMD.log", string);
  5762.     }    
  5763.     if(dialogid == DIALOG_ADMEDITDONATE)
  5764.     {
  5765.         if(!response) return 1;        
  5766.         if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Utilize apenas números!");        
  5767.         format(string, sizeof(string), "Você acaba de setar o nível de donate de %s para %d!", GetName(targetclick[playerid]), strval(inputtext));
  5768.         SendClientMessage(playerid, COLOR_SUCESS, string);
  5769.         format(string, sizeof(string), "O Administrador %s setou o seu nível de donate para %d!", GetName(playerid), strval(inputtext));
  5770.         SendClientMessage(targetclick[playerid], COLOR_SUCESS, string);          
  5771.         playerinfo[targetclick[playerid]][pDonate] += strval(inputtext);            
  5772.         SaveUser(targetclick[playerid]);                                            
  5773.         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));
  5774.         Log("AdminCMD.log", string);
  5775.     }    
  5776.     if(dialogid == DIALOG_AJUDA)    
  5777.     {    
  5778.         if(!response) return 1;        
  5779.         if(listitem == 0) //Comandos Gerais        
  5780.         {                                        
  5781.             SendClientMessage(playerid, COLOR_NEUTRAL2, "        [Comandos Gerais]");        
  5782.             SendClientMessage(playerid, COLOR_SOS, "/sos | /reportar | /mascara | /casa | /empresa | /v | /stats | /comprar | /ligar | /desligar");
  5783.             SendClientMessage(playerid, COLOR_SOS, "/depositar | /sacar | /extrato");  
  5784.         }                                        
  5785.         if(listitem == 1) //Comandos Veiculares      
  5786.         {        
  5787.             SendClientMessage(playerid, COLOR_NEUTRAL2, "        [Comandos Veiculares]");                    
  5788.             SendClientMessage(playerid, COLOR_SOS, "/v | /na | /na | /na | /na | /na | /na | /na | /na | /na");
  5789.         }        
  5790.         if(listitem == 2) //Comandos de Factions        
  5791.         {                                                                                
  5792.             if(playerinfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não está em uma faction]");
  5793.             SendClientMessage(playerid, COLOR_NEUTRAL2, "        [Comandos de Faction]");
  5794.             new faction = playerinfo[playerid][pFaction];
  5795.             if(factioninfo[faction-1][fType] == 1 || factioninfo[faction-1][fType] == 2 || factioninfo[faction-1][fType] == 3)  
  5796.             {          
  5797.                 SendClientMessage(playerid, COLOR_SOS, "/f | /d | /r | /membros | /revistar | /algemar | /desalgemar | /na | /na | /na");                
  5798.             }            
  5799.             else            
  5800.             {            
  5801.                 SendClientMessage(playerid, COLOR_SOS, "/f | /membros | /na | /na | /na | /na | /na | /na | /na | /na");  
  5802.             }
  5803.         }        
  5804.         if(listitem == 3) //Comandos de Líderes      
  5805.         {                            
  5806.             if(playerinfo[playerid][pRank] != 10) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é líder de nenhuma faction]");
  5807.             SendClientMessage(playerid, COLOR_NEUTRAL2, "        [Comandos de Líderes]");            
  5808.             SendClientMessage(playerid, COLOR_SOS, "/convidar | /promover | /rebaixar | /nomerank | /na | /na | /na | /na | /na | /na");
  5809.         }
  5810.         if(listitem == 4) //Comandos de Donaters      
  5811.         {                            
  5812.             if(playerinfo[playerid][pDonate] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é um Donater]");
  5813.             SendClientMessage(playerid, COLOR_NEUTRAL2, "        [Comandos de Donaters]");            
  5814.             SendClientMessage(playerid, COLOR_SOS, "/togpm | /blockpm | /na | /na | /na | /na | /na | /na | /na | /na");
  5815.         }        
  5816.         if(listitem == 5) //Comandos de Tester      
  5817.         {                                
  5818.             if(playerinfo[playerid][pTester] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é um Tester]");
  5819.             SendClientMessage(playerid, COLOR_NEUTRAL2, "        [Comandos de Tester]");            
  5820.             SendClientMessage(playerid, COLOR_SOS, "[1] /tduty | /ah | /rh | /checarsos | /na | /na | /na | /na | /na | /na");
  5821.         }        
  5822.         if(listitem == 6) //Comandos de Administradores      
  5823.         {                
  5824.             if(playerinfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Acesso Negado! [Você não é um Adminstrador]");
  5825.             SendClientMessage(playerid, COLOR_NEUTRAL2, "        [Comandos de Administradores]");              
  5826.             if(playerinfo[playerid][pAdmin] >= 1)
  5827.             {
  5828.                 SendClientMessage(playerid, COLOR_SOS, "[1] /ooc | /aduty | /mascarados | /ar | /rr | /checarreports | /ajail | /kick | /ban | /tapa");            
  5829.                 SendClientMessage(playerid, COLOR_SOS, "[1] /ir | /spec | /darlider | /ircarro | /na | /na | /na | /na | /na | /na");                
  5830.             }            
  5831.             if(playerinfo[playerid][pAdmin] >= 2)            
  5832.             {            
  5833.                 SendClientMessage(playerid, COLOR_SOS, "[2] Comandos admin 2 ficarão aqui");
  5834.             }            
  5835.             if(playerinfo[playerid][pAdmin] >= 3)            
  5836.             {            
  5837.                 SendClientMessage(playerid, COLOR_SOS, "[3] Comandos admin 3 ficarão aqui");
  5838.             }            
  5839.             if(playerinfo[playerid][pAdmin] >= 4)            
  5840.             {            
  5841.                 SendClientMessage(playerid, COLOR_SOS, "[4] Comandos admin 4 ficarão aqui");
  5842.             }              
  5843.             if(playerinfo[playerid][pAdmin] >= 5)            
  5844.             {            
  5845.                 SendClientMessage(playerid, COLOR_SOS, "[5] Comandos admin 5 ficarão aqui");
  5846.             }            
  5847.             if(playerinfo[playerid][pAdmin] >= 6)            
  5848.             {            
  5849.                 SendClientMessage(playerid, COLOR_SOS, "[6] Comandos admin 6 ficarão aqui");
  5850.             }            
  5851.             if(playerinfo[playerid][pAdmin] >= 1337)            
  5852.             {            
  5853.                 SendClientMessage(playerid, COLOR_SOS, "[1337] Comandos admin 1337 ficarão aqui");
  5854.             }
  5855.         }        
  5856.     }
  5857.     return 1;
  5858. }
  5859.  
  5860. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  5861. {
  5862.     if(playerinfo[playerid][pAdmin] > 0)    
  5863.     {                
  5864.         targetclick[playerid] = clickedplayerid;        
  5865.         if(clickedplayerid == playerid) return 1;
  5866.         ShowPlayerDialog(playerid, DIALOG_ADMACTIONS, DIALOG_STYLE_LIST, GetName(clickedplayerid), "Spec\nIr\nKick\nBan\nAjail\nTapa\nEditar", "Confirmar", "Cancelar");        
  5867.         return 1;
  5868.     }
  5869.     return 1;
  5870. }
  5871.  
  5872. stock getDateEx(){
  5873.     new
  5874.         a,b,c,d,e,f, stringx[128];
  5875.     gettime(a,b,c);
  5876.     getdate(d,e,f);
  5877.     format(stringx, 128, "%i/%i/%i | %i:%i:%i", f,e,d,a,b,c);
  5878.     return stringx;
  5879. }
  5880.  
  5881. stock IsNumeric(const strings[])
  5882. {
  5883.         for (new i = 0, j = strlen(strings); i < j; i++)
  5884.         {
  5885.                 if (strings[i] > '9' || strings[i] < '0') return 0;
  5886.         }
  5887.         return 1;
  5888. }
  5889.  
  5890. stock Dealerships(playerid)
  5891. {
  5892.     if(IsPlayerInRangeOfPoint(playerid, 5.0,  145.8890,-1834.8905,2.0585))
  5893.     {
  5894.         SendClientMessage(playerid, COLOR_SOS, "Dinghy (473, $17500), Reefer (453, $22000), Tropic (454, $20000), Squallo (446, $275000) ");
  5895.     }
  5896.     if(IsPlayerInRangeOfPoint(playerid, 5.0, 1702.9060,-1469.3427,13.5469))
  5897.     {
  5898.         SendClientMessage(playerid, COLOR_NEUTRAL2, "|____________ CONCESSIONARIA 01 ____________|");
  5899.         SendClientMessage(playerid, -1, "/v comprar [id] | Nome (ID, $Preço)");
  5900.         SendClientMessage(playerid, COLOR_SOS, "Landstalker (400, $40000), Bravura (401, $16000), Buffalo (402, $46000), Perinniel (404, $12000) ");
  5901.         SendClientMessage(playerid, COLOR_SOS, "Sentinel (405, $32000), Limosine (409, $110000), Manana (410, $9000), Infernus (411, $500000) ");
  5902.         SendClientMessage(playerid, COLOR_SOS, "Voodoo (412, $23000), Cheetah (415, $475000), Moonbeam (418, $10000), Esperanto (419, $18000) ");
  5903.         SendClientMessage(playerid, COLOR_SOS, "Washington (421, $36000), Bobcat (422, $14000), Premier (426, $40000), Banshee (429, $57000) ");
  5904.         SendClientMessage(playerid, COLOR_SOS, "Previon (436, $11000), Stallion (439, $17000), Admiral (445, $31500), Turismo (451, $625000) ");
  5905.         SendClientMessage(playerid, COLOR_SOS, "Solair (458, $13500), PCJ-600 (461, $50000), Fagio (462, $7000), Freeway (463, $13000) ");
  5906.         SendClientMessage(playerid, COLOR_SOS, "Glendale (466, $19500), Oceanic (467, $22500), Sanchez (468, $37500), Hermes (474, $16200) ");
  5907.         SendClientMessage(playerid, COLOR_SOS, "Sabre (475, $24500), ZR-350 (477, $125000), Regina (479, $12000), Comet (480, $72000) ");
  5908.         SendClientMessage(playerid, COLOR_SOS, "BMX (481, $4500), Burrito (482, $20500), Camper (483, $19500), Rancher (489, $25999) ");
  5909.         SendClientMessage(playerid, COLOR_SOS, "Virgo (491, $28000), Greenwood (492, $25000), Blista Compact (496, $19000), Mesa (500, $22500) ");
  5910.         SendClientMessage(playerid, COLOR_SOS, "Super GT (506, $700000), Elegant (507, $34000), Bike (509, $4500), Nebula (516, $16200) ");
  5911.     }
  5912.     else if(IsPlayerInRangeOfPoint(playerid, 5.0, 411.9653,-1729.3180,9.3693))
  5913.     {
  5914.         SendClientMessage(playerid, COLOR_NEUTRAL2, "|____________ CONCESSIONARIA 02 ____________|");
  5915.         SendClientMessage(playerid, -1, "/v comprar [id] | Nome (ID, $Preço)");
  5916.         SendClientMessage(playerid, COLOR_SOS, "Majestic (517, $20000), Buccaneer (518, $24000), FRC-900 (521, $80000), Fortune (526, $14000) ");
  5917.         SendClientMessage(playerid, COLOR_SOS, "Cadrona (527, $14000), Willard (529, $14500), Feltzer (533, $50000), Remington (534, $27000) ");
  5918.         SendClientMessage(playerid, COLOR_SOS, "Slamvan (535, $36000), Blade (536, $24000), Vincent (540, $29000), Bullet (541, $550000) ");
  5919.         SendClientMessage(playerid, COLOR_SOS, "Clover (542, $17500), Sadler (543, $13500), Hustler (545, $34500), Intruder (546, $15000) ");
  5920.         SendClientMessage(playerid, COLOR_SOS, "Primo (547, $18000), Tampa (549, $17500), Sunrise (550, $50000), Merit (551, $42000) ");
  5921.         SendClientMessage(playerid, COLOR_SOS, "Yosemite (554, $27000), Windsor (555, $60000), Uranus (558, $56000), Jester (559, $66000) ");
  5922.         SendClientMessage(playerid, COLOR_SOS, "Sultan (560, $375000), Stratum (561, $50000), Elegy (562, $105000), Flash (565, $48000) ");
  5923.         SendClientMessage(playerid, COLOR_SOS, "Tahoma (566, $27000), Savanna (567, $28000), Broadway (575, $23000), Tornado (576, $17500) ");
  5924.         SendClientMessage(playerid, COLOR_SOS, "Huntley (579, $40000), Stafford (580, $41500), Emperror (585, $15000), Wayfarer (586, $11000) ");
  5925.         SendClientMessage(playerid, COLOR_SOS, "Euros (587, $20000), Club (589, $16000), Picador (600, $13500), Alpha (602, $34000) ");
  5926.         SendClientMessage(playerid, COLOR_SOS, "Phoenix (603, $43000) Pony(413, 20000), Yankee(456, 22000), Benson(499, 35000), Mule(414, 40000) Faggio(462, 7000)");
  5927.     }        
  5928.     return 1;
  5929. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement