Advertisement
Guest User

Untitled

a guest
May 14th, 2011
2,481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 46.53 KB | None | 0 0
  1. //============================================================================//
  2. //            ******* Brasil Drift Life [DRT v1.0a]*******                    //
  3. //                           By Lucas_Locate                                  //
  4. //                        * Apoio ESTAC SA:MP *                              //
  5. //============================================================================//
  6.  
  7. //=======================| Incluide's |=======================================//
  8. #include <a_samp>
  9. #include <a_players>
  10. #include <dini>
  11. #include <dudb>
  12. #include <zcmd>
  13. #include <colors>
  14. #include <F_streamer>
  15.  
  16. #pragma tabsize 0
  17. #pragma unused ret_memcpy
  18. #pragma unused strtok
  19.  
  20. //==============================| Defines |===================================//
  21. #define MAX_STRING 255
  22. #define player_x -250.9738
  23. #define player_y 2585.6497
  24. #define player_z 63.5703
  25. #define player_angle 210.3500
  26. #define camera_x -248.9410
  27. #define camera_y 2581.5327
  28. #define camera_z 64.9334
  29. #define moving_speed 50
  30. #define SERVER_USER_FILE "%s.ini"
  31. #define V_ID GetPlayerVehicleID(playerid)
  32. #define ResetMoneyBar ResetPlayerMoney
  33. #define UpdateMoneyBar GivePlayerMoney
  34. #define Fusion_Lucas 9122 // DIALOG
  35. #define Dialog_Fusion 9123 // DIALOG
  36. #define Dialog 4670 // DIALOG
  37. #define Reparar KEY_SUBMISSION
  38. #define senha aspect3571598426
  39. #define Adms "Admins/%s.ini"
  40.  
  41. //=====================| Cores: 0xFFFFFFFF + {000000} |=======================//
  42. #define WHITE        0xFFFFFFAA  {1BDE4F}
  43. #define VERDE        0x33AA33AA  {33AA33}
  44. #define PRETO        0x000000FF  {000000}
  45. #define AZUL         0x2641FEAA  {2641FE}
  46. #define BLUE         0x004CFFAA  {2D2DC2}
  47. #define DBLUE        0x0800A8AA  {8FADF2}
  48. #define ROSA         0xFF48FFAA  {B51DAB}
  49. #define ROSA1        0xDF00E0AA  {D60FC9}
  50. #define GREY         0xC190FFAA  {A8A2A2}
  51. #define AMARELO      0xE8D000AA  {EDF72F}
  52. #define AMARELO1     0xD09C00AA  {DBE61C}
  53. #define LARANJA      0xF08400AA  {E67802}
  54. #define LARANJA1     0xFF2600AA  {FFB05C}
  55. #define ATENÇÃO      0xFF3620AA  {1AEDE3}
  56. #define VERMELHO     0xE00000AA  {F20A0A}
  57. #define VERMELHO1    0x980000AA  {FC2D2D}
  58. #define cyan         0x99FFFFAA
  59.  
  60. //==========================| TEXTO |=====================================//
  61. new Text:Textdraw99;
  62. new Text:Textdraw88;
  63. new Text:Textdraw9;
  64. new Text:fusion;
  65. //============================================================================//
  66. //==========================| Forward _____ |================================//
  67. forward SendTesterAdminMessage(color, string[]);
  68. forward carspawn();
  69. forward MoveCamera(playerid);
  70. forward AutoScore();
  71. forward SendMSG();
  72. forward MoveCamera(playerid);
  73. forward SendAdminMessage(color, string[]);
  74. forward logkicktodos(string[]);
  75. forward logkick(string[]);
  76. forward logban(string[]);
  77. forward Relogio(playerid);
  78.  
  79. //============================================================================//
  80.  
  81. enum pInfo
  82. {
  83.     pAdminLevel,
  84.     pCash,
  85.     pScore,
  86.     bool:SpawnDance,
  87.     Float:SpawnAngle,
  88.     SpawnTimer,
  89.     pMuted,
  90.     pJailed,
  91.     pBanned,
  92. }
  93.  
  94. new PlayerInfo[MAX_PLAYERS][pInfo];
  95. //:===========================================================================//
  96. new gPlayerLogged[MAX_PLAYERS];
  97. new VecSpawned[MAX_PLAYERS] = (-1);
  98. new Cash[MAX_PLAYERS];
  99. new Float:gRandomPlayerSpawns[7][3] =
  100. {
  101.     {351.12451172,2536.12231445,15.7092},
  102.     {1837.6632,-2435.8079,13.5547},
  103.     {2489.2661,-1667.9122,13.3438},
  104.     {-1955.6119,280.5292,41.0471},
  105.     {2271.2722,1397.3500,42.8203},
  106.     {1506.5234,1227.0442,10.8125},
  107.     {351.12451172,2536.12231445,15.7092}
  108. };
  109.  
  110. new RandomColors [] =
  111. {
  112.   0xFFFFFFAA,
  113.   0x33AA33AA,
  114.   0x000000FF,
  115.   0x2641FEAA,
  116.   0x004CFFAA,
  117.   0x0800A8AA,
  118.   0xFF48FFAA,
  119.   0xDF00E0AA,
  120.   0xC190FFAA,
  121.   0xE8D000AA,
  122.   0xD09C00AA,
  123.   0xF08400AA,
  124.   0xFF2600AA,
  125.   0xFF3620AA,
  126.   0xE00000AA,
  127.   0x980000AA,
  128. };
  129.  
  130. new RandomMSG[][] =
  131. {
  132.   "Em breve teremos nosso site, e divulgaremos aqui!",
  133.   "Adicione este servidor aos seus Favoritos. Assim poderá jogar todos os dias."
  134. };
  135.  
  136. //============================================================================//
  137.  
  138. main()
  139. {
  140.     print("|================================|");
  141.     print("| GM Criado do 0 sem copias!     |");
  142.     print("| Nome do GM: Brasil Drift Life  |");
  143.     print("| Tipo do GM: Drift              |");
  144.     print("|---------| CREDITOS |-----------|");
  145.     print("|        Lucas_Locate            |");
  146.     print("|     Apoio ESTAC SA:MP          |");
  147.     print("|================================|");
  148. }
  149.  
  150. public OnFilterScriptInit()
  151. {
  152.     return 1;
  153. }
  154.  
  155. public OnGameModeInit()
  156. {
  157.     SetGameModeText("BDL [DRT v1.0a]");
  158.     SetTimer("SendMSG", 100000, true);
  159. //==================================| Skin Players |======================================//
  160.     AddPlayerClass(60,  1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  161.     AddPlayerClass(132, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  162.     AddPlayerClass(137, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  163.     AddPlayerClass(158, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  164.     AddPlayerClass(161, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  165.     AddPlayerClass(33,  1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  166.     AddPlayerClass(258, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  167.     AddPlayerClass(23,  1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  168.     AddPlayerClass(147, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  169.     AddPlayerClass(68,  1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  170.     AddPlayerClass(179, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  171.     AddPlayerClass(187, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  172.     AddPlayerClass(203, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  173.     AddPlayerClass(217, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  174.     AddPlayerClass(70,  1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  175.     AddPlayerClass(83,  1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  176.     AddPlayerClass(101, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  177.     AddPlayerClass(102, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  178.     AddPlayerClass(103, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  179.     AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  180.     AddPlayerClass(105, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  181.     AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  182.     AddPlayerClass(107, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  183.     AddPlayerClass(108, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  184.     AddPlayerClass(109, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  185.     AddPlayerClass(110, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  186.     AddPlayerClass(111, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  187.     AddPlayerClass(112, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  188.     AddPlayerClass(113, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  189.     AddPlayerClass(200, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  190.     AddPlayerClass(114, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  191.     AddPlayerClass(115, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  192.     AddPlayerClass(116, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  193.     print("Stage 1 -----> Skins Loaded");
  194.    
  195. //==========================| Fim das Skins |=================================//
  196. /******************************************************************************/
  197.     UsePlayerPedAnims();
  198.     DisableInteriorEnterExits();
  199.     AllowInteriorWeapons(1);
  200.     SetTimer("carhealth",1000,true);
  201.     SetTimer("MoneyTimer", 999,true);
  202.     SetTimer("JetPack",1000,true);
  203.     SetTimer("AutoScore",120000,true);
  204.     SetTimer("moneyscoreupdate",360000,true);
  205.     print("Stage 2 -----> Dynamics Loaded");
  206.    
  207. /****************************************************************************************/
  208.     AddStaticVehicleEx(522,339.72915649,2534.34619141,16.57068443,180.29052734,-1,-1,150000); //NRG-500
  209.     AddStaticVehicleEx(522,342.22851562,2534.34570312,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  210.     AddStaticVehicleEx(522,345.25350952,2534.34570312,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  211.     AddStaticVehicleEx(522,343.85308838,2534.34570312,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  212.     AddStaticVehicleEx(522,340.95269775,2534.34570312,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  213.     AddStaticVehicleEx(522,339.57705688,2538.09375000,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  214.     AddStaticVehicleEx(522,340.80123901,2538.09375000,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  215.     AddStaticVehicleEx(522,342.25079346,2538.09375000,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  216.     AddStaticVehicleEx(522,343.79998779,2538.09375000,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  217.     AddStaticVehicleEx(522,345.32479858,2538.09375000,16.57068443,180.28564453,-1,-1,150000); //NRG-500
  218.     AddStaticVehicleEx(411,345.46646118,2547.48144531,17.09603882,180.04052734,-1,-1,150000); //Infernus
  219.     AddStaticVehicleEx(411,348.64077759,2547.48144531,17.09603882,180.03845215,-1,-1,150000); //Infernus
  220.     AddStaticVehicleEx(411,351.64077759,2547.48144531,17.09603882,180.03845215,-1,-1,150000); //Infernus
  221.     AddStaticVehicleEx(411,355.01565552,2547.48144531,17.09603882,180.03845215,-1,-1,150000); //Infernus
  222.     AddStaticVehicleEx(411,342.34060669,2547.48144531,17.09603882,180.03845215,-1,-1,150000); //Infernus
  223.     AddStaticVehicleEx(415,1016.95251465,1349.70275879,314.37084961,162.50463867,-1,-1,150000); //Cheetah
  224.     AddStaticVehicleEx(415,1019.25195312,1356.75292969,314.37084961,162.50427246,-1,-1,150000); //Cheetah
  225.     AddStaticVehicleEx(415,1021.75195312,1364.32800293,314.37084961,162.50427246,-1,-1,150000); //Cheetah
  226.     AddStaticVehicleEx(415,1024.32727051,1372.47753906,314.37084961,162.50427246,-1,-1,150000); //Cheetah
  227.     AddStaticVehicleEx(415,1027.02709961,1380.80236816,314.37084961,162.50427246,-1,-1,150000); //Cheetah
  228.     AddStaticVehicleEx(415,1029.72680664,1389.07678223,314.37084961,162.50427246,-1,-1,150000); //Cheetah
  229.     AddStaticVehicleEx(522,1007.59570312,1351.54711914,312.12084961,165.35046387,-1,-1,150000); //NRG-500
  230.     AddStaticVehicleEx(522,1009.34570312,1357.04687500,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  231.     AddStaticVehicleEx(522,1010.59570312,1361.79687500,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  232.     AddStaticVehicleEx(522,1012.94604492,1361.27160645,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  233.     AddStaticVehicleEx(522,1011.47009277,1356.49597168,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  234.     AddStaticVehicleEx(522,1009.71972656,1351.29467773,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  235.     AddStaticVehicleEx(522,1014.34460449,1364.85852051,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  236.     AddStaticVehicleEx(522,1011.71911621,1365.45898438,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  237.     AddStaticVehicleEx(522,1012.91894531,1369.70898438,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  238.     AddStaticVehicleEx(522,1015.26904297,1369.15844727,312.12084961,165.34973145,-1,-1,150000); //NRG-500
  239.     AddStaticVehicleEx(411,-1347.99255371,-284.67355347,14.77343559,315.60510254,-1,-1,15); //Infernus
  240.     AddStaticVehicleEx(411,-1351.29370117,-281.42303467,14.77343559,315.60424805,-1,-1,15); //Infernus
  241.     AddStaticVehicleEx(411,-1354.66784668,-278.02264404,14.77343559,315.60424805,-1,-1,15); //Infernus
  242.     AddStaticVehicleEx(411,-1358.51806641,-274.22204590,14.77343559,315.60424805,-1,-1,15); //Infernus
  243.     AddStaticVehicleEx(411,-1344.71765137,-288.03149414,14.77343559,315.60424805,-1,-1,15); //Infernus
  244.     AddStaticVehicleEx(556,-1333.66467285,-283.94033813,14.92343330,22.67492676,-1,-1,15); //Monster A
  245.     AddStaticVehicleEx(556,-1328.91455078,-282.26477051,14.92343330,22.67321777,-1,-1,15); //Monster A
  246.     AddStaticVehicleEx(556,-1324.41406250,-280.26455688,14.92343330,22.67028809,-1,-1,15); //Monster A
  247.     AddStaticVehicleEx(556,-1320.13903809,-278.23892212,14.92343330,22.67028809,-1,-1,15); //Monster A
  248.     AddStaticVehicleEx(522,-1362.57019043,-269.94372559,13.99842453,316.15014648,-1,-1,15); //NRG-500
  249.     AddStaticVehicleEx(522,-1363.76904297,-268.99359131,13.99842453,316.14807129,-1,-1,15); //NRG-500
  250.     AddStaticVehicleEx(522,-1364.89343262,-267.79333496,13.99842453,316.14807129,-1,-1,15); //NRG-500
  251.     AddStaticVehicleEx(522,-1365.99340820,-266.59295654,13.99842453,316.14807129,-1,-1,15); //NRG-500
  252.     AddStaticVehicleEx(522,-1367.31896973,-265.24310303,13.99842453,316.14807129,-1,-1,15); //NRG-500
  253.     AddStaticVehicleEx(522,-1368.84484863,-264.01748657,13.99842453,316.14807129,-1,-1,15); //NRG-500
  254.     AddStaticVehicleEx(522,-1370.29614258,-262.51696777,13.99842453,316.14807129,-1,-1,15); //NRG-500
  255.     AddStaticVehicleEx(411,1894.36376953,-2357.12988281,13.92186928,270.52014160,-1,-1,15); //Infernus
  256.     AddStaticVehicleEx(411,1894.36328125,-2361.52587891,13.92186928,270.51635742,-1,-1,15); //Infernus
  257.     AddStaticVehicleEx(411,1894.41333008,-2365.59912109,13.92186928,270.51635742,-1,-1,15); //Infernus
  258.     AddStaticVehicleEx(411,1894.41308594,-2369.49804688,13.92186928,270.51635742,-1,-1,15); //Infernus
  259.     AddStaticVehicleEx(411,1894.41308594,-2373.54980469,13.92186928,270.51635742,-1,-1,15); //Infernus
  260.     AddStaticVehicleEx(522,1891.19287109,-2385.13037109,13.68911552,244.42041016,-1,-1,15); //NRG-500
  261.     AddStaticVehicleEx(522,1890.54174805,-2387.07617188,13.68911552,244.41833496,-1,-1,15); //NRG-500
  262.     AddStaticVehicleEx(522,1889.81530762,-2389.07324219,13.68911552,244.41833496,-1,-1,15); //NRG-500
  263.     AddStaticVehicleEx(522,1886.68933105,-2387.55029297,13.68911552,244.41833496,-1,-1,15); //NRG-500
  264.     AddStaticVehicleEx(522,1887.36413574,-2385.55273438,13.68911552,244.41833496,-1,-1,15); //NRG-500
  265.     AddStaticVehicleEx(522,1888.08825684,-2383.70312500,13.68911552,244.41833496,-1,-1,15); //NRG-500
  266.         print("Stage 3 -----> Vehicle Loaded");
  267.  
  268. //================================| Relogio |=================================//
  269.     SetTimer("Relogio", 1000, 1);
  270.     Textdraw99 = TextDrawCreate(450.000000,5.000000, "--");
  271.     Textdraw88 = TextDrawCreate(551.000000,23.000000,"--");
  272.     TextDrawAlignment(Textdraw99,0);
  273.     TextDrawAlignment(Textdraw88,0);
  274.     TextDrawBackgroundColor(Textdraw99,0xE00000AA);
  275.     TextDrawBackgroundColor(Textdraw88,0x33AA33AA);
  276.     TextDrawFont(Textdraw99,2);
  277.     TextDrawLetterSize(Textdraw99,0.499999,1.500000);
  278.     TextDrawFont(Textdraw88,2);
  279.     TextDrawLetterSize(Textdraw88,0.399999,2.000000);
  280.     TextDrawColor(Textdraw99,0xffffffff);
  281.     TextDrawColor(Textdraw88,0xffffffff);
  282.     TextDrawSetOutline(Textdraw99,1);
  283.     TextDrawSetOutline(Textdraw88,1);
  284.     TextDrawSetProportional(Textdraw99,1);
  285.     TextDrawSetProportional(Textdraw88,1);
  286.     TextDrawSetShadow(Textdraw99,1);
  287.     TextDrawSetShadow(Textdraw88,1);
  288.     print("Stage 4 -----> Relogio Loaded");
  289. //===============================| Text BDL |=================================//
  290.     fusion = TextDrawCreate(4.000000,435.000000,"*BDL*            Brasil Drift Life             Versão: v1.0a ");
  291.     TextDrawFont(fusion,2);
  292.     TextDrawColor(fusion,0x33AA33AA);
  293.     TextDrawLetterSize(fusion,0.599999,1.000000);
  294.     TextDrawSetOutline(fusion,1);
  295.     TextDrawSetShadow(fusion,1);
  296.     TextDrawSetProportional(fusion,1);
  297.     TextDrawBackgroundColor(fusion,0x000000ff);
  298.     print("Stage 5 -----> Text BDL Loaded");
  299.     return 1;
  300. }
  301.  
  302. public OnFilterScriptExit()
  303. {
  304.     for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  305.     {
  306.         F_DestroyObject(objectid);
  307.     }
  308.     F_ObjectUpdate(false);
  309.  
  310.     TextDrawHideForAll(Textdraw9);
  311.     TextDrawDestroy(Textdraw9);
  312.     return 1;
  313. }
  314.  
  315. public MoveCamera(playerid)
  316. {
  317.     SetPlayerCameraPos(playerid, player_x - 2 * floatsin(-PlayerInfo[playerid][SpawnAngle], degrees), player_y - 10 * floatcos(-PlayerInfo[playerid][SpawnAngle], degrees), player_z + 3);
  318.     SetPlayerCameraLookAt(playerid, player_x, player_y, player_z + 0.5);
  319.  
  320.  
  321.     PlayerInfo[playerid][SpawnAngle] += 0.5;
  322.  
  323.     if (PlayerInfo[playerid][SpawnAngle] >= 360.0)
  324.         PlayerInfo[playerid][SpawnAngle] = 0.0;
  325.  
  326. }
  327.  
  328. public OnGameModeExit()
  329. {
  330.     for(new i = 0; i < MAX_PLAYERS; i++)
  331.     {
  332.         if(VecSpawned[i] != -1)
  333.         {
  334.             DestroyVehicle(VecSpawned[i]);
  335.             VecSpawned[i] = (-1);
  336.         }
  337.     }
  338.     return 1;
  339. }
  340.  
  341. public OnPlayerRequestClass(playerid, classid)
  342. {
  343.     SetPlayerPos(playerid, player_x,player_y,player_z);
  344.     SetPlayerFacingAngle(playerid, player_angle);
  345.     SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
  346.     SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
  347.     ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
  348.     PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238);
  349.     if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
  350.     PlayerInfo[playerid][SpawnDance] = false;
  351.     return 1;
  352. }
  353.  
  354. public OnPlayerConnect(playerid)
  355. {
  356.     GivePlayerMoney(playerid, 600000);
  357.     PlayerInfo[playerid][SpawnDance] = true;
  358.     ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
  359.     gPlayerLogged[playerid] = 0;
  360.     new name[MAX_PLAYER_NAME], file[256];
  361.     GetPlayerName(playerid, name, sizeof(name));
  362.     format(file, sizeof(file), SERVER_USER_FILE, name);
  363.     if (!dini_Exists(file))
  364.     {
  365.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Life", "{E67802}Bem vindo, você não está registrado, digite sua senha abaixo", "Registrar", "Sair");
  366.     }
  367.     if(fexist(file))
  368.     {
  369.         ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Life", "{E67802}Bem Vindo, você está registrado, Digite sua senha abaixo ", "Login", "Sair");
  370.     }
  371.     new pname[MAX_PLAYER_NAME],
  372.     string[64];
  373.     GetPlayerName(playerid, pname, sizeof(pname));
  374.     format(string, sizeof(string), " %s Entrou no Servidor!", pname);
  375.     SendClientMessageToAll(0x38FF06FF, string);
  376.     {
  377.     TextDrawShowForPlayer(playerid, Textdraw99);
  378.     TextDrawShowForPlayer(playerid, Textdraw88);
  379.     TextDrawShowForPlayer(playerid, Textdraw9);
  380.     }
  381.     return 1;
  382. }
  383.  
  384. public OnPlayerDisconnect(playerid, reason)
  385. {
  386.     new
  387.     name[MAX_PLAYER_NAME],
  388.     file[256];
  389.     GetPlayerName(playerid, name, sizeof(name));
  390.     format(file, sizeof(file), SERVER_USER_FILE, name);
  391.     if(gPlayerLogged[playerid] == 1)
  392.     {
  393.         dini_IntSet(file, "Score", GetPlayerScore(playerid));
  394.         dini_IntSet(file, "Money", GetPlayerMoney(playerid));
  395.         dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
  396.         dini_IntSet(file, "Banido",PlayerInfo[playerid][pBanned]);
  397.         dini_IntSet(file, "Preso",PlayerInfo[playerid][pJailed]);
  398.         dini_IntSet(file, "Mudo",PlayerInfo[playerid][pMuted]);
  399.     }
  400.     gPlayerLogged[playerid] = 0;
  401.     KillTimer( PlayerInfo[playerid][SpawnTimer] );
  402.     new
  403.     pname[MAX_PLAYER_NAME],
  404.     string[128];
  405.     GetPlayerName(playerid, pname, sizeof(pname));
  406.     switch(reason)
  407.     {
  408.         case 0: format(string, sizeof(string), " %s saiu do servidor. (Crashed)", pname);
  409.         case 1: format(string, sizeof(string), " %s saiu do servidor. (Saiu)", pname);
  410.         case 2: format(string, sizeof(string), " %s saiu do servidor. (Kicked/Banned)", pname);
  411.     }
  412.     SendClientMessageToAll(0x2641FEAA, string);
  413.     if(VecSpawned[playerid] != -1)
  414.     {
  415.         DestroyVehicle(VecSpawned[playerid]);
  416.         VecSpawned[playerid] = (-1);
  417.     }
  418.  return 1;
  419. }
  420.  
  421. public OnPlayerSpawn(playerid)
  422. {
  423.     PlayerInfo[playerid][SpawnAngle] = 0.0;
  424.     PlayerInfo[playerid][SpawnDance] = true;
  425.     KillTimer( PlayerInfo[playerid][SpawnTimer] );
  426.     PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0);
  427.     SetCameraBehindPlayer(playerid);
  428.     if(PlayerInfo[playerid][pJailed] == 1)
  429.     {
  430.         TogglePlayerControllable(playerid,0);
  431.         SendClientMessage(playerid, COLOR_LIGHTRED, "Você Não pode fugir Preso owned!!!");
  432.         return 1;
  433.     }
  434.     if(PlayerInfo[playerid][pBanned] == 1)
  435.     {
  436.         SendClientMessage(playerid, COLOR_LIGHTRED, "Você nunca pode fugir Ban aqui é Fuck off bitch!!!!");
  437.         Kick(playerid);
  438.         return 1;
  439.     }
  440.     new rand = random(sizeof(gRandomPlayerSpawns));
  441.     SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);
  442.     SetPlayerInterior(playerid,0);
  443.     return 1;
  444. }
  445.  
  446. public OnPlayerDeath(playerid, killerid, reason)
  447. {
  448.     GameTextForPlayer(playerid,"~y~Morto!!!",4000,3);
  449.     if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  450.     SendDeathMessage(killerid, playerid, reason);
  451.  return 1;
  452. }
  453.  
  454. public OnVehicleSpawn(vehicleid)
  455. {
  456.     return 1;
  457. }
  458.  
  459. public OnVehicleDeath(vehicleid, killerid)
  460. {
  461.     return 1;
  462. }
  463.  
  464. public OnPlayerText(playerid, text[])
  465. {
  466.     return 1;
  467. }
  468.  
  469. public OnPlayerCommandText(playerid, cmdtext[])
  470. {
  471.    return 1;
  472. }
  473.  
  474. //=================================| Comandos do Servidor |===================//
  475. CMD:drift(playerid, params[])
  476. {
  477.     SetPlayerInterior(playerid, 0);
  478.     GameTextForPlayer(playerid, "~W~Drift 1", 3000, 5);
  479.     {
  480.         if(IsPlayerInAnyVehicle(playerid) == 1)
  481.         {
  482.             SetVehiclePos(V_ID, 1261.9971,-2014.3324,59.3629);
  483.         }
  484.         else
  485.         {
  486.             SetPlayerPos(playerid, 1261.9971,-2014.3324,59.3629);
  487.         }
  488.         return 1;
  489.     }
  490. }
  491. CMD:drift2(playerid, params[])
  492. {
  493.     SetPlayerInterior(playerid, 0);
  494.     GameTextForPlayer(playerid, "~W~Drift 2", 3000, 5);
  495.     {
  496.         if(IsPlayerInAnyVehicle(playerid) == 1)
  497.         {
  498.             SetVehiclePos(V_ID, 2271.2722,1397.3500,42.8203);
  499.         }
  500.         else
  501.         {
  502.             SetPlayerPos(playerid, 2271.2722,1397.3500,42.8203);
  503.         }
  504.         return 1;
  505.     }
  506. }
  507. CMD:drift3(playerid, params[])
  508.       {
  509.       SetPlayerInterior(playerid, 0);
  510.       GameTextForPlayer(playerid, "~W~Drift 3", 3000, 5);
  511.       {
  512.       if(IsPlayerInAnyVehicle(playerid) == 1)
  513.       {
  514.       SetVehiclePos(V_ID, -314.0728,1530.8646,75.3594);
  515.       }
  516.       else
  517.       {
  518.       SetPlayerPos(playerid, -314.0728,1530.8646,75.3594);
  519.         }
  520.         return 1;
  521.     }
  522. }
  523. CMD:drift4(playerid, params[])
  524. {
  525.     SetPlayerInterior(playerid, 0);
  526.     GameTextForPlayer(playerid, "~W~Drift 4", 3000, 5);
  527.     {
  528.         if(IsPlayerInAnyVehicle(playerid) == 1)
  529.         {
  530.             SetVehiclePos(V_ID, -297.3416,1749.6500,42.6875);
  531.         }
  532.         else
  533.         {
  534.             SetPlayerPos(playerid, -297.3416,1749.6500,42.6875);
  535.         }
  536.         return 1;
  537.     }
  538. }
  539. CMD:drift5(playerid, params[])
  540. {
  541.     SetPlayerInterior(playerid, 0);
  542.     GameTextForPlayer(playerid, "~W~Drift 5", 3000, 5);
  543.     {
  544.         if(IsPlayerInAnyVehicle(playerid) == 1)
  545.         {
  546.             SetVehiclePos(V_ID, -2524.2400,-610.8422,132.5625);
  547.         }
  548.         else
  549.         {
  550.             SetPlayerPos(playerid, -2524.2400,-610.8422,132.5625);
  551.         }
  552.         return 1;
  553.     }
  554. }
  555. CMD:driftx(playerid, params[])
  556. {
  557.     SetPlayerInterior(playerid, 0);
  558.     GameTextForPlayer(playerid, "~W~Drift X", 3000, 5);
  559.     {
  560.         if(IsPlayerInAnyVehicle(playerid) == 1)
  561.         {
  562.             SetVehiclePos(V_ID, 3124.4453,3112.7883,4.8585);
  563.         }
  564.         else
  565.         {
  566.             SetPlayerPos(playerid, 3124.4453,3112.7883,4.8585);
  567.         }
  568.         return 1;
  569.     }
  570. }
  571. CMD:carro(playerid, params[])
  572. {
  573.     #pragma unused params
  574.     ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "{33AA33}Veiculos Avenda", "{2641FE}Infernus\n{2641FE}Turismo\n{2641FE}Phoenix\n{2641FE}Cheetah\n{2641FE}Banshee\n{2641FE}Euros\n{2641FE}Buffalo\n{2641FE}Kart\n{2641FE}Hotknife\n{2641FE}Hustler\n{2641FE}Comet\n{2641FE}Stallion\n{2641FE}Sunrise\n{2641FE}Sandking", "Selecionar", "Cancelar");
  575.     return 1;
  576. }
  577. CMD:ejetar(playerid, params[])
  578. {
  579.     new id;
  580.     if(sscanf(params, "u",id)) return SendClientMessage(playerid, cyan, "Use: /ejetar [ID ou Nome] ");
  581.     if(gPlayerLogged[id] == 0) return SendClientMessage(playerid, 0x33AA33AA, "Jogador não está logado");
  582.     if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  583.     {
  584.         if (GetPlayerState(id) == PLAYER_STATE_PASSENGER)
  585.         {
  586.             RemovePlayerFromVehicle(id);
  587.             SendClientMessage(playerid, 0x33AA33AA, "Jogador ejetado...");
  588.         }
  589.     }
  590.     return 1;
  591. }
  592. CMD:veh(playerid, params[])
  593. {
  594.     new Float:pX, Float:pY, Float:pZ, Float:pA, Float:vX, Float:vY, Float:vZ, Float:vA, VecID, bool:WasPInVehicle = false;
  595.     if(sscanf(params, "d", VecID)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [Modelo do veículo ( id ) ]");
  596.     if(VecID >= 400 && VecID <= 611){
  597.         if(IsPlayerInAnyVehicle(playerid)){
  598.             GetVehiclePos(GetPlayerVehicleID(playerid), vX, vY, vZ);
  599.             GetVehicleZAngle(GetPlayerVehicleID(playerid), vA);
  600.             if(GetPlayerState(playerid) == 2)
  601.                 SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  602.             else
  603.             RemovePlayerFromVehicle(playerid);
  604.             WasPInVehicle = true;
  605.         }
  606.         else
  607.         {
  608.             GetPlayerPos(playerid, pX, pY, pZ);
  609.             GetPlayerFacingAngle(playerid, pA);
  610.             WasPInVehicle = false;
  611.         }
  612.         if(VecSpawned[playerid] != -1){
  613.             DestroyVehicle(VecSpawned[playerid]);
  614.             VecSpawned[playerid] = (-1);
  615.         }
  616.         if(WasPInVehicle){
  617.             VecSpawned[playerid] = CreateVehicle(VecID, vX, vY, vZ, vA, -1, -1, -1);
  618.         }
  619.         else{
  620.             VecSpawned[playerid] = CreateVehicle(VecID, pX, pY, pZ, pA, -1, -1, -1);
  621.         }
  622.         PutPlayerInVehicle(playerid, VecSpawned[playerid], 0);
  623.         SendClientMessage(playerid, COLOR_GREEN, "** Seu veículo foi Criado!");
  624.     }
  625.     else return SendClientMessage(playerid, COLOR_RED, "** Modelo de veículo ( ID ) inválido!");
  626.     return 1;
  627. }
  628. //==============================| Comandos ADM |==============================//
  629. CMD:curar(playerid, params[])
  630. {
  631.     new id;
  632.     if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_GREEN, "Use: /curar <ID ou Nome>\"");
  633.     else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_SIMPSONS, "Jogador não encontrado");
  634.     if (id == playerid) {SendClientMessage(playerid, COLOR_SIMPSONS, "Você não pode definir sua própria HP!"); return 1;}
  635.     if(PlayerInfo[playerid][pAdminLevel] < 1){SendClientMessage(playerid, COLOR_LIGHTRED, "você não é admin nível exigido para usar este cmd"); return 1;}
  636.     else
  637.     {
  638.         SetPlayerHealth(id, 100.0);
  639.         SendClientMessage(id, COLOR_LIGHTRED, "Você foi curado by admin");
  640.         SendClientMessage(playerid, COLOR_LIGHTRED, "Player Curado");
  641.     }
  642.     return 1;
  643. }
  644. CMD:kill(playerid, params[])
  645. {
  646.     new
  647.     id;
  648.     if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_GREEN, "Use: /kill <ID ou Nome>\"");
  649.     else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_GREEN, "Esté Player não está conectado");
  650.     if (id == playerid) {SendClientMessage(playerid, COLOR_SIMPSONS, "Você não pode retirar sua própria HP"); return 1;}
  651.     if(PlayerInfo[playerid][pAdminLevel] < 1){SendClientMessage(playerid, COLOR_LIGHTRED, "você não é admin nível exigido para usar este cmd"); return 1;}
  652.     else
  653.     {
  654.         SetPlayerHealth(id, 0.0);
  655.         SendClientMessage(id, COLOR_LIGHTRED, "Você perdeu sua HP-Life By admin");
  656.     }
  657.     return 1;
  658. }
  659. CMD:admins(playerid, params[])
  660. {
  661.     #pragma unused params
  662.     if(IsPlayerConnected(playerid))
  663.     {
  664.         for(new i = 0; i < MAX_PLAYERS; i++)
  665.         {
  666.             if(IsPlayerConnected(i))
  667.             {
  668.                 new string[128],sendername[MAX_PLAYER_NAME];
  669.                 GetPlayerName(i, sendername, sizeof(sendername));
  670.                 if(PlayerInfo[i][pAdminLevel] >= 1 && PlayerInfo[i][pAdminLevel] <= 1338)
  671.                 {
  672.                     new arank[64];
  673.                     if(PlayerInfo[playerid][pAdminLevel] == 1) { arank = "Moderador"; }
  674.                     else if(PlayerInfo[playerid][pAdminLevel] == 2) { arank = "Global Moderador"; }
  675.                     else if(PlayerInfo[playerid][pAdminLevel] == 3) { arank = "Administrador"; }
  676.                     else if(PlayerInfo[playerid][pAdminLevel] == 4) { arank = "Socio Admin"; }
  677.                     else if(PlayerInfo[playerid][pAdminLevel] == 5) { arank = "Sub-Dono Admin"; }
  678.                     else if(PlayerInfo[playerid][pAdminLevel] == 1337) { arank = "Dono"; }
  679.                     else if(PlayerInfo[playerid][pAdminLevel] == 1338) { arank = "Dono/Scripter"; }
  680.                     else { arank = "Desconhecido"; }
  681.                     format(string, sizeof(string), "%s - %s", arank, sendername);
  682.                     SendClientMessage(playerid, COLOR_ORANGE, string);
  683.                     printf(string);
  684.                 }
  685.             }
  686.         }
  687.     }
  688.     return 1;
  689. }
  690. CMD:ann(playerid, params[])
  691. {
  692.     new
  693.     string[128],
  694.     string2[128];
  695.     if (sscanf(params, "s",string2)) SendClientMessage(playerid, COLOR_GREEN, "Use: /ann [TEXTO]");
  696.     if(PlayerInfo[playerid][pAdminLevel] < 3) return SendClientMessage(playerid, cyan, "[Erro]: Você não é um Administrator ou Moderator!");
  697.     format(string, sizeof(string),"%s", string2);
  698.     GameTextForAll(string,5000,3);
  699.     printf("Um Administrador anunciou o seguinte:");
  700.     printf(string2);
  701.     return 1;
  702. }
  703. CMD:ban(playerid, params[])
  704. {
  705.     new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
  706.     if(sscanf(params, "us", id, str2))
  707.     {
  708.         SendClientMessage(playerid, 0xFF0000FF, "Use: /ban <ID ou Nome> <Motivo>");
  709.         return 1;
  710.     }
  711.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREEN, "ERRO: Esté Player não está conectado");
  712.     if(playerid == id) return SendClientMessage(playerid, COLOR_GREEN, "ERRO: Você não pode se banir!");
  713.     if(PlayerInfo[playerid][pAdminLevel] < 3){SendClientMessage(playerid, COLOR_LIGHTRED, "Você não é admin nível exigido para usar este cmd"); return 1;}
  714.     if(PlayerInfo[id][pAdminLevel] >= 3){SendClientMessage(playerid, COLOR_LIGHTRED, "Você foi ( BANIDO ) por um Administrador - Admin!"); return 1;}
  715.     else
  716.     {
  717.         GetPlayerName(playerid, Name1, sizeof(Name1));
  718.         GetPlayerName(id, Name2, sizeof(Name2));
  719.         format(str, sizeof(str), "AdminBan: %s Foi Banido by %s", Name1, Name2, playerid, str2);
  720.         SendClientMessageToAll(TEAM_BLUE_COLOR, str);
  721.         printf(str);
  722.         PlayerInfo[id][pBanned] = 1;
  723.         Ban(id);
  724.     }
  725.     return 1;
  726. }
  727. CMD:kick(playerid, params[])
  728. {
  729.     new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
  730.     if(sscanf(params, "us", id, str2))
  731.     {
  732.         SendClientMessage(playerid, 0xFF0000FF, "Usage: /kick <ID ou Nome> <Motivo>");
  733.         return 1;
  734.     }
  735.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREEN, "ERRO: Esté Player não está conectado");
  736.     if(playerid == id) return SendClientMessage(playerid, COLOR_GREEN, "ERRO: Você não pode se Kick!");
  737.     if(PlayerInfo[playerid][pAdminLevel] < 3){SendClientMessage(playerid, COLOR_LIGHTRED, "Você não é admin nível exigido para usar este cmd"); return 1;}
  738.     if(PlayerInfo[id][pAdminLevel] >= 3){SendClientMessage(playerid, COLOR_LIGHTRED, "Você foi ( Kick ) por um Administrador - Admin!"); return 1;}
  739.     else
  740.     {
  741.         GetPlayerName(playerid, Name1, sizeof(Name1));
  742.         GetPlayerName(id, Name2, sizeof(Name2));
  743.         format(str, sizeof(str), "AdminKicked: %s Foi Kick by %s", Name1, Name2, playerid, str2);
  744.         SendClientMessageToAll(TEAM_BLUE_COLOR, str);
  745.         printf(str);
  746.         Kick(id);
  747.     }
  748.     return 1;
  749. }
  750. //======================| AINDA VOU POR MAIS Comandos para ADM |==============//
  751.  
  752.  
  753. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  754. {
  755.     SendClientMessage(playerid, 0xAAAAAAAA, "[AVISO]: Este Servidor Possui Sistema Anti-Roubo, Caso Roubar Será Morto Automaticamente !");
  756.     if(!ispassenger && IsVehicleOccupied(vehicleid)) SetPlayerHealth(playerid, 0.0);
  757.     return 1;
  758. }
  759.     stock IsVehicleOccupied(vehicleid)
  760.     {
  761.     for(new i = 0; i < MAX_PLAYERS; i++)
  762.     if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
  763.     return 1;
  764.     return 0;
  765. }
  766.  
  767. public OnPlayerExitVehicle(playerid, vehicleid)
  768. {
  769.     return 1;
  770. }
  771.  
  772. public OnPlayerStateChange(playerid, newstate, oldstate)
  773. {
  774.     return 1;
  775. }
  776.  
  777. public OnPlayerEnterCheckpoint(playerid)
  778. {
  779.     return 1;
  780. }
  781.  
  782. public OnPlayerLeaveCheckpoint(playerid)
  783. {
  784.     return 1;
  785. }
  786.  
  787. public OnPlayerEnterRaceCheckpoint(playerid)
  788. {
  789.     return 1;
  790. }
  791.  
  792. public OnPlayerLeaveRaceCheckpoint(playerid)
  793. {
  794.     return 1;
  795. }
  796.  
  797. public OnRconCommand(cmd[])
  798. {
  799.     return 1;
  800. }
  801.  
  802. public OnPlayerRequestSpawn(playerid)
  803. {
  804.    return 1;
  805. }
  806.  
  807. public OnObjectMoved(objectid)
  808. {
  809.     return 1;
  810. }
  811.  
  812. public OnPlayerPickUpPickup(playerid, pickupid)
  813. {
  814.     return 1;
  815. }
  816.  
  817. public OnVehicleMod(playerid, vehicleid, componentid)
  818. {
  819.     return 1;
  820. }
  821.  
  822. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  823. {
  824.     return 1;
  825. }
  826.  
  827. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  828. {
  829.     return 1;
  830. }
  831.  
  832. public OnPlayerSelectedMenuRow(playerid, row)
  833. {
  834.    return 1;
  835. }
  836.  
  837. public OnPlayerExitedMenu(playerid)
  838. {
  839.     return 1;
  840. }
  841.  
  842. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  843. {
  844.     return 1;
  845. }
  846.  
  847. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  848. {
  849.     if(newkeys & Reparar)
  850.     {
  851.     RepairVehicle(GetPlayerVehicleID(playerid));
  852.     GameTextForPlayer(playerid,"~w~Veiculo Reparado!",1000,1);
  853.     }
  854.     return 1;
  855. }
  856.  
  857. public OnRconLoginAttempt(ip[], password[], success)
  858. {
  859.     return 1;
  860. }
  861.  
  862. public OnPlayerUpdate(playerid)
  863. {
  864.     return 1;
  865. }
  866.  
  867. public OnPlayerStreamIn(playerid, forplayerid)
  868. {
  869.     return 1;
  870. }
  871.  
  872. public OnPlayerStreamOut(playerid, forplayerid)
  873. {
  874.     return 1;
  875. }
  876.  
  877. public OnVehicleStreamIn(vehicleid, forplayerid)
  878. {
  879.     return 1;
  880. }
  881.  
  882. public OnVehicleStreamOut(vehicleid, forplayerid)
  883. {
  884.     return 1;
  885. }
  886.  
  887. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  888. {
  889.     new file[256];
  890.     new string[128];
  891.     if (dialogid == 1)
  892.     {
  893.         new name[MAX_PLAYER_NAME];
  894.         GetPlayerName(playerid, name, sizeof(name));
  895.         format(file, sizeof(file), SERVER_USER_FILE, name);
  896.         if(!response) return Kick(playerid);
  897.         if (!strlen(inputtext)) return
  898.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Brasil Drift Life", "Bem-vindo, Voçê não está registrada, digite sua senha abaixo", "Register", "Sair");
  899.         dini_Create(file);
  900.         dini_IntSet(file, "Key", udb_hash(inputtext));
  901.         dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
  902.         dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
  903.         dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
  904.         dini_IntSet(file, "Preso",PlayerInfo[playerid][pJailed] = 0);
  905.         dini_IntSet(file, "Mudo",PlayerInfo[playerid][pMuted] = 0);
  906.         dini_IntSet(file, "Banido",PlayerInfo[playerid][pBanned] = 0);
  907.         format(string, 128, "[Warning]: Você foi registrado com sucesso nickname: %s sua senha: %s, Você está longado.", name, inputtext);
  908.         SendClientMessage(playerid, 0xD09C00AA, string);
  909.         gPlayerLogged[playerid] = 1;
  910.     }
  911.     if (dialogid == 2)
  912.     {
  913.         new name[MAX_PLAYER_NAME];
  914.         GetPlayerName(playerid, name, sizeof(name));
  915.         format(file, sizeof(file), SERVER_USER_FILE, name);
  916.         if(!response) return Kick(playerid);
  917.         if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Fife", "{E67802}Digite sua senha abaixo para se cadastrar", "Login", "Sair");
  918.         new tmp;
  919.         tmp = dini_Int(file, "Password");
  920.         if(udb_hash(inputtext) != tmp) {
  921.             SendClientMessage(playerid, 0xF08400AA, "Senha errada.");
  922.             ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Life", "{E67802}Digite sua senha abaixo para se cadastrar", "Login", "Sair");
  923.         }
  924.         else
  925.         {
  926.             gPlayerLogged[playerid] = 1;
  927.             PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
  928.             SetPlayerScore(playerid, dini_Int(file, "Score"));
  929.             GivePlayerCash(playerid, dini_Int(file, "Money"));
  930.             PlayerInfo[playerid][pMuted] = dini_Int(file, "Mudo");
  931.             PlayerInfo[playerid][pJailed] = dini_Int(file, "Preso");
  932.             PlayerInfo[playerid][pBanned] = dini_Int(file, "Banido");
  933.             SendClientMessage(playerid,0xF08400AA, "[Warning]: Você está longado!");
  934.         }
  935.     }
  936.     if(dialogid == Dialog)
  937.     if(!response) return 1;
  938.     {
  939.         switch(listitem)
  940.         {
  941.             case 0:
  942.             {
  943.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  944.                 Int = GetPlayerInterior(playerid);
  945.                 GetPlayerPos(playerid, X, Y, Z);
  946.                 GetPlayerFacingAngle(playerid, Ang);
  947.                 GetPlayerInterior(playerid);
  948.                 pCarro = CreateVehicle(411, X, Y, Z, Ang, -1, -1, -1);
  949.                 LinkVehicleToInterior(pCarro, Int);
  950.                 PutPlayerInVehicle(playerid, pCarro, 0);
  951.             }
  952.             case 1:
  953.             {
  954.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  955.                 Int = GetPlayerInterior(playerid);
  956.                 GetPlayerPos(playerid, X, Y, Z);
  957.                 GetPlayerFacingAngle(playerid, Ang);
  958.                 pCarro = CreateVehicle(451, X, Y, Z, Ang, -1, -1, -1);
  959.                 LinkVehicleToInterior(pCarro, Int);
  960.                 PutPlayerInVehicle(playerid, pCarro, 0);
  961.             }
  962.             case 2:
  963.             {
  964.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  965.                 Int = GetPlayerInterior(playerid);
  966.                 GetPlayerPos(playerid, X, Y, Z);
  967.                 GetPlayerFacingAngle(playerid, Ang);
  968.                 pCarro = CreateVehicle(603, X, Y, Z, Ang, -1, -1, -1);
  969.                 LinkVehicleToInterior(pCarro, Int);
  970.                 PutPlayerInVehicle(playerid, pCarro, 0);
  971.             }
  972.             case 3:
  973.             {
  974.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  975.                 Int = GetPlayerInterior(playerid);
  976.                 GetPlayerPos(playerid, X, Y, Z);
  977.                 GetPlayerFacingAngle(playerid, Ang);
  978.                 pCarro = CreateVehicle(415, X, Y, Z, Ang, -1, -1, -11);
  979.                 LinkVehicleToInterior(pCarro, Int);
  980.                 PutPlayerInVehicle(playerid, pCarro, 0);
  981.             }
  982.             case 4:
  983.             {
  984.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  985.                 Int = GetPlayerInterior(playerid);
  986.                 GetPlayerPos(playerid, X, Y, Z);
  987.                 GetPlayerFacingAngle(playerid, Ang);
  988.                 pCarro = CreateVehicle(429, X, Y, Z, Ang, -1, -1, -1);
  989.                 LinkVehicleToInterior(pCarro, Int);
  990.                 PutPlayerInVehicle(playerid, pCarro, 0);
  991.             }
  992.             case 5:
  993.             {
  994.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  995.                 Int = GetPlayerInterior(playerid);
  996.                 GetPlayerPos(playerid, X, Y, Z);
  997.                 GetPlayerFacingAngle(playerid, Ang);
  998.                 pCarro = CreateVehicle(587, X, Y, Z, Ang, -1, -1, -1);
  999.                 LinkVehicleToInterior(pCarro, Int);
  1000.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1001.             }
  1002.             case 6:
  1003.             {
  1004.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1005.                 Int = GetPlayerInterior(playerid);
  1006.                 GetPlayerPos(playerid, X, Y, Z);
  1007.                 GetPlayerFacingAngle(playerid, Ang);
  1008.                 pCarro = CreateVehicle(402, X, Y, Z, Ang, -1, -1, -1);
  1009.                 LinkVehicleToInterior(pCarro, Int);
  1010.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1011.             }
  1012.             case 7:
  1013.             {
  1014.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1015.                 Int = GetPlayerInterior(playerid);
  1016.                 GetPlayerPos(playerid, X, Y, Z);
  1017.                 GetPlayerFacingAngle(playerid, Ang);
  1018.                 pCarro = CreateVehicle(571, X, Y, Z, Ang, -1, -1, -1);
  1019.                 LinkVehicleToInterior(pCarro, Int);
  1020.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1021.             }
  1022.             case 8:
  1023.             {
  1024.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1025.                 Int = GetPlayerInterior(playerid);
  1026.                 GetPlayerPos(playerid, X, Y, Z);
  1027.                 GetPlayerFacingAngle(playerid, Ang);
  1028.                 pCarro = CreateVehicle(434, X, Y, Z, Ang, -1, -1, -1);
  1029.                 LinkVehicleToInterior(pCarro, Int);
  1030.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1031.             }
  1032.             case 9:
  1033.             {
  1034.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1035.                 Int = GetPlayerInterior(playerid);
  1036.                 GetPlayerPos(playerid, X, Y, Z);
  1037.                 GetPlayerFacingAngle(playerid, Ang);
  1038.                 pCarro = CreateVehicle(545, X, Y, Z, Ang, -1, -1, -1);
  1039.                 LinkVehicleToInterior(pCarro, Int);
  1040.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1041.             }
  1042.             case 10:
  1043.             {
  1044.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1045.                 Int = GetPlayerInterior(playerid);
  1046.                 GetPlayerPos(playerid, X, Y, Z);
  1047.                 GetPlayerFacingAngle(playerid, Ang);
  1048.                 pCarro = CreateVehicle(480, X, Y, Z, Ang, -1, -1, -1);
  1049.                 LinkVehicleToInterior(pCarro, Int);
  1050.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1051.             }
  1052.             case 11:
  1053.             {
  1054.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1055.                 Int = GetPlayerInterior(playerid);
  1056.                 GetPlayerPos(playerid, X, Y, Z);
  1057.                 GetPlayerFacingAngle(playerid, Ang);
  1058.                 pCarro = CreateVehicle(439, X, Y, Z, Ang, -1, -1, -1);
  1059.                 LinkVehicleToInterior(pCarro, Int);
  1060.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1061.             }
  1062.             case 12:
  1063.             {
  1064.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1065.                 Int = GetPlayerInterior(playerid);
  1066.                 GetPlayerPos(playerid, X, Y, Z);
  1067.                 GetPlayerFacingAngle(playerid, Ang);
  1068.                 pCarro = CreateVehicle(550, X, Y, Z, Ang, -1, -1, -1);
  1069.                 LinkVehicleToInterior(pCarro, Int);
  1070.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1071.             }
  1072.             case 13:
  1073.             {
  1074.                 new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
  1075.                 Int = GetPlayerInterior(playerid);
  1076.                 GetPlayerPos(playerid, X, Y, Z);
  1077.                 GetPlayerFacingAngle(playerid, Ang);
  1078.                 pCarro = CreateVehicle(495, X, Y, Z, Ang, -1, -1, -1);
  1079.                 LinkVehicleToInterior(pCarro, Int);
  1080.                 PutPlayerInVehicle(playerid, pCarro, 0);
  1081.             }
  1082.             case 14:
  1083.             {
  1084.                 return 1;
  1085.    }
  1086.         }
  1087.     }
  1088.     return 1;
  1089. }
  1090.  
  1091. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1092. {
  1093.     return 1;
  1094. }
  1095.  
  1096. public carspawn()
  1097. {
  1098.     for (new i = 0; i < MAX_VEHICLES; i++)
  1099.     {
  1100.         SetVehicleToRespawn(i);
  1101.         GameTextForAll("~y~ Todos os veículos voltarão ao seus lugares!",2000,1);
  1102.     }
  1103.     return 1;
  1104. }
  1105.  
  1106. public AutoScore()
  1107. {
  1108.     for (new i=0; i < MAX_PLAYERS; i++)
  1109.     {
  1110.         if (IsPlayerConnected(i))
  1111.         {
  1112.             new
  1113.             pointsx;
  1114.             pointsx = GetPlayerScore(i);
  1115.             SetPlayerScore(i, pointsx + 1);
  1116.             PlayerInfo[i][pScore] += 1;
  1117.         }
  1118.     }
  1119.     return 1;
  1120. }
  1121.  
  1122. public SendMSG()
  1123. {
  1124.   new random2 = random(sizeof(RandomColors));
  1125.   new randMSG = random(sizeof(RandomMSG));
  1126.   SendClientMessageToAll(RandomColors[random2], RandomMSG[randMSG]);
  1127. }
  1128.  
  1129. public Relogio(playerid)
  1130. {
  1131.     new string[256];
  1132.     new string2[256];
  1133.     new year, month, day;
  1134.     new hour, minute, second;
  1135.     getdate(year, month, day);
  1136.     gettime(hour,minute,second);
  1137.     new mtext[20];
  1138.     getdate(year, month, day);
  1139.     if(month == 1) { mtext = "Janeiro"; }
  1140.     else if(month == 2) { mtext = "Fevereiro"; }
  1141.     else if(month == 3) { mtext = "Março"; }
  1142.     else if(month == 4) { mtext = "Abril"; }
  1143.     else if(month == 5) { mtext = "Maio"; }
  1144.     else if(month == 6) { mtext = "Junho"; }
  1145.     else if(month == 7) { mtext = "Julho"; }
  1146.     else if(month == 8) { mtext = "Agosto"; }
  1147.     else if(month == 9) { mtext = "Setembro"; }
  1148.     else if(month == 10) { mtext = "Outubro"; }
  1149.     else if(month == 11) { mtext = "Novembro"; }
  1150.     else if(month == 12) { mtext = "Dezembro"; }
  1151.     format(string, sizeof(string), "%d %s, %d", day, mtext, year);
  1152.     TextDrawSetString(Text:Textdraw99, string);
  1153.     format(string2, sizeof(string2), "%d:%d:%d", hour, minute, second);
  1154.     TextDrawSetString(Text:Textdraw88, string2);
  1155. }
  1156.  
  1157. stock GivePlayerCash(playerid, money)
  1158. {
  1159.     Cash[playerid] += money;
  1160.     ResetMoneyBar(playerid);
  1161.     UpdateMoneyBar(playerid,Cash[playerid]);
  1162.     return Cash[playerid];
  1163. }
  1164.  
  1165. stock SetPlayerCash(playerid, money)
  1166. {
  1167.     Cash[playerid] = money;
  1168.     ResetMoneyBar(playerid);
  1169.     UpdateMoneyBar(playerid,Cash[playerid]);
  1170.     return Cash[playerid];
  1171. }
  1172.  
  1173. stock ResetPlayerCash(playerid)
  1174. {
  1175.     Cash[playerid] = 0;
  1176.     ResetMoneyBar(playerid);
  1177.     UpdateMoneyBar(playerid,Cash[playerid]);
  1178.     return Cash[playerid];
  1179. }
  1180.  
  1181. stock GetPlayerCash(playerid)
  1182. {
  1183.     return Cash[playerid];
  1184. }
  1185.  
  1186. stock sscanf(string[], format[], {Float,_}:...)
  1187. {
  1188.     #if defined isnull
  1189.         if (isnull(string))
  1190.     #else
  1191.         if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  1192.     #endif
  1193.         {
  1194.             return format[0];
  1195.         }
  1196.     #pragma tabsize 4
  1197.     new
  1198.         formatPos = 0,
  1199.         stringPos = 0,
  1200.         paramPos = 2,
  1201.         paramCount = numargs(),
  1202.         delim = ' ';
  1203.     while (string[stringPos] && string[stringPos] <= ' ')
  1204.     {
  1205.         stringPos++;
  1206.     }
  1207.     while (paramPos < paramCount && string[stringPos])
  1208.     {
  1209.         switch (format[formatPos++])
  1210.         {
  1211.             case '\0':
  1212.             {
  1213.                 return 0;
  1214.             }
  1215.             case 'i', 'd':
  1216.             {
  1217.                 new
  1218.                     neg = 1,
  1219.                     num = 0,
  1220.                     ch = string[stringPos];
  1221.                 if (ch == '-')
  1222.                 {
  1223.                     neg = -1;
  1224.                     ch = string[++stringPos];
  1225.                 }
  1226.                 do
  1227.                 {
  1228.                     stringPos++;
  1229.                     if ('0' <= ch <= '9')
  1230.                     {
  1231.                         num = (num * 10) + (ch - '0');
  1232.                     }
  1233.                     else
  1234.                     {
  1235.                         return -1;
  1236.                     }
  1237.                 }
  1238.                 while ((ch = string[stringPos]) > ' ' && ch != delim);
  1239.                 setarg(paramPos, 0, num * neg);
  1240.             }
  1241.             case 'h', 'x':
  1242.             {
  1243.                 new
  1244.                     num = 0,
  1245.                     ch = string[stringPos];
  1246.                 do
  1247.                 {
  1248.                     stringPos++;
  1249.                     switch (ch)
  1250.                     {
  1251.                         case 'x', 'X':
  1252.                         {
  1253.                             num = 0;
  1254.                             continue;
  1255.                         }
  1256.                         case '0' .. '9':
  1257.                         {
  1258.                             num = (num << 4) | (ch - '0');
  1259.                         }
  1260.                         case 'a' .. 'f':
  1261.                         {
  1262.                             num = (num << 4) | (ch - ('a' - 10));
  1263.                         }
  1264.                         case 'A' .. 'F':
  1265.                         {
  1266.                             num = (num << 4) | (ch - ('A' - 10));
  1267.                         }
  1268.                         default:
  1269.                         {
  1270.                             return -1;
  1271.                         }
  1272.                     }
  1273.                 }
  1274.                 while ((ch = string[stringPos]) > ' ' && ch != delim);
  1275.                 setarg(paramPos, 0, num);
  1276.             }
  1277.             case 'c':
  1278.             {
  1279.                 setarg(paramPos, 0, string[stringPos++]);
  1280.             }
  1281.             case 'f':
  1282.             {
  1283.  
  1284.                 new changestr[16], changepos = 0, strpos = stringPos;
  1285.                 while(changepos < 16 && string[strpos] && string[strpos] != delim)
  1286.                 {
  1287.                     changestr[changepos++] = string[strpos++];
  1288.                     }
  1289.                 changestr[changepos] = '\0';
  1290.                 setarg(paramPos,0,_:floatstr(changestr));
  1291.             }
  1292.             case 'p':
  1293.             {
  1294.                 delim = format[formatPos++];
  1295.                 continue;
  1296.             }
  1297.             case '\'':
  1298.             {
  1299.                 new
  1300.                     end = formatPos - 1,
  1301.                     ch;
  1302.                 while ((ch = format[++end]) && ch != '\'') {}
  1303.                 if (!ch)
  1304.                 {
  1305.                     return -1;
  1306.                 }
  1307.                 format[end] = '\0';
  1308.                 if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  1309.                 {
  1310.                     if (format[end + 1])
  1311.                     {
  1312.                         return -1;
  1313.                     }
  1314.                     return 0;
  1315.                 }
  1316.                 format[end] = '\'';
  1317.                 stringPos = ch + (end - formatPos);
  1318.                 formatPos = end + 1;
  1319.             }
  1320.             case 'u':
  1321.             {
  1322.                 new
  1323.                     end = stringPos - 1,
  1324.                     id = 0,
  1325.                     bool:num = true,
  1326.                     ch;
  1327.                 while ((ch = string[++end]) && ch != delim)
  1328.                 {
  1329.                     if (num)
  1330.                     {
  1331.                         if ('0' <= ch <= '9')
  1332.                         {
  1333.                             id = (id * 10) + (ch - '0');
  1334.                         }
  1335.                         else
  1336.                         {
  1337.                             num = false;
  1338.                         }
  1339.                     }
  1340.                 }
  1341.                 if (num && IsPlayerConnected(id))
  1342.                 {
  1343.                     setarg(paramPos, 0, id);
  1344.                 }
  1345.                 else
  1346.                 {
  1347.                     #if !defined foreach
  1348.                         #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  1349.                         #define __SSCANF_FOREACH__
  1350.                     #endif
  1351.                     string[end] = '\0';
  1352.                     num = false;
  1353.                     new
  1354.                         name[MAX_PLAYER_NAME];
  1355.                     id = end - stringPos;
  1356.                     foreach (Player, playerid)
  1357.                     {
  1358.                         GetPlayerName(playerid, name, sizeof (name));
  1359.                         if (!strcmp(name, string[stringPos], true, id))
  1360.                         {
  1361.                             setarg(paramPos, 0, playerid);
  1362.                             num = true;
  1363.                             break;
  1364.                         }
  1365.                     }
  1366.                     if (!num)
  1367.                     {
  1368.                         setarg(paramPos, 0, INVALID_PLAYER_ID);
  1369.                     }
  1370.                     string[end] = ch;
  1371.                     #if defined __SSCANF_FOREACH__
  1372.                     #endif
  1373.                 }
  1374.                 stringPos = end;
  1375.             }
  1376.             case 's', 'z':
  1377.             {
  1378.                 new
  1379.                     i = 0,
  1380.                     ch;
  1381.                 if (format[formatPos])
  1382.                 {
  1383.                     while ((ch = string[stringPos++]) && ch != delim)
  1384.                     {
  1385.                         setarg(paramPos, i++, ch);
  1386.                     }
  1387.                     if (!i)
  1388.                     {
  1389.                         return -1;
  1390.                     }
  1391.                 }
  1392.                 else
  1393.                 {
  1394.                     while ((ch = string[stringPos++]))
  1395.                     {
  1396.                         setarg(paramPos, i++, ch);
  1397.                     }
  1398.                 }
  1399.                 stringPos--;
  1400.                 setarg(paramPos, i, '\0');
  1401.             }
  1402.             default:
  1403.             {
  1404.                 continue;
  1405.             }
  1406.         }
  1407.         while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  1408.         {
  1409.             stringPos++;
  1410.         }
  1411.         while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  1412.         {
  1413.             stringPos++;
  1414.         }
  1415.         paramPos++;
  1416.     }
  1417.     do
  1418.     {
  1419.         if ((delim = format[formatPos++]) > ' ')
  1420.         {
  1421.             if (delim == '\'')
  1422.             {
  1423.                 while ((delim = format[formatPos++]) && delim != '\'') {}
  1424.             }
  1425.             else if (delim != 'z')
  1426.             {
  1427.                 return delim;
  1428.             }
  1429.         }
  1430.     }
  1431.     while (delim > ' ');
  1432.     return 0;
  1433. }
  1434.  
  1435. //============================================================================//
  1436. //            ******* Brasil Drift Life [DRT v1.0a]*******                    //
  1437. //                           By Lucas_Locate                                  //
  1438. //                        * Apoio ESTAC SA:MP *                              //
  1439. //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement