Advertisement
Chip7

[GM] GameMode GunGame

Oct 25th, 2012
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 127.28 KB | None | 0 0
  1. /*VISITE NOSSO SITE: http://www.sampknd.com/
  2.   VISITE NOSSO FACEBOOK: http://www.facebook.com/SampKnd
  3.   SAMP KND MELHOR BLOG DE SAMP DO BRASIL
  4. */  
  5.  
  6. #include <a_samp>
  7. #if defined MAX_PLAYERS
  8.     #undef MAX_PLAYERS
  9. #endif
  10. #define MAX_PLAYERS 32
  11.  
  12. #define MAX_INI_ENTRY_TEXT 160
  13. #include <YSI\y_ini>
  14. #include <YSI\y_va>
  15. #include <YSI\y_commands>
  16. #include <YSI\y_iterate>
  17. #include <sscanf2>
  18. #include <YSI\y_timers>
  19.  
  20. #include <pBoom>
  21.  
  22. #define COLOR_SAMP          0xA9C4E4FF
  23. #define COLOR_WHITE         0xFFFFFFFF
  24. #define COLOR_YELLOW        0xFFFF00AA
  25. #define COLOR_GREY          0xAFAFAFAA
  26. #define COLOR_LIGHTRED      0xFF6347AA
  27. #define COLOR_PURPLE        0xC2A2DAAA
  28.  
  29. #define DIALOG_NULL         2
  30. #define DIALOG_LOGIN        1
  31. #define DIALOG_REGISTER     0
  32.  
  33. enum E_PLAYER_DATA
  34. {
  35.     Float:E_PLAYER_HEALTH,
  36.     bool:E_PLAYER_LOGGED,
  37.     bool:E_PLAYER_MUTED,
  38.     E_PLAYER_NXTLVL,
  39.     E_PLAYER_LVL,
  40.     E_PLAYER_SKIN,
  41.     E_PLAYER_SCORE,
  42.     E_PLAYER_REG,
  43.     E_PLAYER_ADMIN,
  44.     E_PLAYER_AGE,
  45.     E_PLAYER_SEX,
  46.     E_PLAYER_GKILLS,
  47.     E_PLAYER_GDEATHS,
  48.     E_PLAYER_KILLS,
  49.     E_PLAYER_DEATHS,
  50.     E_PLAYER_PLAYEDHOURS,
  51.     E_PLAYER_CLAN[4],
  52.     E_PLAYER_PASS[64],
  53.     E_PLAYER_RDATE[32],
  54.     E_PLAYER_LASTLOGIN[32],
  55.     E_PLAYER_BIRTH[32]
  56. }
  57.  
  58. new
  59.     gPlayerData[MAX_PLAYERS][E_PLAYER_DATA];
  60.    
  61. enum G_SCORE_DATA
  62. {
  63.     G_WINNER_ID,
  64.     G_SECOND_ID,
  65.     G_THIRD_ID,
  66.     G_FOURTY_ID,
  67.     G_FIVE_ID
  68. }
  69.  
  70. new
  71.     gScoreData[G_SCORE_DATA];
  72.    
  73. enum G_GLOBAL_DATA
  74. {
  75.     G_SECONDS,
  76.     G_MINUTES,
  77.     G_ADMIN,
  78.     G_ROUND
  79. }
  80.  
  81. new
  82.     gGlobal[G_GLOBAL_DATA];
  83.    
  84. new Float:gStartSpawns[][4] = {
  85. {2540.6560,2848.4426,10.8203,227.6038},
  86. {2546.0940,2836.8591,10.8203,2.1700},
  87. {2585.9043,2848.9812,10.8203,126.8779},
  88. {2573.4312,2848.3315,10.8203,228.2305},
  89. {2596.0417,2805.9031,10.8203,35.8654},
  90. {2615.7966,2849.2153,10.8203,141.6047},
  91. {2605.7920,2805.8025,10.8203,321.1230},
  92. {2614.1472,2848.3218,19.9922,88.9408},
  93. {2562.1228,2848.2454,19.9922,274.4125},
  94. {2543.5471,2805.7273,19.9999,268.9409},
  95. {2584.9009,2825.5068,19.9922,202.1277},
  96. {2563.6899,2848.8738,10.8203,117.3095}
  97. };
  98.  
  99. new Text:box;
  100. new Text:LLine1;
  101. new Text:LLine2;
  102. new Text:LLine3;
  103. new Text:LLine4;
  104. new Text:nametext;
  105. new Text:killtext;
  106. new Text:deathtext;
  107. new Text:stringtext;
  108. new Text:timeDisplay;
  109.  
  110. new Text:boxdn;
  111. new Text:pxlvl;
  112. new Text:bhleader;
  113. new Text:pxlvlnum[MAX_PLAYERS];
  114. new Text:admon;
  115. new Text:admonnum;
  116. new Text:bhleadernum[MAX_PLAYERS];
  117. new Text:separator1;
  118. new Text:separator2;
  119. new Text:currleader;
  120. new Text:currleadernam;
  121.  
  122. forward load_user_birth_day(playerid, name[], value[]);
  123. forward load_user_data_gungame(playerid, name[], value[]);
  124. forward load_player_pass(playerid, name[], value[]);
  125. forward ShowPlayerStats(playerid, targetid);
  126. forward split(const strsrc[], strdest[][], delimiter);
  127. forward D1(playerid);
  128. forward D2(playerid);
  129. forward D3(playerid);
  130. forward DS(playerid);
  131. forward OnPlayerLogout(playerid);
  132. forward SetCameraBehindPlayerEx(playerid);
  133.  
  134. main()
  135. {
  136.     print("...GunGame iniciado com sucesso.\n");
  137.     print("------------------------------------------------");
  138. }
  139.  
  140. /*-----------------------------------------------------------------------------*\
  141.     Esta callback é chamada quando o gamemode é iniciado
  142. \*-----------------------------------------------------------------------------*/
  143. public OnGameModeInit()
  144. {
  145.     print("------------------------------------------------\n");
  146.     print("Iniciando GunGame...");
  147.    
  148.     SetGameModeText("GunGame v1.0");
  149.     SendRconCommand("hostname SA-MP GunGame BR");
  150.     ShowPlayerMarkers(PLAYER_MARKERS_MODE_OFF);
  151.     UsePlayerPedAnims();
  152.     AddPlayerClass(285, 2548.0349, 2824.0513, 10.8203, 269.5908, 0, 0, 0, 0, 0, 0);
  153.    
  154.     /*CreateObject(971,2539.19995117,2823.00000000,13.19999981,0.00000000,0.00000000,90.25000000);
  155.     CreateObject(971,2616.60009766,2830.69995117,13.39999962,0.00000000,0.00000000,270.00000000);*/
  156.    
  157.     CreateObject(3095,2543.50000000,2808.60009766,9.30000019,0.00000000,0.00000000,0.00000000);
  158.     CreateObject(3095,2552.50000000,2808.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  159.     CreateObject(3095,2561.50000000,2808.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  160.     CreateObject(3095,2570.50000000,2808.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  161.     CreateObject(3095,2579.50000000,2808.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  162.     CreateObject(3095,2588.50000000,2808.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  163.     CreateObject(3095,2608.50000000,2808.39990234,9.30000019,0.00000000,0.00000000,0.00000000);
  164.     CreateObject(3095,2597.50000000,2808.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  165.     CreateObject(3095,2617.50000000,2808.39990234,9.30000019,0.00000000,0.00000000,0.00000000);
  166.     CreateObject(3095,2543.69995117,2817.60009766,9.30000019,0.00000000,0.00000000,0.00000000);
  167.     CreateObject(3095,2552.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  168.     CreateObject(3095,2561.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  169.     CreateObject(3095,2570.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  170.     CreateObject(3095,2579.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  171.     CreateObject(3095,2588.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  172.     CreateObject(3095,2597.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  173.     CreateObject(3095,2606.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  174.     CreateObject(3095,2615.50000000,2817.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  175.     CreateObject(3095,2615.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  176.     CreateObject(3095,2615.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  177.     CreateObject(3095,2606.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  178.     CreateObject(3095,2606.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  179.     CreateObject(3095,2597.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  180.     CreateObject(3095,2597.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  181.     CreateObject(3095,2588.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  182.     CreateObject(3095,2588.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  183.     CreateObject(3095,2579.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  184.     CreateObject(3095,2579.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  185.     CreateObject(3095,2570.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  186.     CreateObject(3095,2570.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  187.     CreateObject(3095,2561.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  188.     CreateObject(3095,2561.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  189.     CreateObject(3095,2552.50000000,2826.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  190.     CreateObject(3095,2552.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  191.     CreateObject(3095,2615.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  192.     CreateObject(3095,2606.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  193.     CreateObject(3095,2615.50000000,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  194.     CreateObject(3095,2606.50000000,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  195.     CreateObject(3095,2597.50000000,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  196.     CreateObject(3095,2597.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  197.     CreateObject(3095,2588.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  198.     CreateObject(3095,2579.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  199.     CreateObject(3095,2570.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  200.     CreateObject(3095,2561.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  201.     CreateObject(3095,2552.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  202.     CreateObject(3095,2543.50000000,2844.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  203.     CreateObject(3095,2543.50000000,2835.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  204.     CreateObject(3095,2543.69995117,2826.60009766,9.30000019,0.00000000,0.00000000,0.00000000);
  205.     CreateObject(3095,2588.50000000,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  206.     CreateObject(3095,2579.50000000,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  207.     CreateObject(3095,2570.50000000,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  208.     CreateObject(3095,2560.69995117,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  209.     CreateObject(3095,2551.69995117,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  210.     CreateObject(3095,2542.69995117,2853.30004883,9.30000019,0.00000000,0.00000000,0.00000000);
  211.     CreateObject(3095,2616.60009766,2831.19995117,12.19999981,0.00000000,270.25024414,359.99987793);
  212.     CreateObject(3095,2538.89990234,2823.80004883,12.19999981,0.00000000,270.24707031,182.99450684);
  213.    
  214.     ResetNonePlayer();
  215.    
  216.     gGlobal[G_SECONDS] = 60;
  217.    
  218.     box = TextDrawCreate(612.000000,338.000000,"C");
  219.     TextDrawUseBox(box,1);
  220.     TextDrawBoxColor(box,0x00000033);
  221.     TextDrawTextSize(box,454.000000,9.000000);
  222.     TextDrawAlignment(box,0);
  223.     TextDrawBackgroundColor(box,0x000000ff);
  224.     TextDrawFont(box,3);
  225.     TextDrawLetterSize(box,-0.000000,8.700001);
  226.     TextDrawColor(box,0xffffffff);
  227.     TextDrawSetOutline(box,1);
  228.     TextDrawSetProportional(box,1);
  229.     TextDrawSetShadow(box,1);
  230.  
  231.     nametext = TextDrawCreate(471.000000, 353.000000, "Ninguem~n~Ninguem~n~Ninguem~n~Ninguem~n~Ninguem");
  232.     TextDrawBackgroundColor(nametext, 255);
  233.     TextDrawFont(nametext, 1);
  234.     TextDrawLetterSize(nametext, 0.180000, 1.100000);
  235.     TextDrawColor(nametext, -1);
  236.     TextDrawSetOutline(nametext, 0);
  237.     TextDrawSetProportional(nametext, 1);
  238.     TextDrawSetShadow(nametext, 1);
  239.  
  240.     killtext = TextDrawCreate(520.000000, 353.000000, "0~n~0~n~0~n~0~n~0");
  241.     TextDrawBackgroundColor(killtext, 255);
  242.     TextDrawFont(killtext, 1);
  243.     TextDrawLetterSize(killtext, 0.289999, 1.100000);
  244.     TextDrawColor(killtext, -1);
  245.     TextDrawSetOutline(killtext, 0);
  246.     TextDrawSetProportional(killtext, 1);
  247.     TextDrawSetShadow(killtext, 1);
  248.  
  249.     deathtext = TextDrawCreate(565.000000, 353.000000, "0~n~0~n~0~n~0~n~0");
  250.     TextDrawBackgroundColor(deathtext, 255);
  251.     TextDrawFont(deathtext, 1);
  252.     TextDrawLetterSize(deathtext, 0.289999, 1.100000);
  253.     TextDrawColor(deathtext, -1);
  254.     TextDrawSetOutline(deathtext, 0);
  255.     TextDrawSetProportional(deathtext, 1);
  256.     TextDrawSetShadow(deathtext, 1);
  257.  
  258.     stringtext = TextDrawCreate(471.000000, 339.000000, "~p~N~w~ome - ~p~K~w~ills - ~p~D~w~eaths");
  259.     TextDrawBackgroundColor(stringtext, 255);
  260.     TextDrawFont(stringtext, 2);
  261.     TextDrawLetterSize(stringtext, 0.280000, 1.000000);
  262.     TextDrawColor(stringtext, -1);
  263.     TextDrawSetOutline(stringtext, 0);
  264.     TextDrawSetProportional(stringtext, 1);
  265.     TextDrawSetShadow(stringtext, 1);
  266.    
  267.     LLine1 = TextDrawCreate(609.000000,341.000000,"L");
  268.     TextDrawUseBox(LLine1,1);
  269.     TextDrawBoxColor(LLine1,0xffffff33);
  270.     TextDrawTextSize(LLine1,457.000000,-1.000000);
  271.     TextDrawAlignment(LLine1,0);
  272.     TextDrawBackgroundColor(LLine1,0x000000ff);
  273.     TextDrawFont(LLine1,3);
  274.     TextDrawLetterSize(LLine1,-0.000000,-0.400000);
  275.     TextDrawColor(LLine1,0xffffffff);
  276.     TextDrawSetOutline(LLine1,1);
  277.     TextDrawSetProportional(LLine1,1);
  278.     TextDrawSetShadow(LLine1,1);
  279. //---------------------------------------------------------->
  280.     LLine2 = TextDrawCreate(609.000000,416.000000,"L");
  281.     TextDrawUseBox(LLine2,1);
  282.     TextDrawBoxColor(LLine2,0xffffff33);
  283.     TextDrawTextSize(LLine2,457.000000,-9.000000);
  284.     TextDrawBackgroundColor(LLine2,0x000000ff);
  285.     TextDrawFont(LLine2,3);
  286.     TextDrawLetterSize(LLine2,-0.000000,-0.400000);
  287.     TextDrawColor(LLine2,0xffffffff);
  288.     TextDrawSetOutline(LLine2,1);
  289.     TextDrawSetProportional(LLine2,1);
  290.     TextDrawSetShadow(LLine2,1);
  291. //---------------------------------------------------------->
  292.  
  293.     LLine3 = TextDrawCreate(466.000000,343.000000,"T");
  294.     TextDrawUseBox(LLine3,1);
  295.     TextDrawBoxColor(LLine3,0xffffff33);
  296.     TextDrawTextSize(LLine3,457.000000,0.000000);
  297.     TextDrawAlignment(LLine3,0);
  298.     TextDrawBackgroundColor(LLine3,0x000000ff);
  299.     TextDrawFont(LLine3,3);
  300.     TextDrawLetterSize(LLine3,-0.000000,7.499998);
  301.     TextDrawColor(LLine3,0xffffffff);
  302.     TextDrawSetOutline(LLine3,1);
  303.     TextDrawSetProportional(LLine3,1);
  304.     TextDrawSetShadow(LLine3,1);
  305.    
  306.     //---------------------------------------------------------->
  307.     LLine4 = TextDrawCreate(607.000000,343.000000,"T");
  308.     TextDrawUseBox(LLine4,1);
  309.     TextDrawBoxColor(LLine4,0xffffff33);
  310.     TextDrawTextSize(LLine4,603.000000,-6.000000);
  311.     TextDrawAlignment(LLine4,0);
  312.     TextDrawBackgroundColor(LLine4,0x000000ff);
  313.     TextDrawFont(LLine4,3);
  314.     TextDrawLetterSize(LLine4,-0.000000,7.499999);
  315.     TextDrawColor(LLine4,0xffffffff);
  316.     TextDrawSetOutline(LLine4,1);
  317.     TextDrawSetProportional(LLine4,1);
  318.     TextDrawSetShadow(LLine4,1);
  319.    
  320.     timeDisplay = TextDrawCreate(605.0,25.0,"00:00");
  321.     TextDrawUseBox(timeDisplay, 0);
  322.     TextDrawFont(timeDisplay, 3);
  323.     TextDrawSetShadow(timeDisplay,0);
  324.     TextDrawSetOutline(timeDisplay,2);
  325.     TextDrawBackgroundColor(timeDisplay,0x000000FF);
  326.     TextDrawColor(timeDisplay,0xFFFFFFFF);
  327.     TextDrawAlignment(timeDisplay,3);
  328.     TextDrawLetterSize(timeDisplay,0.5,1.5);
  329.    
  330.     boxdn = TextDrawCreate(680.000000, 434.000000, "_");
  331.     TextDrawBackgroundColor(boxdn, 255);
  332.     TextDrawFont(boxdn, 1);
  333.     TextDrawLetterSize(boxdn, 0.500000, 2.000000);
  334.     TextDrawColor(boxdn, -1);
  335.     TextDrawSetOutline(boxdn, 0);
  336.     TextDrawSetProportional(boxdn, 1);
  337.     TextDrawSetShadow(boxdn, 1);
  338.     TextDrawUseBox(boxdn, 1);
  339.     TextDrawBoxColor(boxdn, 125);
  340.     TextDrawTextSize(boxdn, -53.000000, -6.000000);
  341.  
  342.     pxlvl = TextDrawCreate(4.000000, 433.000000, "Proximo level em    Kills");
  343.     TextDrawBackgroundColor(pxlvl, 255);
  344.     TextDrawFont(pxlvl, 1);
  345.     TextDrawLetterSize(pxlvl, 0.340000, 1.399999);
  346.     TextDrawColor(pxlvl, -1);
  347.     TextDrawSetOutline(pxlvl, 0);
  348.     TextDrawSetProportional(pxlvl, 1);
  349.     TextDrawSetShadow(pxlvl, 1);
  350.  
  351.     bhleader = TextDrawCreate(437.000000, 433.000000, "Voce esta a    leveis atras do lider");
  352.     TextDrawBackgroundColor(bhleader, 255);
  353.     TextDrawFont(bhleader, 1);
  354.     TextDrawLetterSize(bhleader, 0.340000, 1.399999);
  355.     TextDrawColor(bhleader, -1);
  356.     TextDrawSetOutline(bhleader, 0);
  357.     TextDrawSetProportional(bhleader, 1);
  358.     TextDrawSetShadow(bhleader, 1);
  359.  
  360.     admon = TextDrawCreate(36.000000, 323.000000, "Ha    administradores online.");
  361.     TextDrawBackgroundColor(admon, 255);
  362.     TextDrawFont(admon, 1);
  363.     TextDrawLetterSize(admon, 0.219999, 1.399999);
  364.     TextDrawColor(admon, -1);
  365.     TextDrawSetOutline(admon, 0);
  366.     TextDrawSetProportional(admon, 1);
  367.     TextDrawSetShadow(admon, 1);
  368.  
  369.     admonnum = TextDrawCreate(48.000000, 323.000000, "~p~00");
  370.     TextDrawBackgroundColor(admonnum, 255);
  371.     TextDrawFont(admonnum, 1);
  372.     TextDrawLetterSize(admonnum, 0.159999, 1.399999);
  373.     TextDrawColor(admonnum, -1029514582);
  374.     TextDrawSetOutline(admonnum, 1);
  375.     TextDrawSetProportional(admonnum, 1);
  376.  
  377.     separator1 = TextDrawCreate(149.000000, 425.000000, "l");
  378.     TextDrawBackgroundColor(separator1, 255);
  379.     TextDrawFont(separator1, 0);
  380.     TextDrawLetterSize(separator1, 0.500000, 3.099998);
  381.     TextDrawColor(separator1, -65281);
  382.     TextDrawSetOutline(separator1, 0);
  383.     TextDrawSetProportional(separator1, 1);
  384.     TextDrawSetShadow(separator1, 1);
  385.  
  386.     separator2 = TextDrawCreate(430.000000, 425.000000, "l");
  387.     TextDrawBackgroundColor(separator2, 255);
  388.     TextDrawFont(separator2, 0);
  389.     TextDrawLetterSize(separator2, 0.500000, 3.099998);
  390.     TextDrawColor(separator2, -65281);
  391.     TextDrawSetOutline(separator2, 0);
  392.     TextDrawSetProportional(separator2, 1);
  393.     TextDrawSetShadow(separator2, 1);
  394.  
  395.     currleader = TextDrawCreate(212.000000, 433.000000, "Lider Atual:");
  396.     TextDrawBackgroundColor(currleader, 255);
  397.     TextDrawFont(currleader, 1);
  398.     TextDrawLetterSize(currleader, 0.340000, 1.399999);
  399.     TextDrawColor(currleader, -1);
  400.     TextDrawSetOutline(currleader, 0);
  401.     TextDrawSetProportional(currleader, 1);
  402.     TextDrawSetShadow(currleader, 1);
  403.  
  404.     currleadernam = TextDrawCreate(300.000000, 431.000000, "~p~Ninguem");
  405.     TextDrawBackgroundColor(currleadernam, 255);
  406.     TextDrawFont(currleadernam, 1);
  407.     TextDrawLetterSize(currleadernam, 0.270000, 1.700000);
  408.     TextDrawColor(currleadernam, -1029514582);
  409.     TextDrawSetOutline(currleadernam, 1);
  410.     TextDrawSetProportional(currleadernam, 1);
  411.    
  412.     return 1;
  413. }
  414.  
  415. /*-----------------------------------------------------------------------------*\
  416.     Esta callback é chamada quando o gamemode é desligado
  417. \*-----------------------------------------------------------------------------*/
  418. public OnGameModeExit()
  419. {
  420.     return 1;
  421. }
  422.  
  423. /*-----------------------------------------------------------------------------*\
  424.     Esta callback é chamada quando um jogador realiza algum comando
  425.    
  426.     Param:
  427.         - playerid: ID do jogador que executou o comando
  428.         - cmdtext[]: O comando que o jogador utilizou
  429.         - sucess: O estado que foi realizado o comando
  430.        
  431.     Notes:
  432.         - sucess:  retorna 1 caso o comando foi encontrado e quer retornar 1.
  433.                    retorna -1 caso o comando foi encontrado e quer retornar 0.
  434.                    retorna 0 caso o comando não for encontrado, retorna qualquer
  435.                    coisa.
  436. \*-----------------------------------------------------------------------------*/
  437. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  438. {
  439.     if(!success)
  440.     {
  441.         format(cmdtext, 94, "*** Este comando não existe. Utilize /cmds ou /comandos para uma lista com todos os comandos.");
  442.         SendClientMessage(playerid, COLOR_GREY, cmdtext);
  443.     }
  444.     return true;
  445. }
  446.  
  447. /*-----------------------------------------------------------------------------*\
  448.     Esta callback é chamada quando um jogador muda de classe na seleção
  449.    
  450.     Param:
  451.         - playerid: O ID do jogador que muda as classes.
  452.         - classid: O ID da classe que está sendo vista.
  453.        
  454.     Notes:
  455.         - Retornando 0 nesta callback irá evitar que o jogador de spawn.
  456. \*-----------------------------------------------------------------------------*/
  457. public OnPlayerRequestClass(playerid, classid)
  458. {
  459.     SetPlayerPos(playerid,1524.7351,-1373.0142,233.8161);
  460.     SetPlayerCameraPos(playerid,1359.5557,-1029.1689,288.2147);
  461.     SetPlayerCameraLookAt(playerid,1557.7233,-1322.3529,220.9097);
  462.     return 1;
  463. }
  464.  
  465. public load_user_birth_day(playerid, name[], value[])
  466. {
  467.     INI_String("birthday", gPlayerData[playerid][E_PLAYER_BIRTH], 12);
  468.     return 1;
  469. }
  470.  
  471. /*-----------------------------------------------------------------------------*\
  472.     Esta callback é chamada quando se conecta ao servidor
  473.    
  474.     Param:
  475.         - playerid: O ID do jogador conectado.
  476. \*-----------------------------------------------------------------------------*/
  477. public OnPlayerConnect(playerid)
  478. {
  479.     ClearScreen(playerid);
  480.     SendClientMessageFormattedToAll(0x78C100FF, "*** {68A100}%s{78C100} se conectou ao servidor.", GetPlayerNameEx(playerid));
  481.     SendClientMessage(playerid, -1, " ");
  482.    
  483.     new
  484.         playerName[MAX_PLAYER_NAME];
  485.     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  486.     new
  487.         userFile[32];
  488.     format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  489.    
  490.     if(fexist(userFile))
  491.     {
  492.         SendClientMessage(playerid, COLOR_SAMP, "Esta conta está registrada em nosso banco de dados, entre com seus dados para fazer log-in.");
  493.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Log-in", "Digite sua senha para log-in:", "Acessar", "Disconnect");
  494.     }
  495.     else
  496.     {
  497.         SendClientMessage(playerid, COLOR_SAMP, "Esta conta não está registrada em nosso banco de dados, entre com seus dados para fazer o registro.");
  498.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registro", "Digite sua senha para registrar:", "Registrar", "Disconnect");
  499.     }
  500.     SendClientMessage(playerid, -1, " ");
  501.     SendClientMessageFormatted(playerid, 0x00B6FFFF, "*** Bem vindo {0087FA}%s{00B6FF}, ao GunGame SA-MP.", GetPlayerNameEx(playerid));
  502.     SendClientMessageFormatted(playerid, 0x00B6FFFF, "*** Digite {0087FA}/ajuda{00B6FF} para obter mais informações sobre este jogo.", GetPlayerNameEx(playerid));
  503.     SendClientMessage(playerid, -1, " ");
  504.    
  505.     gPlayerData[playerid][E_PLAYER_LVL] = 1;
  506.     gPlayerData[playerid][E_PLAYER_REG] = 0;
  507.     gPlayerData[playerid][E_PLAYER_KILLS] = 0;
  508.     gPlayerData[playerid][E_PLAYER_MUTED] = false;
  509.     gPlayerData[playerid][E_PLAYER_DEATHS] = 0;
  510.     gPlayerData[playerid][E_PLAYER_GKILLS] = 0;
  511.     gPlayerData[playerid][E_PLAYER_GDEATHS] = 0;
  512.     gPlayerData[playerid][E_PLAYER_NXTLVL] = 2;
  513.     gPlayerData[playerid][E_PLAYER_SKIN] = 285;
  514.     gPlayerData[playerid][E_PLAYER_SCORE] = 0;
  515.     gPlayerData[playerid][E_PLAYER_AGE] = 0;
  516.     gPlayerData[playerid][E_PLAYER_SEX] = 0;
  517.     gPlayerData[playerid][E_PLAYER_HEALTH] = 100.0;
  518.     gPlayerData[playerid][E_PLAYER_ADMIN] = 0;
  519.     gPlayerData[playerid][E_PLAYER_PLAYEDHOURS] = 0;
  520.    
  521.     pxlvlnum[playerid] = TextDrawCreate(106.000000, 431.000000, "~p~02");
  522.     TextDrawBackgroundColor(pxlvlnum[playerid], 255);
  523.     TextDrawFont(pxlvlnum[playerid], 1);
  524.     TextDrawLetterSize(pxlvlnum[playerid], 0.270000, 1.700000);
  525.     TextDrawColor(pxlvlnum[playerid], -1029514582);
  526.     TextDrawSetOutline(pxlvlnum[playerid], 1);
  527.     TextDrawSetProportional(pxlvlnum[playerid], 1);
  528.    
  529.     bhleadernum[playerid] = TextDrawCreate(507.000000, 431.000000, "~p~00");
  530.     TextDrawBackgroundColor(bhleadernum[playerid], 255);
  531.     TextDrawFont(bhleadernum[playerid], 1);
  532.     TextDrawLetterSize(bhleadernum[playerid], 0.270000, 1.700000);
  533.     TextDrawColor(bhleadernum[playerid], -1029514582);
  534.     TextDrawSetOutline(bhleadernum[playerid], 1);
  535.     TextDrawSetProportional(bhleadernum[playerid], 1);
  536.     return 1;
  537. }
  538.  
  539. /*-----------------------------------------------------------------------------*\
  540.     Esta callback é chamada quando um jogador desconecta do servidor
  541.    
  542.     Param:
  543.         - playerid: ID do jogador que saiu
  544.         - reason: ID da razão porque ele saiu
  545. \*-----------------------------------------------------------------------------*/
  546. public OnPlayerDisconnect(playerid, reason)
  547. {
  548.     if(gPlayerData[playerid][E_PLAYER_LOGGED] == true) OnPlayerLogout(playerid);
  549.     gPlayerData[playerid][E_PLAYER_LOGGED] = false;
  550.    
  551.     if(gPlayerData[playerid][E_PLAYER_ADMIN] > 0)
  552.     {
  553.         gGlobal[G_ADMIN]--;
  554.         new newtext[8];
  555.         format(newtext, sizeof(newtext), "~p~%02d", gGlobal[G_ADMIN]);
  556.         TextDrawSetString(admonnum, newtext);
  557.     }
  558.    
  559.     gPlayerData[playerid][E_PLAYER_KILLS] = 0;
  560.     gPlayerData[playerid][E_PLAYER_DEATHS] = 0;
  561.    
  562.     TextDrawDestroy(pxlvlnum[playerid]);
  563.     return 1;
  564. }
  565.  
  566. /*-----------------------------------------------------------------------------*\
  567.     Esta callback é chamada quando um jogador da spawn
  568.    
  569.     Param:
  570.         - playerid: ID do jogador que spawnou
  571.        
  572.     Notes:
  573.         - Return 0 nesta callback para forçar o jogador voltar a seleção
  574.             de classes no próximo respawn
  575. \*-----------------------------------------------------------------------------*/
  576. public OnPlayerSpawn(playerid)
  577. {  
  578.     new rand = random(sizeof(gStartSpawns));
  579.     SetPlayerPos(playerid, gStartSpawns[rand][0], gStartSpawns[rand][1], gStartSpawns[rand][2]);
  580.     SetPlayerFacingAngle(playerid, gStartSpawns[rand][3]);
  581.    
  582.     switch(gGlobal[G_ROUND])
  583.     {
  584.         case 1: GiveWeaponLevel(playerid);
  585.         default: GivePlayerWeapon(playerid, 4, 50);
  586.     }
  587.    
  588.     SetPlayerSkin(playerid, gPlayerData[playerid][E_PLAYER_SKIN]);
  589.     return 1;
  590. }
  591.  
  592. /*-----------------------------------------------------------------------------*\
  593.     Esta callback é chamada quando um jogador morre
  594.    
  595.     Param:
  596.         - playerid: ID do jogador que morreu
  597.         - killerid: ID do jogador que matou,
  598.             ou INVALID_PLAYER_ID se ele morreu sozinho
  599.         - reason: ID da razão pela qual o jogador morreu
  600. \*-----------------------------------------------------------------------------*/
  601. public OnPlayerDeath(playerid, killerid, reason)
  602. {
  603.     new myStr[156];
  604.     gPlayerData[playerid][E_PLAYER_DEATHS]++;
  605.     gPlayerData[playerid][E_PLAYER_GDEATHS]++;
  606.    
  607.     if(killerid == INVALID_PLAYER_ID && gPlayerData[playerid][E_PLAYER_LVL] > 1)
  608.     {
  609.         gPlayerData[playerid][E_PLAYER_NXTLVL] = 0;
  610.         gPlayerData[playerid][E_PLAYER_LVL]--;
  611.         CheckWeaponLevel(playerid);
  612.     }
  613.    
  614.     if(killerid != INVALID_PLAYER_ID)
  615.     {
  616.        
  617.         gPlayerData[killerid][E_PLAYER_KILLS]++;
  618.         gPlayerData[killerid][E_PLAYER_GKILLS]++;
  619.         TogglePlayerSpectating(playerid, 1);
  620.         PlayerSpectatePlayer(playerid, killerid);
  621.         D1(playerid);
  622.        
  623.         if(reason == 4)
  624.         {
  625.             if(gPlayerData[playerid][E_PLAYER_LVL] > 1)
  626.             {
  627.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 0;
  628.                 gPlayerData[playerid][E_PLAYER_LVL]--;
  629.                 CheckWeaponLevel(playerid);
  630.             }
  631.             gPlayerData[killerid][E_PLAYER_NXTLVL] = 1;
  632.            
  633.         }
  634.        
  635.         gPlayerData[killerid][E_PLAYER_NXTLVL]--;
  636.         if(gPlayerData[killerid][E_PLAYER_NXTLVL] <= 0) gPlayerData[killerid][E_PLAYER_LVL]++;
  637.        
  638.         CheckWeaponLevel(killerid);
  639.        
  640.         SetPlayerScore(killerid, gPlayerData[killerid][E_PLAYER_LVL]);
  641.        
  642.         if(gPlayerData[killerid][E_PLAYER_KILLS] == 1){myStr = "First Kill";}
  643.         else{format(myStr, sizeof(myStr), "%d kills", gPlayerData[killerid][E_PLAYER_KILLS]);}
  644.         SetPlayerBoom(killerid, myStr);
  645.        
  646.         format(myStr, sizeof(myStr), "%02d", gPlayerData[killerid][E_PLAYER_NXTLVL]);
  647.         TextDrawSetString(pxlvlnum[killerid], myStr);
  648.     }
  649.     return 1;
  650. }
  651.  
  652. /*-----------------------------------------------------------------------------*\
  653.     Esta callback é chamada quando a vehicle REspawns
  654.    
  655.     Param:
  656.         - vehicleid: ID of the vehicle that spawned
  657. \*-----------------------------------------------------------------------------*/
  658. public OnVehicleSpawn(vehicleid)
  659. {
  660.     return 1;
  661. }
  662.  
  663. /*-----------------------------------------------------------------------------*\
  664.     Esta callback é chamada quando a vehicle dies/explodes
  665.    
  666.     Param:
  667.         - vehicleid: ID of the vehicle that died
  668. \*-----------------------------------------------------------------------------*/
  669. public OnVehicleDeath(vehicleid, killerid)
  670. {
  671.     return 1;
  672. }
  673.  
  674. /*-----------------------------------------------------------------------------*\
  675.     Esta callback é chamada quando a player sends a chat message
  676.    
  677.     Param:
  678.         - playerid: ID of the player who typed
  679.         - text[]: the text that player typed
  680.        
  681.     Notes:
  682.         - Returning 0 wiil stop the text from being sent
  683. \*-----------------------------------------------------------------------------*/
  684. public OnPlayerText(playerid, text[])
  685. {
  686.     if(gPlayerData[playerid][E_PLAYER_MUTED])
  687.         return SendClientMessage(playerid, COLOR_GREY, "*** Você está silenciado.");
  688.  
  689.     switch(gPlayerData[playerid][E_PLAYER_REG])
  690.     {
  691.         case 1:
  692.         {
  693.             new year, month,day;
  694.             getdate(year, month, day);
  695.             new DateInfo[3][20];
  696.             split(text, DateInfo, '/');
  697.             if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
  698.             {
  699.                 SendClientMessage(playerid, COLOR_SAMP, "Qual a data de seu nascimento? (Use dd/mm/aaaa)");
  700.                 return 0;
  701.             }
  702.             new check = year - strval(DateInfo[2]);
  703.             if(check == year)
  704.             {
  705.                 SendClientMessage(playerid, COLOR_SAMP, "Qual a data de seu nascimento? (Use dd/mm/aaaa)");
  706.                 return 0;
  707.             }
  708.             if(strval(DateInfo[1]) > month)
  709.             {
  710.                 check -= 1;
  711.             }
  712.             else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
  713.             {
  714.                 check -= 1;
  715.             }
  716.             gPlayerData[playerid][E_PLAYER_AGE] = check;
  717.             new string[34];
  718.             format(string, sizeof(string), "Certo, você tem %d anos.",gPlayerData[playerid][E_PLAYER_AGE]);
  719.             SendClientMessage(playerid, COLOR_WHITE, string);
  720.             gPlayerData[playerid][E_PLAYER_REG] = 2;
  721.            
  722.             new playerName[MAX_PLAYER_NAME];
  723.             GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  724.             new userFile[32];
  725.             format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  726.             new INI:file = INI_Open(userFile);
  727.             INI_SetTag(file, "gungame");
  728.             INI_WriteString(file, "birthday", text);
  729.             INI_Close(file);
  730.            
  731.             SendClientMessage(playerid, COLOR_SAMP, "Você é do sexo masculino ou feminino?");
  732.             return 0;
  733.         }
  734.         case 2:
  735.         {
  736.             if((strcmp("masculino", text, true, strlen(text)) == 0))
  737.             {
  738.                 gPlayerData[playerid][E_PLAYER_SEX] = 1;
  739.                 SendClientMessage(playerid, COLOR_WHITE, "Certo, você é do sexo masculino.");
  740.                 SendClientMessage(playerid, COLOR_SAMP, "Você possui um endereço de e-mail? Caso não, diga apenas \"não\".");
  741.                 SendClientMessage(playerid, 0xC8C8C8C8, "*** Seu endereço não será divulgado, é apenas para contactar-mos nossos jogadores em caso de informações importantes.");
  742.                 gPlayerData[playerid][E_PLAYER_REG] = 3;
  743.                 return 0;
  744.             }
  745.             else if((strcmp("feminino", text, true, strlen(text)) == 0))
  746.             {
  747.                 gPlayerData[playerid][E_PLAYER_SEX] = 2;
  748.                 SendClientMessage(playerid, COLOR_WHITE, "Certo, você é do sexo feminino.");
  749.                 SendClientMessage(playerid, COLOR_SAMP, "Você possui um endereço de e-mail? Caso não, diga apenas \"não\".");
  750.                 SendClientMessage(playerid, 0xC8C8C8C8, "*** Seu endereço não será divulgado, é apenas para contactar-mos nossos jogadores em caso de informações importantes.");
  751.                 gPlayerData[playerid][E_PLAYER_REG] = 3;
  752.                 return 0;
  753.             }
  754.             else
  755.             {
  756.                 SendClientMessage(playerid, COLOR_SAMP, "Você é do sexo masculino ou feminino?");
  757.             }
  758.         }
  759.         case 3:
  760.         {
  761.             if(strfind(text, "@", true) != -1 && strfind(text, ".", true) != -1)
  762.             {
  763.                 new playerName[MAX_PLAYER_NAME];
  764.                 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  765.                 new userFile[32];
  766.                 format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  767.                 new INI:file = INI_Open(userFile);
  768.                 INI_SetTag(file, "gungame");
  769.                 INI_WriteString(file, "email", text);
  770.                 INI_WriteInt(file, "registered", 255);
  771.                 INI_Close(file);
  772.            
  773.                 SendClientMessageFormatted(playerid, COLOR_WHITE, "Certo, então seu e-mail é: {C8C8C8}%s", text);
  774.                 SendClientMessage(playerid, COLOR_SAMP, "Conta registrada completamente com sucesso.");
  775.                 gPlayerData[playerid][E_PLAYER_REG] = 0;
  776.                 SpawnPlayer(playerid);
  777.                 SetTimerEx("SetCameraBehindPlayerEx", 50, false, "i", playerid);
  778.                 return 0;
  779.             }
  780.             else if((strcmp("não", text, true, strlen(text)) == 0) || strcmp("nao", text, true, strlen(text)) == 0)
  781.             {
  782.                 new playerName[MAX_PLAYER_NAME];
  783.                 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  784.                 new userFile[32];
  785.                 format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  786.                 new INI:file = INI_Open(userFile);
  787.                 INI_SetTag(file, "gungame");
  788.                 INI_WriteString(file, "email", "Nenhum");
  789.                 INI_WriteInt(file, "registered", 255);
  790.                 INI_Close(file);
  791.  
  792.                 SendClientMessage(playerid, COLOR_WHITE, "Certo, então você não possui um e-mail.");
  793.                 SendClientMessage(playerid, 0xC8C8C8C8, "*** Você não poderá recuperar sua conta caso perca sua senha, você pode adicionar um novo e-mail através do /mudaremail.");
  794.                 SendClientMessage(playerid, COLOR_SAMP, "Conta registrada completamente com sucesso.");
  795.                 gPlayerData[playerid][E_PLAYER_REG] = 0;
  796.                 SpawnPlayer(playerid);
  797.                 SetTimerEx("SetCameraBehindPlayerEx", 50, false, "i", playerid);
  798.                 return 0;
  799.             }
  800.             else
  801.             {
  802.                 SendClientMessage(playerid, COLOR_SAMP, "Você possui um endereço de e-mail? Caso não, diga apenas \"não\".");
  803.                 return 0;
  804.             }
  805.         }
  806.     }
  807.     SendClientMessageFormattedToAll(GetPlayerColor(playerid), "%s{C8C8C8}(ID:%i): {ffffff}%s", GetPlayerNameEx(playerid), playerid, text);
  808.     return 0;
  809. }
  810.  
  811. /*-----------------------------------------------------------------------------*\
  812.     Esta callback é chamada quando a player starts to enter a vehicle,
  813.     meaning the player is not in vehicle yet at the time
  814.     this callback is called.
  815.    
  816.     Param:
  817.         - playerid: ID of the player who attempts to enter a vehicle
  818.         - vehicleid: ID of the vehicle the player is attempting to enter
  819.         - ispassenger: 0 if entering as driver. 1 if entering as passenger
  820. \*-----------------------------------------------------------------------------*/
  821. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  822. {
  823.     return 1;
  824. }
  825.  
  826. /*-----------------------------------------------------------------------------*\
  827.     Esta callback é chamada quando a player exits a vehicle
  828.    
  829.     Param:
  830.         - playerid: The ID of the player who exited the vehicle
  831.         - vehicleid: The ID of the vehicle the player is exiting
  832. \*-----------------------------------------------------------------------------*/
  833. public OnPlayerExitVehicle(playerid, vehicleid)
  834. {
  835.     return 1;
  836. }
  837.  
  838. /*-----------------------------------------------------------------------------*\
  839.     Esta callback é chamada quando a player changes state4
  840.    
  841.     Param:
  842.         - playerid: The ID of the player that changed state
  843.         - newstate: The player's new state
  844.         - oldstate: The player's previous state
  845. \*-----------------------------------------------------------------------------*/
  846. public OnPlayerStateChange(playerid, newstate, oldstate)
  847. {
  848.     return 1;
  849. }
  850.  
  851. /*-----------------------------------------------------------------------------*\
  852.     Esta callback é chamada quando a player enters the checkpoint
  853.     set for that player
  854.    
  855.     Param:
  856.         - playerid: The player who entered the checkpoint
  857. \*-----------------------------------------------------------------------------*/
  858. public OnPlayerEnterCheckpoint(playerid)
  859. {
  860.     return 1;
  861. }
  862.  
  863. /*-----------------------------------------------------------------------------*\
  864.     Esta callback é chamada quando a player leaves the checkpoint
  865.     set for that player
  866.    
  867.     Param:
  868.         - playerid: The player who left the checkpoint
  869. \*-----------------------------------------------------------------------------*/
  870. public OnPlayerLeaveCheckpoint(playerid)
  871. {
  872.     return 1;
  873. }
  874.  
  875. /*-----------------------------------------------------------------------------*\
  876.     Esta callback é chamada quando a player enters a race checkpoint
  877.  
  878.     Param:
  879.         - playerid: The ID of the player who entered the race checkpoint
  880. \*-----------------------------------------------------------------------------*/
  881. public OnPlayerEnterRaceCheckpoint(playerid)
  882. {
  883.     return 1;
  884. }
  885.  
  886. /*-----------------------------------------------------------------------------*\
  887.     Esta callback é chamada quando a player leaves a race checkpoint
  888.  
  889.     Param:
  890.         - playerid: The ID of the player who left the race checkpoint
  891. \*-----------------------------------------------------------------------------*/
  892. public OnPlayerLeaveRaceCheckpoint(playerid)
  893. {
  894.     return 1;
  895. }
  896.  
  897. /*-----------------------------------------------------------------------------*\
  898.     Esta callback é chamada quando a player types things into the RCON console
  899.    
  900.     Param:
  901.         - cmd[]: The string containing the cmd
  902.        
  903.     Notes:
  904.         - Returns 0 if the command was not processed,
  905.           it will be passed to another script or
  906.         - Returns 1 if the command was processed,
  907.           will not be passed to other scripts
  908. \*-----------------------------------------------------------------------------*/
  909. public OnRconCommand(cmd[])
  910. {
  911.     return 1;
  912. }
  913.  
  914. /*-----------------------------------------------------------------------------*\
  915.     Esta callback é chamada quando a player attempts to spawn via class selection
  916.    
  917.     Param:
  918.         - playerid: The ID of the player who requested to spawn
  919.        
  920.     Notes:
  921.          - Returning 0 in this callback will prevent the player from spawning
  922. \*-----------------------------------------------------------------------------*/
  923. public OnPlayerRequestSpawn(playerid)
  924. {
  925.     if(gPlayerData[playerid][E_PLAYER_REG] == 0 || gPlayerData[playerid][E_PLAYER_REG] == 255){}
  926.     else
  927.     {
  928.         SendClientMessage(playerid, COLOR_GREY, "*** Você não pode dar spawn antes de terminar seu cadastro.");
  929.         return 0;
  930.     }
  931.     return 1;
  932. }
  933.  
  934. /*-----------------------------------------------------------------------------*\
  935.     Esta callback é chamada quando an object is moved after MoveObject
  936.     (when it stops moving)
  937.    
  938.     Param:
  939.         - objectid: The ID of the object that was moved
  940. \*-----------------------------------------------------------------------------*/
  941. public OnObjectMoved(objectid)
  942. {
  943.     return 1;
  944. }
  945.  
  946. /*-----------------------------------------------------------------------------*\
  947.     Esta callback é chamada quando a player object is moved after
  948.     MovePlayerObject (when it stops moving)
  949.    
  950.     Param:
  951.         - playerid: The playerid the object is assigned to
  952.         - objectid: The ID of the player object that was moved
  953. \*-----------------------------------------------------------------------------*/
  954. public OnPlayerObjectMoved(playerid, objectid)
  955. {
  956.     return 1;
  957. }
  958.  
  959. /*-----------------------------------------------------------------------------*\
  960.     Esta callback é chamada quando a player picks up a pickup
  961.    
  962.     Param:
  963.         - playerid: The ID of the player that picked up the pickup
  964.         - pickupid: The ID of the pickup, returned by CreatePickup()
  965. \*-----------------------------------------------------------------------------*/
  966. public OnPlayerPickUpPickup(playerid, pickupid)
  967. {
  968.     return 1;
  969. }
  970.  
  971. /*-----------------------------------------------------------------------------*\
  972.     Esta callback é chamada quando a vehicle is modded
  973.    
  974.     Param:
  975.         - playerid: ID of the player who is actually sitting in the car
  976.         - vehicleid: ID of the vehicle which is modded
  977.         - componentid: The componentid which was added to the car
  978. \*-----------------------------------------------------------------------------*/
  979. public OnVehicleMod(playerid, vehicleid, componentid)
  980. {
  981.     return 1;
  982. }
  983.  
  984. /*-----------------------------------------------------------------------------*\
  985.     Esta callback é chamada quando a player changes the paintjob
  986.     of their vehicle (in a modshop)
  987.    
  988.     Param:
  989.         - playerid: The ID of the player whos vehicle is modded
  990.         - vehicleid: The ID of the vehicle that changed paintjob
  991.         - paintjobid: The ID of the new paintjob
  992. \*-----------------------------------------------------------------------------*/
  993. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  994. {
  995.     return 1;
  996. }
  997.  
  998. /*-----------------------------------------------------------------------------*\
  999.     The callback name is deceptive, Esta callback é chamada quando a
  1000.     player exits the mod shops, regardless if color was changed,
  1001.     and is NEVER called for pay'n'spray shops
  1002.    
  1003.     Param:
  1004.         - playerid: The ID of the player that is driving the vehicle
  1005.         - vehicleid: The ID of the vehicle that was resprayed
  1006.         - color1: The color that the vehicle's primary color was changed to
  1007.         - color2: The color that the vehicle's secondary color was changed to
  1008. \*-----------------------------------------------------------------------------*/
  1009. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1010. {
  1011.     return 1;
  1012. }
  1013.  
  1014. /*-----------------------------------------------------------------------------*\
  1015.     Esta callback é chamada quando a player selects an item from a menu
  1016.    
  1017.     Param:
  1018.         - playerid: The ID of the player thatselected the item on the menu
  1019.         - row: The row that was selected
  1020. \*-----------------------------------------------------------------------------*/
  1021. public OnPlayerSelectedMenuRow(playerid, row)
  1022. {
  1023.     return 1;
  1024. }
  1025.  
  1026. /*-----------------------------------------------------------------------------*\
  1027.     Esta callback é chamada quando a player exits a menu
  1028.        
  1029.     Param:
  1030.         - playerid: The ID of the player that exited the menu
  1031. \*-----------------------------------------------------------------------------*/
  1032. public OnPlayerExitedMenu(playerid)
  1033. {
  1034.     return 1;
  1035. }
  1036.  
  1037. /*-----------------------------------------------------------------------------*\
  1038.     Esta callback é chamada quando a player changes interior
  1039.    
  1040.     Param:
  1041.         - playerid: The playerid who changed interior
  1042.         - newinteriorid: The interior the player just changed to
  1043.         - oldinteriorid: The interior the player just changed from
  1044. \*-----------------------------------------------------------------------------*/
  1045. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  1046. {
  1047.     return 1;
  1048. }
  1049.  
  1050. /*-----------------------------------------------------------------------------*\
  1051.     Esta callback é chamada quando the state of any key
  1052.     except the movement keys (up, down, left, right)
  1053.     changes (i.e. are pressed or released)
  1054.    
  1055.     Param:
  1056.         - playerid: ID of the player who pressed the key
  1057.         - newkeys: A map of the keys currently held - see GetPlayerKeys
  1058.         - oldkeys: A map of the keys held prior to the current change
  1059.        
  1060.     Notes:
  1061.         - Returning 1 allows this callback to be called in other scripts.
  1062.           it is always called first in gamemodes so retuning 0 there
  1063.           blocks filterscripts from seeing it.
  1064. \*-----------------------------------------------------------------------------*/
  1065. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1066. {
  1067.     return 1;
  1068. }
  1069.  
  1070. /*-----------------------------------------------------------------------------*\
  1071.     Esta callback é chamada quando someone tries to login to RCON,
  1072.     succesful or not
  1073.    
  1074.     Param:
  1075.         - ip[]: The IP of the player that tried to login to RCON
  1076.         - password[]: The password used to login with
  1077.         - success: 0 if the password was incorrect or 1 if it was correct
  1078.    
  1079.     Notes:
  1080.         - This callback is only called when /rcon login is used.
  1081. \*-----------------------------------------------------------------------------*/
  1082. public OnRconLoginAttempt(ip[], password[], success)
  1083. {
  1084.     return 1;
  1085. }
  1086.  
  1087. /*-----------------------------------------------------------------------------*\
  1088.     This callback is called everytime a client/player updates the server
  1089.     with their status
  1090.    
  1091.     Param:
  1092.         - playerid: ID of the player sending an update packet
  1093.        
  1094.     Notes:
  1095.         - Return 0 - Update from this player will not be
  1096.           replicated to other clients
  1097.         - Return 1 - Indicates that this update can be processed normally
  1098.           and sent to other players.
  1099. \*-----------------------------------------------------------------------------*/
  1100. public OnPlayerUpdate(playerid)
  1101. {
  1102.     return 1;
  1103. }
  1104.  
  1105. /*-----------------------------------------------------------------------------*\
  1106.     Esta callback é chamada quando a player is streamed
  1107.     by some other player's client
  1108.    
  1109.     Param:
  1110.         - playerid: The ID of the player who has been streamed
  1111.         - forplayerid: The ID of the player that streamed the other player in
  1112. \*-----------------------------------------------------------------------------*/
  1113. public OnPlayerStreamIn(playerid, forplayerid)
  1114. {
  1115.     return 1;
  1116. }
  1117.  
  1118. /*-----------------------------------------------------------------------------*\
  1119.     Esta callback é chamada quando a player is streamed out
  1120.     from some other player's client
  1121.    
  1122.     Param:
  1123.         - playerid: The player who has been destreamed
  1124.         - forplayerid: The player who has destreamed the other player
  1125. \*-----------------------------------------------------------------------------*/
  1126. public OnPlayerStreamOut(playerid, forplayerid)
  1127. {
  1128.     return 1;
  1129. }
  1130.  
  1131. /*-----------------------------------------------------------------------------*\
  1132.     Esta callback é chamada quando a vehicle is streamed to a player's client
  1133.    
  1134.     Param:
  1135.         - vehicleid: The ID of the vehicle that streamed in for the player
  1136.         - forplayerid: The ID of the player who the vehicle streamed in for
  1137. \*-----------------------------------------------------------------------------*/
  1138. public OnVehicleStreamIn(vehicleid, forplayerid)
  1139. {
  1140.     return 1;
  1141. }
  1142.  
  1143. /*-----------------------------------------------------------------------------*\
  1144.     Esta callback é chamada quando a vehicle is streamed out
  1145.     from some player's client
  1146.    
  1147.     Param:
  1148.         - vehicleid: The ID of the vehicle that streamed out
  1149.         - forplayerid: ID of the player who is no longer streaming the vehicle
  1150. \*-----------------------------------------------------------------------------*/
  1151. public OnVehicleStreamOut(vehicleid, forplayerid)
  1152. {
  1153.     return 1;
  1154. }
  1155.  
  1156. /*-----------------------------------------------------------------------------*\
  1157.     Esta callback é chamada quando a player pressiona qualquer botão no dialogo
  1158.     criado usando ShowPlayerDialog()
  1159.        
  1160.     Param:
  1161.         - playerid: O ID que clicou o botão do dialogo
  1162.         - dialogid: O ID do dialogo que o jogador clicou,
  1163.             usado no ShowPlayerDialog()
  1164.         - response: 1 para o primeiro botão e 0 para o segundo botão
  1165.         - listitem: O ID do item selecionado pelo jogador
  1166.         - inputtext[]: O texto inserido na caixa de texto pelo jogador
  1167.                      
  1168.     Notas:
  1169.         - Retornando 0 nesta callback irá passar o dialogo para outro script
  1170.           no caso de nenhum código correspondente for encontrado em seu gamemode
  1171. \*-----------------------------------------------------------------------------*/
  1172. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1173. {
  1174.     switch(dialogid)
  1175.     {
  1176.         case DIALOG_LOGIN:
  1177.         {
  1178.             if(response)
  1179.             {
  1180.                 new
  1181.                     playerName[MAX_PLAYER_NAME];
  1182.                 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1183.                 new
  1184.                     userFile[32];
  1185.                 format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  1186.                 // Parse the file.
  1187.                 INI_ParseFile(userFile, "load_player_pass", .bExtra = true, .extra = playerid);
  1188.                
  1189.                 if(!strcmp(gPlayerData[playerid][E_PLAYER_PASS], inputtext, true))
  1190.                 {
  1191.                     SendClientMessage(playerid, COLOR_SAMP, "Você acessou a conta com sucesso!");
  1192.                     gPlayerData[playerid][E_PLAYER_LOGGED] = true;
  1193.                     OnPlayerLogin(playerid);
  1194.                     if(gGlobal[G_ROUND] == 0) SendClientMessage(playerid, COLOR_YELLOW, "*** Atualmente, está na {E5CE00}rodada de aquecimento{FFFF00}.");
  1195.                     if(gPlayerData[playerid][E_PLAYER_ADMIN] > 0){ gGlobal[G_ADMIN]++; new newtext[8]; format(newtext, sizeof(newtext), "~p~%02d", gGlobal[G_ADMIN]); TextDrawSetString(admonnum, newtext);}
  1196.                     SpawnPlayer(playerid);
  1197.                     SetTimerEx("SetCameraBehindPlayerEx", 50, false, "i", playerid);
  1198.                     CheckBirthDay(playerid, userFile);
  1199.                     SetPlayerTime(playerid, 22, 00);
  1200.                 }
  1201.                 else
  1202.                 {
  1203.                     SendClientMessage(playerid, COLOR_SAMP, "Senha incorreta.");
  1204.                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Log-in", "Digite sua senha para log-in:", "Acessar", "Desconectar");
  1205.                 }
  1206.             }
  1207.             else
  1208.             {
  1209.                 Kick(playerid);
  1210.             }
  1211.         }
  1212.         case DIALOG_REGISTER:
  1213.         {
  1214.             if(response)
  1215.             {
  1216.                 if(strlen(inputtext) < 1)
  1217.                     return SendClientMessage(playerid, COLOR_SAMP, "Senha muito curta.");
  1218.  
  1219.                 // Make the filename.
  1220.                 new
  1221.                     playerName[MAX_PLAYER_NAME];
  1222.                 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1223.                 new
  1224.                     userFile[32];
  1225.                 format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  1226.                 //Store the date.
  1227.                 new
  1228.                     pYear, pMonth, pDay, pHour, pMinute, pSecond, pDate[23];
  1229.        
  1230.                 getdate(pYear, pMonth, pDay);
  1231.                 gettime(pHour, pMinute, pSecond);
  1232.                
  1233.                 format(pDate, sizeof pDate, "%02d:%02d:%02d  %02d/%02d/%02d",pHour, pMinute, pSecond , pDay, pMonth, pYear);
  1234.                 // Open the file.
  1235.                 new
  1236.                     INI:file = INI_Open(userFile);
  1237.                 // Set the tag.
  1238.                 INI_SetTag(file, "gungame");
  1239.                 // Write the data.
  1240.                 INI_WriteString(file, "password", inputtext);
  1241.                 INI_WriteFloat(file, "health", 100.0);
  1242.                 INI_WriteInt(file, "skinid", 285);
  1243.                 INI_WriteInt(file, "idade", 0);
  1244.                 INI_WriteInt(file, "sexo", 0);
  1245.                 INI_WriteString(file, "clan", "Nen");
  1246.                 INI_WriteInt(file, "admin", 0);
  1247.                 INI_WriteString(file, "date", pDate);
  1248.                 INI_WriteInt(file, "kills", 0);
  1249.                 INI_WriteInt(file, "deaths", 0);
  1250.                 INI_WriteString(file, "lastlogin", pDate);
  1251.                 INI_WriteInt(file, "playedtime", 0);
  1252.                 INI_WriteBool(file, "muted", false);
  1253.                 // Close the file.
  1254.                 INI_Close(file);
  1255.                
  1256.                 SendClientMessage(playerid, COLOR_SAMP, "Conta registrada.");
  1257.                 SendClientMessage(playerid, COLOR_SAMP, "Qual a data de seu nascimento? (Use dd/mm/aaaa)");
  1258.                
  1259.                 gPlayerData[playerid][E_PLAYER_REG] = 1;
  1260.                 gPlayerData[playerid][E_PLAYER_LOGGED] = true;
  1261.                 format(gPlayerData[playerid][E_PLAYER_RDATE], 32, "%s", pDate);
  1262.                 format(gPlayerData[playerid][E_PLAYER_LASTLOGIN], 32, "%s", pDate);
  1263.             }
  1264.             else
  1265.             {
  1266.                 Kick(playerid);
  1267.             }
  1268.         }
  1269.     }
  1270.     return 0;
  1271. }
  1272.  
  1273. /*-----------------------------------------------------------------------------*\
  1274.     Esta callback é faz com que a camera fique atrás do jogador
  1275.    
  1276.     Param:
  1277.         - playerid: O ID do jogador que terá a camera setada
  1278. \*-----------------------------------------------------------------------------*/
  1279. public SetCameraBehindPlayerEx(playerid)
  1280. {
  1281.     SetCameraBehindPlayer(playerid);
  1282.    
  1283.     TextDrawShowForPlayer(playerid, box);
  1284.     TextDrawShowForPlayer(playerid, LLine1);
  1285.     TextDrawShowForPlayer(playerid, LLine2);
  1286.     TextDrawShowForPlayer(playerid, LLine3);
  1287.     TextDrawShowForPlayer(playerid, LLine4);
  1288.     TextDrawShowForPlayer(playerid, nametext);
  1289.     TextDrawShowForPlayer(playerid, stringtext);
  1290.     TextDrawShowForPlayer(playerid, killtext);
  1291.     TextDrawShowForPlayer(playerid, deathtext);
  1292.     TextDrawShowForPlayer(playerid,timeDisplay);
  1293.    
  1294.     TextDrawShowForPlayer(playerid, boxdn);
  1295.     TextDrawShowForPlayer(playerid, pxlvl);
  1296.     TextDrawShowForPlayer(playerid, bhleader);
  1297.     TextDrawShowForPlayer(playerid, pxlvlnum[playerid]);
  1298.     TextDrawShowForPlayer(playerid, admon);
  1299.     TextDrawShowForPlayer(playerid, admonnum);
  1300.     TextDrawShowForPlayer(playerid, bhleadernum[playerid]);
  1301.     TextDrawShowForPlayer(playerid, separator1);
  1302.     TextDrawShowForPlayer(playerid, separator2);
  1303.     TextDrawShowForPlayer(playerid, currleader);
  1304.     TextDrawShowForPlayer(playerid, currleadernam);
  1305.    
  1306.     SetCameraBehindPlayer(playerid);
  1307.     return 1;
  1308. }
  1309. /*-----------------------------------------------------------------------------*\
  1310.     Esta callback é chamada quando a player double-clicks on another
  1311.     player's name in the scoreboard
  1312.    
  1313.     Param:
  1314.         - playerid: The ID of the player that clicked the name
  1315.         - clickedplayerid: The ID of the player whose name was clicked
  1316.         - source: Scoreboard = 0
  1317. \*-----------------------------------------------------------------------------*/
  1318. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1319. {
  1320.     return 1;
  1321. }
  1322.  
  1323. /*-----------------------------------------------------------------------------*\
  1324.     Esta callback é chamada quando a player enters or exits a mod shop
  1325.    
  1326.     Param:
  1327.         - playerid: The ID of the player that entered or exited the modshop
  1328.         - enterexit: 1 if the player entered or 0 if they exited
  1329.         - interiorid: The interior ID of the modshop that the player is entering
  1330.           (or 0 if exiting)
  1331. \*-----------------------------------------------------------------------------*/
  1332. public OnEnterExitModShop(playerid, enterexit, interiorid)
  1333. {
  1334.     return 1;
  1335. }
  1336.  
  1337. /*-----------------------------------------------------------------------------*\
  1338.     Esta callback é chamada quando um jogador danifica outro jogador
  1339.    
  1340.     Param:
  1341.         - playerid: O ID do jogador que danificou
  1342.         - damagedid: O ID do jogador que foi danificado
  1343.         - amount: A quantia de saúde/colete perdida
  1344.         - weaponid: A arma usada para danificar
  1345. \*-----------------------------------------------------------------------------*/
  1346. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  1347. {
  1348.     new
  1349.         Float:health;
  1350.     GetPlayerHealth(damagedid, health);
  1351.     if(health-amount > 0) SetPlayerHealth(damagedid, health-amount);
  1352.     return 1;
  1353. }
  1354.  
  1355. /*-----------------------------------------------------------------------------*\
  1356.     Esta callback é chamada quando a player takes damage
  1357.    
  1358.     Param:
  1359.         - playerid: The ID of the player that took damage
  1360.         - issuerid: The ID of the player that caused the damage.
  1361.                     INVALID_PLAYER_ID if none
  1362.         - amount: The amount of health/armour playerid has lost
  1363.         - weaponid: The reason that caused the damage
  1364. \*-----------------------------------------------------------------------------*/
  1365. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  1366. {
  1367.     return 1;
  1368. }
  1369.  
  1370. /*-----------------------------------------------------------------------------*\
  1371.     This callback is called everytime an unoccupied vehicle updates
  1372.     the server with their status
  1373.    
  1374.     Param:
  1375.         - vehicleid: The vehicleid that the callback is processing
  1376.         - playerid: The playerid that the callback is processing
  1377.                     (the playerid affecting the vehicle)
  1378.         - passenger_seat: The passenger seat of the playerid moving the vehicle.
  1379.                           0 if they're not in the vehicle
  1380. \*-----------------------------------------------------------------------------*/
  1381. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
  1382. {
  1383.     return 1;
  1384. }
  1385.  
  1386. /*-----------------------------------------------------------------------------*\
  1387.     Esta callback é chamada quando um jogador faz log-in no servidor
  1388.    
  1389.     Param:
  1390.         - playerid: O ID do jogador que terá a conta carregada
  1391.         - name: Nome do item a ser carregado
  1392.         - value: Valor do item que será carregado
  1393. \*-----------------------------------------------------------------------------*/
  1394. public load_user_data_gungame(playerid, name[], value[])
  1395. {
  1396.     INI_Float("health", gPlayerData[playerid][E_PLAYER_HEALTH]);
  1397.     INI_Int("skinid", gPlayerData[playerid][E_PLAYER_SKIN]);
  1398.     INI_Int("idade", gPlayerData[playerid][E_PLAYER_AGE]);
  1399.     INI_Int("sexo", gPlayerData[playerid][E_PLAYER_SEX]);
  1400.     INI_String("clan", gPlayerData[playerid][E_PLAYER_CLAN], 4);
  1401.     INI_Int("admin", gPlayerData[playerid][E_PLAYER_ADMIN]);
  1402.     INI_Int("kills", gPlayerData[playerid][E_PLAYER_GKILLS]);
  1403.     INI_Int("deaths", gPlayerData[playerid][E_PLAYER_GDEATHS]);
  1404.     INI_String("date", gPlayerData[playerid][E_PLAYER_RDATE], 32);
  1405.     INI_String("lastlogin", gPlayerData[playerid][E_PLAYER_LASTLOGIN], 32);
  1406.     INI_Int("playedtime", gPlayerData[playerid][E_PLAYER_PLAYEDHOURS]);
  1407.     INI_Int("registered", gPlayerData[playerid][E_PLAYER_REG]);
  1408.     INI_Bool("muted", gPlayerData[playerid][E_PLAYER_MUTED]);
  1409.     return 1;
  1410. }
  1411.  
  1412. /*-----------------------------------------------------------------------------*\
  1413.     Esta callback checa a senha de um jogador
  1414.    
  1415.     Param:
  1416.         - playerid: O ID do jogador que terá a senha checada
  1417. \*-----------------------------------------------------------------------------*/
  1418. public load_player_pass(playerid, name[], value[])
  1419. {
  1420.     if ( !strcmp( name, "password" ) ) { INI_String("password", gPlayerData[playerid][E_PLAYER_PASS], 64); }
  1421.     return 1;
  1422. }
  1423.  
  1424. /*-----------------------------------------------------------------------------*\
  1425.     Esta callback mostra o status de um jogador
  1426.    
  1427.     Param:
  1428.         - playerid: O ID do jogador que terá o status mostrado
  1429.         - targetid: O ID do jogador que verá o status
  1430. \*-----------------------------------------------------------------------------*/
  1431. public ShowPlayerStats(playerid,targetid)
  1432. {
  1433.     if(gPlayerData[playerid][E_PLAYER_LOGGED] && gPlayerData[targetid][E_PLAYER_LOGGED])
  1434.     {
  1435.         SendClientMessage(playerid,COLOR_PURPLE,"_____________________________ {B1A2DA}GERAL{C2A2DA} _____________________________");
  1436.  
  1437.         new
  1438.             Float:hp,
  1439.             Float:armour,
  1440.             wstring[128],
  1441.             stext[11];
  1442.  
  1443.         GetPlayerHealth(targetid,hp);
  1444.         GetPlayerArmour(targetid, armour);
  1445.        
  1446.         switch(gPlayerData[targetid][E_PLAYER_SEX])
  1447.         {
  1448.             case 1: stext = "masculino";
  1449.             case 2: stext = "feminino";
  1450.             default: stext = "indefinido";
  1451.         }
  1452.        
  1453.         new kills = gPlayerData[targetid][E_PLAYER_KILLS];
  1454.         new deaths = gPlayerData[targetid][E_PLAYER_DEATHS];
  1455.         new Float:ratio;
  1456.         ratio=floatdiv(kills, deaths);
  1457.        
  1458.         if(kills+deaths == 0) ratio=0.00;
  1459.  
  1460.         format(wstring, sizeof(wstring), "Nome: %s - Idade: %d - Sexo: %s - Kills: %d - Deaths: %d - K/D: %0.02f",GetPlayerNameEx(targetid),gPlayerData[targetid][E_PLAYER_AGE],stext,gPlayerData[targetid][E_PLAYER_GKILLS],gPlayerData[targetid][E_PLAYER_GDEATHS],ratio);
  1461.         SendClientMessage(playerid,0xE6E6E6E6, wstring);
  1462.         format(wstring, sizeof(wstring), "Membro desde: %s - Última visita: %s - Horas Jogadas: %02d:%02d:%02d",gPlayerData[playerid][E_PLAYER_RDATE], gPlayerData[playerid][E_PLAYER_LASTLOGIN], gPlayerData[playerid][E_PLAYER_PLAYEDHOURS]/3600, (gPlayerData[playerid][E_PLAYER_PLAYEDHOURS]-(3600*(gPlayerData[playerid][E_PLAYER_PLAYEDHOURS]/3600)))/60, gPlayerData[playerid][E_PLAYER_PLAYEDHOURS]%60);
  1463.         SendClientMessage(playerid,0xC8C8C8C8, wstring);
  1464.        
  1465.         SendClientMessage(playerid,COLOR_PURPLE,"_____________________________ {B1A2DA}PARTIDA{C2A2DA} ___________________________");
  1466.        
  1467.         format(wstring, sizeof(wstring), "Saúde: %.1f - Kills: %d - Deaths: %d - K/D: %0.02f",hp,kills,deaths,ratio);
  1468.         SendClientMessage(playerid,0xE6E6E6E6, wstring);
  1469.         format(wstring, sizeof(wstring), "Arma: %s - Colete: %.1f - Nível: %i",GetWeaponNameEx(GetPlayerWeapon(targetid)), armour, gPlayerData[targetid][E_PLAYER_LVL]);
  1470.         SendClientMessage(playerid,0xC8C8C8C8, wstring);
  1471.  
  1472.         SendClientMessage(playerid,COLOR_PURPLE, "_________________________________________________________________________________");
  1473.     }
  1474. }
  1475.  
  1476. /*-----------------------------------------------------------------------------*\
  1477.     Esta callback separa strings
  1478.    
  1479.     Param:
  1480.         - strsrc[]: Array que será dividida
  1481.         - strdest[]: Array que armazenara as strings
  1482.         - delimiter: Letra que dividirá
  1483. \*-----------------------------------------------------------------------------*/
  1484. public split(const strsrc[], strdest[][], delimiter)
  1485. {
  1486.     new i, li;
  1487.     new aNum;
  1488.     new len;
  1489.     while(i <= strlen(strsrc)){
  1490.         if(strsrc[i]==delimiter || i==strlen(strsrc)){
  1491.             len = strmid(strdest[aNum], strsrc, li, i, 128);
  1492.             strdest[aNum][len] = 0;
  1493.             li = i+1;
  1494.             aNum++;
  1495.         }
  1496.         i++;
  1497.     }
  1498.     return 1;
  1499. }
  1500.  
  1501. /*-----------------------------------------------------------------------------*\
  1502.     Esta callback é chamada a cada 1 segundo
  1503.    
  1504.     Param:
  1505.         -
  1506. \*-----------------------------------------------------------------------------*/
  1507. task OnClientUpdate[1000]()
  1508. {
  1509.     if(gGlobal[G_SECONDS] > 0) gGlobal[G_SECONDS]--;
  1510.     if(gGlobal[G_MINUTES] > 0 && gGlobal[G_SECONDS] == 0) { gGlobal[G_SECONDS] = 60; gGlobal[G_MINUTES]--; }
  1511.     if(gGlobal[G_MINUTES] == 8 && gGlobal[G_SECONDS] == 35 || gGlobal[G_MINUTES] == 5 && gGlobal[G_SECONDS] == 35 || gGlobal[G_MINUTES] == 2 && gGlobal[G_SECONDS] == 35) SendClientMessageToAll(0xBBEA00FF, "*** Você está jogando na versão {7CAB00}BETA{BBEA00} do {7CAB00}SA-MP PT Gun Game");
  1512.     if(gGlobal[G_MINUTES] == 0 && gGlobal[G_SECONDS] == 0)
  1513.     {
  1514.         switch(gGlobal[G_ROUND])
  1515.         {
  1516.             case 0:
  1517.             {
  1518.                 gGlobal[G_ROUND] = 1;
  1519.                 foreach(Player, i)
  1520.                 {
  1521.                     ResetPlayerWeapons(i);
  1522.                     if(gPlayerData[i][E_PLAYER_LOGGED]) SpawnPlayer(i);
  1523.                 }
  1524.                 SendClientMessageToAll(COLOR_YELLOW, "*** O {E5CE00}round {FFFF00}começou!");
  1525.                 gGlobal[G_MINUTES] = 9;
  1526.                 gGlobal[G_SECONDS] = 59;
  1527.             }
  1528.         }
  1529.     }
  1530.    
  1531.     new timestr[32];
  1532.     format(timestr,32,"%02d:%02d",gGlobal[G_MINUTES],gGlobal[G_SECONDS]);
  1533.     TextDrawSetString(timeDisplay,timestr);
  1534.    
  1535.     new
  1536.         aPoints,
  1537.         iPoints,
  1538.         zPoints,
  1539.         xPoints,
  1540.         hPoints;
  1541.  
  1542.     foreach(Player, i)
  1543.     {
  1544.         if(gPlayerData[i][E_PLAYER_LOGGED]) gPlayerData[i][E_PLAYER_PLAYEDHOURS]++;
  1545.         if(gPlayerData[i][E_PLAYER_LVL] > aPoints)
  1546.         {
  1547.             aPoints = gPlayerData[i][E_PLAYER_LVL];
  1548.             gScoreData[G_WINNER_ID] = i;
  1549.            
  1550.             if(i == gScoreData[G_SECOND_ID])
  1551.             {
  1552.                 foreach(Player, x)
  1553.                 {
  1554.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x)
  1555.                     {
  1556.                         gScoreData[G_SECOND_ID] = x;
  1557.                     }
  1558.                 }
  1559.             }
  1560.            
  1561.             if(i == gScoreData[G_THIRD_ID])
  1562.             {
  1563.                 foreach(Player, x)
  1564.                 {
  1565.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x && gScoreData[G_SECOND_ID] != x)
  1566.                     {
  1567.                         gScoreData[G_THIRD_ID] = x;
  1568.                     }
  1569.                 }
  1570.             }
  1571.            
  1572.             if(i == gScoreData[G_FOURTY_ID])
  1573.             {
  1574.                 foreach(Player, x)
  1575.                 {
  1576.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x && gScoreData[G_SECOND_ID] != x && gScoreData[G_THIRD_ID] != x)
  1577.                     {
  1578.                         gScoreData[G_FOURTY_ID] = x;
  1579.                     }
  1580.                 }
  1581.             }
  1582.            
  1583.             if(i == gScoreData[G_FIVE_ID])
  1584.             {
  1585.                 foreach(Player, x)
  1586.                 {
  1587.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x && gScoreData[G_SECOND_ID] != x && gScoreData[G_THIRD_ID] != x && gScoreData[G_FOURTY_ID] != x)
  1588.                     {
  1589.                         gScoreData[G_FIVE_ID] = x;
  1590.                     }
  1591.                 }
  1592.             }
  1593.         }
  1594.         else if(gPlayerData[i][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != i)
  1595.         {
  1596.             iPoints = gPlayerData[i][E_PLAYER_LVL];
  1597.             gScoreData[G_SECOND_ID] = i;
  1598.             if(i == gScoreData[G_THIRD_ID])
  1599.             {
  1600.                 foreach(Player, x)
  1601.                 {
  1602.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x && gScoreData[G_SECOND_ID] != x)
  1603.                     {
  1604.                         gScoreData[G_THIRD_ID] = x;
  1605.                     }
  1606.                 }
  1607.             }
  1608.            
  1609.             if(i == gScoreData[G_FOURTY_ID])
  1610.             {
  1611.                 foreach(Player, x)
  1612.                 {
  1613.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x && gScoreData[G_SECOND_ID] != x && gScoreData[G_THIRD_ID] != x)
  1614.                     {
  1615.                         gScoreData[G_FOURTY_ID] = x;
  1616.                     }
  1617.                 }
  1618.             }
  1619.            
  1620.             if(i == gScoreData[G_FIVE_ID])
  1621.             {
  1622.                 foreach(Player, x)
  1623.                 {
  1624.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x && gScoreData[G_SECOND_ID] != x && gScoreData[G_THIRD_ID] != x && gScoreData[G_FOURTY_ID] != x)
  1625.                     {
  1626.                         gScoreData[G_FIVE_ID] = x;
  1627.                     }
  1628.                 }
  1629.             }
  1630.         }
  1631.         else if(gPlayerData[i][E_PLAYER_LVL] > zPoints && gScoreData[G_WINNER_ID] != i && gScoreData[G_SECOND_ID] != i)
  1632.         {
  1633.             zPoints = gPlayerData[i][E_PLAYER_LVL];
  1634.             gScoreData[G_THIRD_ID] = i;
  1635.             if(i == gScoreData[G_FOURTY_ID])
  1636.             {
  1637.                 foreach(Player, x)
  1638.                 {
  1639.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x && gScoreData[G_SECOND_ID] != x && gScoreData[G_THIRD_ID] != x)
  1640.                     {
  1641.                         gScoreData[G_FOURTY_ID] = x;
  1642.                     }
  1643.                 }
  1644.             }
  1645.            
  1646.             if(i == gScoreData[G_FIVE_ID])
  1647.             {
  1648.                 foreach(Player, x)
  1649.                 {
  1650.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x&& gScoreData[G_SECOND_ID] != x && gScoreData[G_THIRD_ID] != x && gScoreData[G_FOURTY_ID] != x)
  1651.                     {
  1652.                         gScoreData[G_FIVE_ID] = x;
  1653.                     }
  1654.                 }
  1655.             }
  1656.         }
  1657.         else if(gPlayerData[i][E_PLAYER_LVL] > xPoints && gScoreData[G_WINNER_ID] != i && gScoreData[G_SECOND_ID] != i && gScoreData[G_THIRD_ID] != i)
  1658.         {
  1659.             xPoints = gPlayerData[i][E_PLAYER_LVL];
  1660.             gScoreData[G_FOURTY_ID] = i;
  1661.             if(i == gScoreData[G_FIVE_ID])
  1662.             {
  1663.                 foreach(Player, x)
  1664.                 {
  1665.                     if(gPlayerData[x][E_PLAYER_LVL] > iPoints && gScoreData[G_WINNER_ID] != x&& gScoreData[G_SECOND_ID] != x && gScoreData[G_THIRD_ID] != x && gScoreData[G_FOURTY_ID] != x)
  1666.                     {
  1667.                         gScoreData[G_FIVE_ID] = x;
  1668.                     }
  1669.                 }
  1670.             }
  1671.         }
  1672.         else if(gPlayerData[i][E_PLAYER_LVL] > hPoints && gScoreData[G_WINNER_ID] != i && gScoreData[G_SECOND_ID] != i && gScoreData[G_THIRD_ID] != i && gScoreData[G_FOURTY_ID] != i)
  1673.         {
  1674.             hPoints = gPlayerData[i][E_PLAYER_LVL];
  1675.             gScoreData[G_FIVE_ID] = i;
  1676.         }
  1677.        
  1678.         new nstr[32];
  1679.         format(nstr, sizeof(nstr), "~p~%02d", gPlayerData[gScoreData[G_WINNER_ID]][E_PLAYER_LVL] - gPlayerData[i][E_PLAYER_LVL]);
  1680.         TextDrawSetString(bhleadernum[i], nstr);
  1681.     }
  1682.  
  1683.     new myStr[110];
  1684.     format(myStr, sizeof(myStr), "%s~n~%s~n~%s~n~%s~n~%s",GetPlayerNameEx(gScoreData[G_WINNER_ID]),GetPlayerNameEx(gScoreData[G_SECOND_ID]),GetPlayerNameEx(gScoreData[G_THIRD_ID]),GetPlayerNameEx(gScoreData[G_FOURTY_ID]),GetPlayerNameEx(gScoreData[G_FIVE_ID]));
  1685.     TextDrawSetString(nametext, myStr);
  1686.  
  1687.     format(myStr, sizeof(myStr), "%d~n~%d~n~%d~n~%d~n~%d",gPlayerData[gScoreData[G_WINNER_ID]][E_PLAYER_KILLS],gPlayerData[gScoreData[G_SECOND_ID]][E_PLAYER_KILLS],gPlayerData[gScoreData[G_THIRD_ID]][E_PLAYER_KILLS],gPlayerData[gScoreData[G_FOURTY_ID]][E_PLAYER_KILLS],gPlayerData[gScoreData[G_FIVE_ID]][E_PLAYER_KILLS]);
  1688.     TextDrawSetString(killtext, myStr);
  1689.  
  1690.     format(myStr, sizeof(myStr), "%d~n~%d~n~%d~n~%d~n~%d",gPlayerData[gScoreData[G_WINNER_ID]][E_PLAYER_DEATHS],gPlayerData[gScoreData[G_SECOND_ID]][E_PLAYER_DEATHS],gPlayerData[gScoreData[G_THIRD_ID]][E_PLAYER_DEATHS],gPlayerData[gScoreData[G_FOURTY_ID]][E_PLAYER_DEATHS],gPlayerData[gScoreData[G_FIVE_ID]][E_PLAYER_DEATHS]);
  1691.     TextDrawSetString(deathtext, myStr);
  1692.  
  1693.     format(myStr, sizeof(myStr), "~p~%s", GetPlayerNameEx(gScoreData[G_WINNER_ID]));
  1694.     TextDrawSetString(currleadernam, myStr);
  1695. }
  1696.  
  1697. /*-----------------------------------------------------------------------------*\
  1698.     Esta callback é chamada quando um jogador morre e está spectando o matador
  1699.    
  1700.     Param:
  1701.         - playerid: ID do jogador que está spectando
  1702. \*-----------------------------------------------------------------------------*/
  1703. public D1(playerid)
  1704. {
  1705.     GameTextForPlayer(playerid,"~r~3",1000,4);
  1706.     SetTimerEx("D2", 1000, false,"d",playerid);
  1707.     PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  1708. }
  1709.  
  1710. /*-----------------------------------------------------------------------------*\
  1711.     Esta callback é chamada quando um jogador morre e está spectando o matador
  1712.    
  1713.     Param:
  1714.         - playerid: ID do jogador que está spectando
  1715. \*-----------------------------------------------------------------------------*/
  1716. public D2(playerid)
  1717. {
  1718.     GameTextForPlayer(playerid,"~y~2",1000,4);
  1719.     SetTimerEx("D3", 1000, false,"d",playerid);
  1720.     PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  1721. }
  1722.  
  1723. /*-----------------------------------------------------------------------------*\
  1724.     Esta callback é chamada quando um jogador morre e está spectando o matador
  1725.    
  1726.     Param:
  1727.         - playerid: ID do jogador que está spectando
  1728. \*-----------------------------------------------------------------------------*/
  1729. public D3(playerid)
  1730. {
  1731.     GameTextForPlayer(playerid,"~g~1",1000,4);
  1732.     SetTimerEx("DS", 1000, false,"d",playerid);
  1733.     PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  1734. }
  1735.  
  1736. /*-----------------------------------------------------------------------------*\
  1737.     Esta callback é chamada quando um jogador morre e está spectando o matador
  1738.    
  1739.     Param:
  1740.         - playerid: ID do jogador que está spectando
  1741. \*-----------------------------------------------------------------------------*/
  1742. public DS(playerid)
  1743. {
  1744.     TogglePlayerSpectating(playerid, 0);
  1745.     SpawnPlayer(playerid);
  1746.     PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  1747. }
  1748.  
  1749. /*-----------------------------------------------------------------------------*\
  1750.     Esta função faz log-in de um jogador
  1751.    
  1752.     Param:
  1753.         - playerid: O ID do jogador que terá a conta carregada
  1754. \*-----------------------------------------------------------------------------*/
  1755. OnPlayerLogin(playerid)
  1756. {
  1757.     // Make the filename.
  1758.     new
  1759.         playerName[MAX_PLAYER_NAME];
  1760.     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1761.     new
  1762.         userFile[32];
  1763.     format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  1764.     // Parse the file.
  1765.     INI_ParseFile(userFile, "load_user_data_%s", .bExtra = true, .extra = playerid);
  1766. }
  1767.  
  1768. /*-----------------------------------------------------------------------------*\
  1769.     Esta função salva os dados um jogador quando ele sair
  1770.    
  1771.     Param:
  1772.         - playerid: O ID do jogador que terá a conta salva
  1773. \*-----------------------------------------------------------------------------*/
  1774. public OnPlayerLogout(playerid)
  1775. {
  1776.     // Make the filename.
  1777.     new
  1778.         playerName[MAX_PLAYER_NAME];
  1779.     GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1780.     new
  1781.         userFile[32];
  1782.     format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  1783.     //Store the date.
  1784.     new
  1785.         pYear, pMonth, pDay, pHour, pMinute, pSecond, pDate[23];
  1786.  
  1787.     getdate(pYear, pMonth, pDay);
  1788.     gettime(pHour, pMinute, pSecond);
  1789.    
  1790.     format(pDate, sizeof pDate, "%02d:%02d:%02d  %02d/%02d/%02d",pHour, pMinute, pSecond , pDay, pMonth, pYear);
  1791.     // Open the file.
  1792.     new
  1793.         INI:file = INI_Open(userFile);
  1794.     // Set the tag.
  1795.     INI_SetTag(file, "gungame");
  1796.     // Write the data.
  1797.     INI_WriteFloat(file, "health", gPlayerData[playerid][E_PLAYER_HEALTH]);
  1798.     INI_WriteInt(file, "skinid", GetPlayerSkin(playerid));
  1799.     INI_WriteInt(file, "idade", gPlayerData[playerid][E_PLAYER_AGE]);
  1800.     INI_WriteInt(file, "sexo", gPlayerData[playerid][E_PLAYER_SEX]);
  1801.     INI_WriteString(file, "clan", gPlayerData[playerid][E_PLAYER_CLAN]);
  1802.     INI_WriteInt(file, "admin", gPlayerData[playerid][E_PLAYER_ADMIN]);
  1803.     INI_WriteInt(file, "kills", gPlayerData[playerid][E_PLAYER_GKILLS]);
  1804.     INI_WriteInt(file, "deaths", gPlayerData[playerid][E_PLAYER_GDEATHS]);
  1805.     INI_WriteString(file, "lastlogin", pDate);
  1806.     INI_WriteInt(file, "playedtime", gPlayerData[playerid][E_PLAYER_PLAYEDHOURS]);
  1807.     INI_WriteBool(file, "muted", gPlayerData[playerid][E_PLAYER_MUTED]);
  1808.     // Close the file.
  1809.     INI_Close(file);
  1810. }
  1811.  
  1812. /*-----------------------------------------------------------------------------*\
  1813.     Esta stock é usada para limpar o chat de algum jogador
  1814.    
  1815.     Param:
  1816.         - playerid: O ID do jogador que terá o chat limpo
  1817. \*-----------------------------------------------------------------------------*/
  1818. stock ClearScreen(playerid)
  1819. {
  1820.     for(new i = 0; i < 100; i++){SendClientMessage(playerid, -1, " ");}
  1821.     return 0;
  1822. }
  1823.  
  1824. /*-----------------------------------------------------------------------------*\
  1825.     Esta stock é usada para checar se é o aniversário de algum jogador
  1826.    
  1827.     Param:
  1828.         - playerid: O ID do jogador que será checado
  1829.         - userFile: Arquivo do jogador.
  1830. \*-----------------------------------------------------------------------------*/
  1831. stock CheckBirthDay(playerid, userFile[])
  1832. {
  1833.     if(gPlayerData[playerid][E_PLAYER_REG] == 255)
  1834.     {
  1835.         INI_ParseFile(userFile, "load_user_birth_day", .bExtra = true, .extra = playerid);
  1836.         new year, month, day, DateInfo[3][20], str[24], strr[24];
  1837.         getdate(year, month, day);
  1838.         split(gPlayerData[playerid][E_PLAYER_BIRTH], DateInfo, '/');
  1839.         format(str, 24, "%s/%s", DateInfo[0], DateInfo[1]);
  1840.         format(strr, 24, "%02d/%02d", day, month);
  1841.         if(strcmp(strr, str, true) == 0){SendClientMessage(playerid, 0x00B6FFFF, "*** Parabéns!! O {0087FA}SA-MP GunGame{00B6FF} lhe deseja um feliz aniversário.");}
  1842.     }
  1843.     return 1;
  1844. }
  1845.  
  1846. /*-----------------------------------------------------------------------------*\
  1847.     Esta stock é usada para resetar variaveis do ranking
  1848.    
  1849.     Param:
  1850.         -
  1851. \*-----------------------------------------------------------------------------*/
  1852. stock ResetNonePlayer()
  1853. {
  1854.     gScoreData[G_WINNER_ID] = MAX_PLAYERS-1;
  1855.     gScoreData[G_SECOND_ID] = MAX_PLAYERS-1;
  1856.     gScoreData[G_THIRD_ID] = MAX_PLAYERS-1;
  1857.     gScoreData[G_FOURTY_ID] = MAX_PLAYERS-1;
  1858.     gScoreData[G_FIVE_ID] = MAX_PLAYERS-1;
  1859.     gPlayerData[MAX_PLAYERS-1][E_PLAYER_KILLS] = -1;
  1860.     gPlayerData[MAX_PLAYERS-1][E_PLAYER_DEATHS] = -1;
  1861.     gPlayerData[MAX_PLAYERS-1][E_PLAYER_NXTLVL] = 5;
  1862.     gPlayerData[MAX_PLAYERS-1][E_PLAYER_LVL] = -1;
  1863. }
  1864.  
  1865. /*-----------------------------------------------------------------------------*\
  1866.     Esta stock é usada para dar a arma ao jogador de acordo com o nível dele
  1867.    
  1868.     Param:
  1869.         - playerid: O ID do jogador que receberá a arma
  1870. \*-----------------------------------------------------------------------------*/
  1871. stock GiveWeaponLevel(playerid)
  1872. {
  1873.     switch(gPlayerData[playerid][E_PLAYER_LVL])
  1874.     {
  1875.         case 0, 1:
  1876.         {
  1877.             GivePlayerWeapon(playerid, 23, 99999);
  1878.             GivePlayerWeapon(playerid, 4, 99999);
  1879.         }
  1880.         case 2:
  1881.         {
  1882.             GivePlayerWeapon(playerid, 22, 99999);
  1883.             GivePlayerWeapon(playerid, 4, 99999);
  1884.         }
  1885.         case 3:
  1886.         {
  1887.             GivePlayerWeapon(playerid, 24, 99999);
  1888.             GivePlayerWeapon(playerid, 4, 99999);
  1889.         }
  1890.         case 4:
  1891.         {
  1892.             GivePlayerWeapon(playerid, 22, 99999);
  1893.             GivePlayerWeapon(playerid, 4, 99999);
  1894.         }
  1895.         case 5:
  1896.         {
  1897.             GivePlayerWeapon(playerid, 25, 99999);
  1898.             GivePlayerWeapon(playerid, 4, 99999);
  1899.         }
  1900.         case 6:
  1901.         {
  1902.             GivePlayerWeapon(playerid, 26, 99999);
  1903.             GivePlayerWeapon(playerid, 4, 99999);
  1904.         }
  1905.         case 7:
  1906.         {
  1907.             GivePlayerWeapon(playerid, 27, 99999);
  1908.             GivePlayerWeapon(playerid, 4, 99999);
  1909.         }
  1910.         case 8:
  1911.         {
  1912.             GivePlayerWeapon(playerid, 28, 99999);
  1913.             GivePlayerWeapon(playerid, 4, 99999);
  1914.         }
  1915.         case 9:
  1916.         {
  1917.             GivePlayerWeapon(playerid, 32, 99999);
  1918.             GivePlayerWeapon(playerid, 4, 99999);
  1919.         }
  1920.         case 10:
  1921.         {
  1922.             GivePlayerWeapon(playerid, 29, 99999);
  1923.             GivePlayerWeapon(playerid, 4, 99999);
  1924.         }
  1925.         case 11:
  1926.         {
  1927.             GivePlayerWeapon(playerid, 30, 99999);
  1928.             GivePlayerWeapon(playerid, 4, 99999);
  1929.         }
  1930.         case 12:
  1931.         {
  1932.             GivePlayerWeapon(playerid, 31, 99999);
  1933.             GivePlayerWeapon(playerid, 4, 99999);
  1934.         }
  1935.         case 13:
  1936.         {
  1937.             GivePlayerWeapon(playerid, 33, 99999);
  1938.             GivePlayerWeapon(playerid, 4, 99999);
  1939.         }
  1940.         case 14:
  1941.         {
  1942.             GivePlayerWeapon(playerid, 34, 99999);
  1943.             GivePlayerWeapon(playerid, 4, 99999);
  1944.         }
  1945.         case 15:
  1946.         {
  1947.             GivePlayerWeapon(playerid, 35, 99999);
  1948.             GivePlayerWeapon(playerid, 4, 99999);
  1949.         }
  1950.         case 16:
  1951.         {
  1952.             GivePlayerWeapon(playerid, 38, 99999);
  1953.             GivePlayerWeapon(playerid, 4, 99999);
  1954.         }
  1955.         case 17:
  1956.         {
  1957.             GivePlayerWeapon(playerid, 16, 99999);
  1958.             GivePlayerWeapon(playerid, 4, 99999);
  1959.         }
  1960.         case 18:
  1961.         {
  1962.             GivePlayerWeapon(playerid, 4, 99999);
  1963.         }
  1964.         case 92:
  1965.         {
  1966.             GivePlayerWeapon(playerid, 4, 99999);
  1967.         }
  1968.     }
  1969. }
  1970. /*-----------------------------------------------------------------------------*\
  1971.     Esta stock é usada para checar a arma que será dada a algum jogador
  1972.    
  1973.     Param:
  1974.         - playerid: O ID do jogador que receberá a arma
  1975. \*-----------------------------------------------------------------------------*/
  1976. stock CheckWeaponLevel(playerid)
  1977. {
  1978.     if(gPlayerData[playerid][E_PLAYER_NXTLVL] < 1)
  1979.     {
  1980.         switch(gPlayerData[playerid][E_PLAYER_LVL])
  1981.         {
  1982.             case 1:
  1983.             {
  1984.                 ResetPlayerWeapons(playerid);
  1985.                 GivePlayerWeapon(playerid, 23, 99999);
  1986.                 GivePlayerWeapon(playerid, 4, 99999);
  1987.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  1988.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 2;
  1989.             }
  1990.             case 2:
  1991.             {
  1992.                 ResetPlayerWeapons(playerid);
  1993.                 SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 0);
  1994.                 GivePlayerWeapon(playerid, 22, 99999);
  1995.                 GivePlayerWeapon(playerid, 4, 99999);
  1996.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  1997.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 2;
  1998.             }
  1999.             case 3:
  2000.             {
  2001.                 ResetPlayerWeapons(playerid);
  2002.                 GivePlayerWeapon(playerid, 24, 99999);
  2003.                 GivePlayerWeapon(playerid, 4, 99999);
  2004.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2005.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 5;
  2006.             }
  2007.             case 4:
  2008.             {
  2009.                 ResetPlayerWeapons(playerid);
  2010.                 SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 999);
  2011.                 GivePlayerWeapon(playerid, 22, 99999);
  2012.                 GivePlayerWeapon(playerid, 4, 99999);
  2013.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2014.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 7;
  2015.             }
  2016.             case 5:
  2017.             {
  2018.                 ResetPlayerWeapons(playerid);
  2019.                 GivePlayerWeapon(playerid, 25, 99999);
  2020.                 GivePlayerWeapon(playerid, 4, 99999);
  2021.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2022.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 4;
  2023.             }
  2024.             case 6:
  2025.             {
  2026.                 ResetPlayerWeapons(playerid);
  2027.                 GivePlayerWeapon(playerid, 26, 99999);
  2028.                 GivePlayerWeapon(playerid, 4, 99999);
  2029.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2030.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 7;
  2031.             }
  2032.             case 7:
  2033.             {
  2034.                 ResetPlayerWeapons(playerid);
  2035.                 GivePlayerWeapon(playerid, 27, 99999);
  2036.                 GivePlayerWeapon(playerid, 4, 99999);
  2037.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2038.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 7;
  2039.             }
  2040.             case 8:
  2041.             {
  2042.                 ResetPlayerWeapons(playerid);
  2043.                 GivePlayerWeapon(playerid, 28, 99999);
  2044.                 GivePlayerWeapon(playerid, 4, 99999);
  2045.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2046.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 3;
  2047.             }
  2048.             case 9:
  2049.             {
  2050.                 ResetPlayerWeapons(playerid);
  2051.                 GivePlayerWeapon(playerid, 32, 99999);
  2052.                 GivePlayerWeapon(playerid, 4, 99999);
  2053.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2054.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 4;
  2055.             }
  2056.             case 10:
  2057.             {
  2058.                 ResetPlayerWeapons(playerid);
  2059.                 GivePlayerWeapon(playerid, 29, 99999);
  2060.                 GivePlayerWeapon(playerid, 4, 99999);
  2061.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2062.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 6;
  2063.             }
  2064.             case 11:
  2065.             {
  2066.                 ResetPlayerWeapons(playerid);
  2067.                 GivePlayerWeapon(playerid, 30, 99999);
  2068.                 GivePlayerWeapon(playerid, 4, 99999);
  2069.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2070.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 7;
  2071.             }
  2072.             case 12:
  2073.             {
  2074.                 ResetPlayerWeapons(playerid);
  2075.                 GivePlayerWeapon(playerid, 31, 99999);
  2076.                 GivePlayerWeapon(playerid, 4, 99999);
  2077.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2078.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 7;
  2079.             }
  2080.             case 13:
  2081.             {
  2082.                 ResetPlayerWeapons(playerid);
  2083.                 GivePlayerWeapon(playerid, 33, 99999);
  2084.                 GivePlayerWeapon(playerid, 4, 99999);
  2085.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2086.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 4;
  2087.             }
  2088.             case 14:
  2089.             {
  2090.                 ResetPlayerWeapons(playerid);
  2091.                 GivePlayerWeapon(playerid, 34, 99999);
  2092.                 GivePlayerWeapon(playerid, 4, 99999);
  2093.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2094.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 2;
  2095.             }
  2096.             case 15:
  2097.             {
  2098.                 ResetPlayerWeapons(playerid);
  2099.                 GivePlayerWeapon(playerid, 35, 99999);
  2100.                 GivePlayerWeapon(playerid, 4, 99999);
  2101.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2102.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 9;
  2103.             }
  2104.             case 16:
  2105.             {
  2106.                 ResetPlayerWeapons(playerid);
  2107.                 GivePlayerWeapon(playerid, 38, 99999);
  2108.                 GivePlayerWeapon(playerid, 4, 99999);
  2109.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2110.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 10;
  2111.             }
  2112.             case 17:
  2113.             {
  2114.                 ResetPlayerWeapons(playerid);
  2115.                 GivePlayerWeapon(playerid, 16, 99999);
  2116.                 GivePlayerWeapon(playerid, 4, 99999);
  2117.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2118.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 5;
  2119.             }
  2120.             case 18:
  2121.             {
  2122.                 ResetPlayerWeapons(playerid);
  2123.                 GivePlayerWeapon(playerid, 4, 99999);
  2124.                 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2125.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 1;
  2126.             }
  2127.             case 19:
  2128.             {
  2129.                 SendClientMessageFormattedToAll(COLOR_YELLOW, "%s venceu o GunGame!", GetPlayerNameEx(playerid));
  2130.                 PlayerPlaySound(playerid,1057, 0.0, 0.0, 0.0);
  2131.                 gPlayerData[playerid][E_PLAYER_NXTLVL] = 0;
  2132.             }
  2133.             default: {  ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 23, 99999); GivePlayerWeapon(playerid, 4, 99999); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0); gPlayerData[playerid][E_PLAYER_LVL] = 1; gPlayerData[playerid][E_PLAYER_NXTLVL] = 2;}
  2134.         }
  2135.     }
  2136. }
  2137.  
  2138. /*-----------------------------------------------------------------------------*\
  2139.     Esta stock é usada para enviar mensagem a algum jogador
  2140.    
  2141.     Param:
  2142.         - playerid: O ID do jogador que receberá a mensagem
  2143.         - colour: A cor em HEX que a mensagem será enviada
  2144.         - format: A mensagem que será enviada
  2145.         - va_args<>: Os argumentos que serão enviados
  2146. \*-----------------------------------------------------------------------------*/
  2147. stock SendClientMessageFormatted(playerid, colour, format[], va_args<>)
  2148. {
  2149.     new
  2150.         out[128]
  2151.     ;
  2152.     va_format(out, sizeof(out), format, va_start<3>);
  2153.     SendClientMessage(playerid, colour, out);
  2154. }
  2155.  
  2156. /*-----------------------------------------------------------------------------*\
  2157.     Esta stock é usada para enviar mensagem a todos os jogadores
  2158.    
  2159.     Param:
  2160.         - colour: A cor em HEX que a mensagem será enviada
  2161.         - format: A mensagem que será enviada
  2162.         - va_args<>: Os argumentos que serão enviados
  2163. \*-----------------------------------------------------------------------------*/
  2164. stock SendClientMessageFormattedToAll(colour, format[], va_args<>)
  2165. {
  2166.     new
  2167.         out[128]
  2168.     ;
  2169.     va_format(out, sizeof(out), format, va_start<2>);
  2170.     SendClientMessageToAll(colour, out);
  2171. }
  2172.  
  2173. /*-----------------------------------------------------------------------------*\
  2174.     Esta stock é usada para retornar o ratio do jogador diretamente
  2175.    
  2176.     Param:
  2177.         - playerid: O ID do jogador que obteremos o ratio
  2178. \*-----------------------------------------------------------------------------*/
  2179. stock GetPlayerRatio(playerid)
  2180.     return floatdiv(gPlayerData[playerid][E_PLAYER_KILLS], gPlayerData[playerid][E_PLAYER_DEATHS]);
  2181.  
  2182. /*-----------------------------------------------------------------------------*\
  2183.     Esta stock é usada para retornar o IP do jogador diretamente
  2184.    
  2185.     Param:
  2186.         - playerid: O ID do jogador que obteremos o IP
  2187. \*-----------------------------------------------------------------------------*/
  2188. stock GetPlayerIpEx(playerid)
  2189. {
  2190.     new string[18];
  2191.     GetPlayerIp(playerid, string, sizeof(string));
  2192.     return string;
  2193. }
  2194.  
  2195. /*-----------------------------------------------------------------------------*\
  2196.     Esta stock é usada para retornar o nome do jogador diretamente
  2197.    
  2198.     Param:
  2199.         - playerid: O ID do jogador que obteremos o nome
  2200. \*-----------------------------------------------------------------------------*/
  2201. stock GetPlayerNameEx(playerid)
  2202. {
  2203.     new string[MAX_PLAYER_NAME];
  2204.     GetPlayerName(playerid,string,MAX_PLAYER_NAME);
  2205.     if(playerid == MAX_PLAYERS-1 || !IsPlayerConnected(playerid)) string = "Ninguem";
  2206.     return string;
  2207. }
  2208.  
  2209. /*-----------------------------------------------------------------------------*\
  2210.     Esta stock é usada para retornar o nome da arma diretamente
  2211.    
  2212.     Param:
  2213.         - weaponid: O ID da arma que obteremos o nome
  2214. \*-----------------------------------------------------------------------------*/
  2215. stock GetWeaponNameEx(weaponid)
  2216. {  
  2217.     new string[24];
  2218.     GetWeaponName(weaponid, string, sizeof(string));
  2219.     if(isnull(string)) string = "Nenhuma";
  2220.     return string;
  2221. }
  2222.  
  2223. /*-----------------------------------------------------------------------------*\
  2224.     Esta stock é usada para enviar mensagens para administradores
  2225.    
  2226.     Param:
  2227.         - color: A cor em HEX da mensagem a ser enviada
  2228.         - const string[]: A mensagem a ser enviada.
  2229.         - level: O nível minimo do administrador que verá a mensagem
  2230. \*-----------------------------------------------------------------------------*/
  2231. stock AdministratorMessage(color, const string[], level)
  2232. {
  2233.     foreach(Player, i){if(gPlayerData[i][E_PLAYER_ADMIN] >= level){SendClientMessage(i, color, string);}}
  2234.     return 1;
  2235. }
  2236.  
  2237. /*-----------------------------------------------------------------------------*\
  2238.     Este comando é usado para mostrar seu stats
  2239.    
  2240.     Param:
  2241.         - playerid: O ID do jogador que utilizou o comando
  2242. \*-----------------------------------------------------------------------------*/
  2243. YCMD:stats(playerid, params[], help)
  2244. {
  2245.     #pragma unused params
  2246.     if (help)
  2247.     {
  2248.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra seu stats.");
  2249.     }
  2250.     else
  2251.     {
  2252.         ShowPlayerStats(playerid,playerid);
  2253.     }
  2254.     return 1;
  2255. }
  2256.  
  2257. /*-----------------------------------------------------------------------------*\
  2258.     Este comando é usado para mostrar o stats de algum jogador
  2259.    
  2260.     Param:
  2261.         - playerid: O ID do jogador que utilizou o comando
  2262.         - iTarget: O ID do jogador que será mostrado o stats
  2263. \*-----------------------------------------------------------------------------*/
  2264. YCMD:pstats(playerid, params[], help)
  2265. {
  2266.     #pragma unused params
  2267.     if (help)
  2268.     {
  2269.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra o stats de algum jogador.");
  2270.     }
  2271.     else
  2272.     {
  2273.         new
  2274.             iTarget;
  2275.  
  2276.         if(sscanf(params, "u", iTarget))
  2277.             return SendClientMessage(playerid, COLOR_SAMP, "*** /pstats [playerid]");
  2278.  
  2279.         ShowPlayerStats(playerid, iTarget);
  2280.     }
  2281.     return 1;
  2282. }
  2283.  
  2284. /*-----------------------------------------------------------------------------*\
  2285.     Este comando é usado para alterar sua skin
  2286.    
  2287.     Param:
  2288.         - playerid: O ID do jogador que utilizou o comando
  2289.         - params: O ID da skin selecionada pelo jogador
  2290. \*-----------------------------------------------------------------------------*/
  2291. YCMD:skin(playerid, params[], help)
  2292. {
  2293.     if (help)
  2294.     {
  2295.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera sua skin.");
  2296.     }
  2297.     else
  2298.     {
  2299.         if(isnull(params))
  2300.             return SendClientMessage(playerid, COLOR_SAMP, "*** /skin [skinid]");
  2301.  
  2302.         SendClientMessage(playerid, 0x78C100FF, "*** Sua skin foi alterada.");
  2303.         SetPlayerSkin(playerid, strval(params));
  2304.         gPlayerData[playerid][E_PLAYER_SKIN] = strval(params);
  2305.     }
  2306.     return 1;
  2307. }
  2308.  
  2309. /*-----------------------------------------------------------------------------*\
  2310.     Este comando é usado para mostrar todos os comandos
  2311.    
  2312.     Param:
  2313.         - playerid: O ID do jogador que utilizou o comando
  2314. \*-----------------------------------------------------------------------------*/
  2315. YCMD:comandos(playerid, params[], help)
  2316. {
  2317.     #pragma unused params
  2318.     if (help)
  2319.     {
  2320.         SendClientMessage(playerid, 0xFF0000AA, "*** Lista com todos os comandos.");
  2321.     }
  2322.     else
  2323.     {
  2324.         new
  2325.             count = Command_GetPlayerCommandCount(playerid);
  2326.         for (new i = 0; i != count; ++i)
  2327.         {
  2328.             SendClientMessage(playerid, 0xFF0000AA, Command_GetNext(i, playerid));
  2329.         }
  2330.     }
  2331.     return 1;
  2332. }
  2333.  
  2334. /*-----------------------------------------------------------------------------*\
  2335.     Este comando é usado para mostrar todos os comandos
  2336.    
  2337.     Param:
  2338.         - playerid: O ID do jogador que utilizou o comando
  2339. \*-----------------------------------------------------------------------------*/
  2340. YCMD:ajudacmd(playerid, params[], help)
  2341. {
  2342.     if (help)
  2343.     {
  2344.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra ajuda sobre um comando.");
  2345.     }
  2346.     else
  2347.     {
  2348.         if (isnull(params))
  2349.         {
  2350.             new
  2351.                 str[128];
  2352.             SendClientMessage(playerid, COLOR_SAMP, "Bem-vindo ao ajuda.");
  2353.             format(str, sizeof (str), "Digite \"/%s [comando]\" para obter ajuda sobre um comando.", Command_GetDisplayNamed("ajudacmd", playerid));
  2354.             SendClientMessage(playerid, COLOR_WHITE, str);
  2355.         }
  2356.         else
  2357.         {
  2358.             Command_ReProcess(playerid, params, true);
  2359.         }
  2360.     }
  2361.     return 1;
  2362. }
  2363.  
  2364. /*-----------------------------------------------------------------------------*\
  2365.     Este comando é usado para mostrar ajuda sobre o modo de jogo
  2366.    
  2367.     Param:
  2368.         - playerid: O ID do jogador que utilizou o comando
  2369. \*-----------------------------------------------------------------------------*/
  2370. YCMD:ajuda(playerid, params[], help)
  2371. {
  2372.     #pragma unused params
  2373.     if (help)
  2374.     {
  2375.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra ajuda sobre o modo de jogo.");
  2376.     }
  2377.     else
  2378.     {
  2379.         SendClientMessage(playerid, 0x00B6FFFF, "____________________ Ajuda ____________________");
  2380.         SendClientMessage(playerid, 0x0087FAFF, "Um gamemode com o objetivo de matar os outros competidores, a cada quantia...");
  2381.         SendClientMessage(playerid, 0x0087FAFF, "...de jogadores mortos você recebe uma nova arma.");
  2382.         SendClientMessage(playerid, 0x0087FAFF, "No inicio do round todos usam apenas a faca para matar seus adversários por um minuto, após isso...");
  2383.         SendClientMessage(playerid, 0x0087FAFF, "...recebem suas armas para começar o verdadeiro combate.");
  2384.         SendClientMessage(playerid, 0x0087FAFF, " O jogo acaba quando alguém chegar até a ultima arma que é a faca novamente e matar um oponente.");
  2385.         SendClientMessage(playerid, 0x00B6FFFF, "_________________________________________________");
  2386.         SendClientMessage(playerid, 0x0087FAFF, "*** /cmds para visualizar os comandos disponíveis.");
  2387.         SendClientMessage(playerid, 0x00B6FFFF, "_________________________________________________");
  2388.     }
  2389.     return 1;
  2390. }
  2391.  
  2392. /*-----------------------------------------------------------------------------*\
  2393.     Este comando é usado para mostrar os comandos do modo de jogo
  2394.    
  2395.     Param:
  2396.         - playerid: O ID do jogador que utilizou o comando
  2397. \*-----------------------------------------------------------------------------*/
  2398. YCMD:cmds(playerid, params[], help)
  2399. {
  2400.     #pragma unused params
  2401.     if (help)
  2402.     {
  2403.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra ajuda sobre o modo de jogo.");
  2404.     }
  2405.     else
  2406.     {
  2407.         SendClientMessage(playerid, 0x00B6FFFF, "____________________ {0087FA}Comandos Gerais{00B6FF} ____________________");
  2408.         SendClientMessage(playerid, 0xE6E6E6E6, "/ajuda - /ajudacmd - /comandos - /skin - /stats - /pstats - /admins - /creditos - /acmds");
  2409.         SendClientMessage(playerid, 0xC8C8C8C8, "/mudarsenha - /mudaremail - /relatorio - /calcular - /calcularkd - /pm");
  2410.         SendClientMessage(playerid, 0x00B6FFFF, "________________________________________________________");
  2411.     }
  2412.     return 1;
  2413. }
  2414.  
  2415. /*-----------------------------------------------------------------------------*\
  2416.     Este comando é usado para mostrar os creditos do gamemode
  2417.    
  2418.     Param:
  2419.         - playerid: O ID do jogador que utilizou o comando
  2420. \*-----------------------------------------------------------------------------*/
  2421. YCMD:creditos(playerid, params[], help)
  2422. {
  2423.     #pragma unused params
  2424.     if (help)
  2425.     {
  2426.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra os creditos do gamemode.");
  2427.     }
  2428.     else
  2429.     {
  2430.         ShowPlayerDialog(playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, "Informações do Gamemode", "{0087FA}GunGame SA-MP {0000FF}PT {FFFFFF}v1.0.0 BETA 1\n\n{A9C4E4}Criado por {FFFFFF}Synchr0\n                     Los\n\n{A9C4E4}Obrigado a: {FFFFFF}Y_Less\nPabloBorsellino\n\n{A9C4E4}Testers: {FFFFFF}-\n\n{A9C4E4}© Copyright 2012 - GunGame SA-MP PT™", "Fechar", "");
  2431.     }
  2432.     return 1;
  2433. }
  2434.  
  2435. /*-----------------------------------------------------------------------------*\
  2436.     Este comando é usado para mostrar os administradores online
  2437.    
  2438.     Param:
  2439.         - playerid: O ID do jogador que utilizou o comando
  2440. \*-----------------------------------------------------------------------------*/
  2441. YCMD:admins(playerid, params[], help)
  2442. {
  2443.     #pragma unused params
  2444.     if (help)
  2445.     {
  2446.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra os admins online.");
  2447.     }
  2448.     else
  2449.     {
  2450.         new count = 0;
  2451.         new string[50];
  2452.         SendClientMessage(playerid, COLOR_LIGHTRED, "|_________ {930000}Admins Online{FF6347} _________|");
  2453.         foreach(Player, i)
  2454.         {
  2455.             if(gPlayerData[i][E_PLAYER_ADMIN] >= 1 && gPlayerData[i][E_PLAYER_ADMIN] <= 20)
  2456.             {
  2457.                 format(string, 50, "Administrador: {930000}%s", GetPlayerNameEx(i));
  2458.                 SendClientMessage(playerid, COLOR_LIGHTRED, string);
  2459.                 count++;
  2460.             }
  2461.         }
  2462.         if(count == 0) SendClientMessage(playerid, COLOR_GREY, "*** Atualmente não há administradores online.");
  2463.         SendClientMessage(playerid, COLOR_LIGHTRED, "_______________________________________________________________");
  2464.     }
  2465.     return 1;
  2466. }
  2467.  
  2468. /*-----------------------------------------------------------------------------*\
  2469.     Este comando é usado para mostrar os administrativos comandos do modo de jogo
  2470.    
  2471.     Param:
  2472.         - playerid: O ID do jogador que utilizou o comando
  2473. \*-----------------------------------------------------------------------------*/
  2474. YCMD:acmds(playerid, params[], help)
  2475. {
  2476.     #pragma unused params
  2477.     if (help)
  2478.     {
  2479.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra admin ajuda sobre o modo de jogo.");
  2480.     }
  2481.     else
  2482.     {
  2483.         SendClientMessage(playerid, 0x00B6FFFF, "_____________________________ Admin Commands ______________________________");
  2484.         if(gPlayerData[playerid][E_PLAYER_ADMIN] > 0) SendClientMessage(playerid, 0xE6E6E6E6, "/kick - /ban - /ir - /puxar - /sethp - /setarmour - /say - /congelar - /descongelar - /limparchat");
  2485.         if(gPlayerData[playerid][E_PLAYER_ADMIN] > 0) SendClientMessage(playerid, 0xE6E6E6E6, "/a - /slap - /dararma - /hpall - /armourall - /calar");
  2486.         if(gPlayerData[playerid][E_PLAYER_ADMIN] > 9) SendClientMessage(playerid, 0xC8C8C8C8, "/setstat - /mudarnome - /pinfo");
  2487.         if(IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xAAAAAAAA, "/setadmin");
  2488.         SendClientMessage(playerid, 0x00B6FFFF, "____________________________________________________________________________");
  2489.     }
  2490.     return 1;
  2491. }
  2492.  
  2493. /*-----------------------------------------------------------------------------*\
  2494.     Este comando é usado para limpar o chat
  2495.    
  2496.     Param:
  2497.         - playerid: O ID do jogador que utilizou o comando
  2498. \*-----------------------------------------------------------------------------*/
  2499. YCMD:limparchat(playerid, params[], help)
  2500. {
  2501.     #pragma unused params
  2502.     if (help)
  2503.     {
  2504.         SendClientMessage(playerid, 0xFF0000AA, "*** Limpa o chat.");
  2505.     }
  2506.     else
  2507.     {
  2508.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  2509.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  2510.  
  2511.         foreach(Player, i){ClearScreen(i);}
  2512.     }
  2513.     return 1;
  2514. }
  2515.  
  2516. /*-----------------------------------------------------------------------------*\
  2517.     Este comando é usado para enviar uma mensagem destacada para todos
  2518.    
  2519.     Param:
  2520.         - playerid: O ID do jogador que utilizou o comando
  2521.         - zMessage: A mensagem que será enviada
  2522. \*-----------------------------------------------------------------------------*/
  2523. YCMD:dararma(playerid, params[], help)
  2524. {
  2525.     if (help)
  2526.     {
  2527.         SendClientMessage(playerid, 0xFF0000AA, "*** Da arma a um jogador.");
  2528.     }
  2529.     else
  2530.     {
  2531.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  2532.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  2533.  
  2534.         new
  2535.             iTarget,
  2536.             iWeaponid,
  2537.             iAmmo;
  2538.  
  2539.         if(sscanf(params, "uii", iTarget, iWeaponid, iAmmo))
  2540.             return SendClientMessage(playerid, COLOR_SAMP, "*** /dararma [playerid] [arma] [munição]");
  2541.            
  2542.         if(iWeaponid < 1 || iWeaponid > 47)
  2543.             return SendClientMessage(playerid, COLOR_GREY, "*** Arma inválida, valores entre 1 - 47.");
  2544.        
  2545.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você deu uma {930000}%s{FF6347} com {930000}%i{FF6347} balas para {930000}%s{FF6347}.", GetWeaponNameEx(iWeaponid), iAmmo, GetPlayerNameEx(iTarget));
  2546.         SendClientMessageFormatted(iTarget, COLOR_LIGHTRED, "*** {930000}%s{FF6347} deu uma {930000}%s{FF6347} com {930000}%i{FF6347} balas para você.", GetPlayerNameEx(playerid), GetWeaponNameEx(iWeaponid), iAmmo);
  2547.  
  2548.         GivePlayerWeapon(iTarget, iWeaponid, iAmmo);
  2549.     }
  2550.     return 1;
  2551. }
  2552.  
  2553. /*-----------------------------------------------------------------------------*\
  2554.     Este comando é usado para dar um slap em um jogador
  2555.    
  2556.     Param:
  2557.         - playerid: O ID do jogador que utilizou o comando
  2558.         - iTarget: ID do jogador que será slapado.
  2559. \*-----------------------------------------------------------------------------*/
  2560. YCMD:slap(playerid, params[], help)
  2561. {
  2562.     if (help)
  2563.     {
  2564.         SendClientMessage(playerid, 0xFF0000AA, "*** Da slap em um jogador.");
  2565.     }
  2566.     else
  2567.     {
  2568.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  2569.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  2570.  
  2571.         new
  2572.             iTarget;
  2573.  
  2574.         if(sscanf(params, "u", iTarget))
  2575.             return SendClientMessage(playerid, COLOR_SAMP, "*** /slap [playerid]");
  2576.            
  2577.         if(!IsPlayerConnected(iTarget))
  2578.             return SendClientMessage(playerid, COLOR_GREY, "*** Jogador não conectado.");
  2579.        
  2580.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você deu slap em {930000}%s{FF6347}.", GetPlayerNameEx(iTarget));
  2581.  
  2582.         new
  2583.             Float:slx,
  2584.             Float:sly,
  2585.             Float:slz,
  2586.             Float:shealth;
  2587.  
  2588.         GetPlayerHealth(iTarget, shealth);
  2589.         SetPlayerHealth(iTarget, shealth-5);
  2590.         GetPlayerPos(iTarget, slx, sly, slz);
  2591.         SetPlayerPos(iTarget, slx, sly, slz+5);
  2592.         PlayerPlaySound(iTarget, 1130, 0, 0, 0);
  2593.     }
  2594.     return 1;
  2595. }
  2596.  
  2597. /*-----------------------------------------------------------------------------*\
  2598.     Este comando é usado para obter as informações de um jogador
  2599.    
  2600.     Param:
  2601.         - playerid: O ID do jogador que utilizou o comando
  2602.         - iTarget: ID do jogador que mostrará o IP
  2603. \*-----------------------------------------------------------------------------*/
  2604. YCMD:pinfo(playerid, params[], help)
  2605. {
  2606.     if (help)
  2607.     {
  2608.         SendClientMessage(playerid, 0xFF0000AA, "*** Mostra as informações de um jogador.");
  2609.     }
  2610.     else
  2611.     {
  2612.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 9)
  2613.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não tem permissão.");
  2614.  
  2615.         new
  2616.             iTarget;
  2617.  
  2618.         if(sscanf(params, "u", iTarget))
  2619.             return SendClientMessage(playerid, COLOR_SAMP, "*** /pinfo [playerid]");
  2620.            
  2621.         if(!IsPlayerConnected(iTarget))
  2622.             return SendClientMessage(playerid, COLOR_GREY, "*** Jogador não conectado.");
  2623.        
  2624.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "{930000}%s{FF6347}(ID:{930000}%i{FF6347}) - Ping: {930000}%i{FF6347} - IP: {930000}%s{FF6347}", GetPlayerNameEx(iTarget), iTarget, GetPlayerPing(iTarget), GetPlayerIpEx(iTarget));
  2625.     }
  2626.     return 1;
  2627. }
  2628.  
  2629. /*-----------------------------------------------------------------------------*\
  2630.     Este comando é usado para calar um jogador
  2631.    
  2632.     Param:
  2633.         - playerid: O ID do jogador que utilizou o comando
  2634.         - iTarget: ID do jogador que será silenciado
  2635. \*-----------------------------------------------------------------------------*/
  2636. YCMD:calar(playerid, params[], help)
  2637. {
  2638.     if (help)
  2639.     {
  2640.         SendClientMessage(playerid, 0xFF0000AA, "*** Silencia um jogador.");
  2641.     }
  2642.     else
  2643.     {
  2644.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  2645.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  2646.  
  2647.         new
  2648.             iTarget;
  2649.  
  2650.         if(sscanf(params, "u", iTarget))
  2651.             return SendClientMessage(playerid, COLOR_SAMP, "*** /silenciar [playerid]");
  2652.            
  2653.         if(!IsPlayerConnected(iTarget))
  2654.             return SendClientMessage(playerid, COLOR_GREY, "*** Jogador não conectado.");
  2655.            
  2656.         if(playerid == iTarget)
  2657.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não pode silenciar você mesmo.");
  2658.        
  2659.         SendClientMessageFormattedToAll(COLOR_LIGHTRED, "*** {930000}%s{FF6347} foi silenciado por {930000}%s{FF6347}.", GetPlayerNameEx(iTarget), GetPlayerNameEx(playerid));
  2660.  
  2661.         gPlayerData[iTarget][E_PLAYER_MUTED] = true;
  2662.     }
  2663.     return 1;
  2664. }
  2665.  
  2666. /*-----------------------------------------------------------------------------*\
  2667.     Este comando é usado para fazer calculos de K/D
  2668.    
  2669.     Param:
  2670.         - playerid: O ID do jogador que utilizou o comando
  2671.         - digito1: Valor de kills
  2672.         - digito2: Valor de deaths
  2673. \*-----------------------------------------------------------------------------*/
  2674. YCMD:calcularkd(playerid, params[], help)
  2675. {
  2676.     if(help)
  2677.     {
  2678.         SendClientMessage(playerid, 0xFF0000AA, "*** Faz calculos de K/D.");
  2679.     }
  2680.     else
  2681.     {
  2682.         new
  2683.             digito1,
  2684.             digito2;
  2685.  
  2686.         if(sscanf(params, "ii", digito1, digito2))
  2687.             return SendClientMessage(playerid, COLOR_SAMP, "*** /calcularkd [kills] [deaths]");
  2688.  
  2689.         SendClientMessageFormatted(playerid, 0x78C100FF, "K/D: {68A100}%0.02f", floatdiv(digito1, digito2));
  2690.     }
  2691.     return 1;
  2692. }
  2693.  
  2694. /*-----------------------------------------------------------------------------*\
  2695.     Este comando é usado para fazer calculos
  2696.    
  2697.     Param:
  2698.         - playerid: O ID do jogador que utilizou o comando
  2699.         - digito1: Valor do número que será calculado por digito2
  2700.         - calculo: Modo do calculo
  2701.         - digito2: Valor do número que será calculado por digito1
  2702. \*-----------------------------------------------------------------------------*/
  2703. YCMD:calcular(playerid, params[], help)
  2704. {
  2705.     if (help)
  2706.     {
  2707.         SendClientMessage(playerid, 0xFF0000AA, "*** Faz calculos como uma calculadora.");
  2708.     }
  2709.     else
  2710.     {
  2711.         new
  2712.             digito1,
  2713.             calculo[2],
  2714.             digito2;
  2715.  
  2716.         if(sscanf(params, "dsd", digito1, calculo, digito2))
  2717.             return SendClientMessage(playerid, COLOR_SAMP, "*** /calcular [digito1] [calculo] [digito2]");
  2718.  
  2719.         if(strcmp(calculo,"/",true) == 0)
  2720.         {
  2721.             SendClientMessageFormatted(playerid, 0x78C100FF, "*** {68A100}%d{78C100} dividido por {68A100}%d{78C100}. Resultado: {68A100}%d", digito1, digito2, digito1/digito2);
  2722.         }
  2723.         else if(strcmp(calculo,"*",true) == 0)
  2724.         {
  2725.             SendClientMessageFormatted(playerid, 0x78C100FF, "*** {68A100}%d{78C100} multiplicado por {68A100}%d{78C100}. Resultado: {68A100}%d", digito1, digito2, digito1*digito2);
  2726.         }
  2727.         else if(strcmp(calculo,"-",true) == 0)
  2728.         {
  2729.             SendClientMessageFormatted(playerid, 0x78C100FF, "*** {68A100}%d{78C100} subtraido por {68A100}%d{78C100}. Resultado: {68A100}%d", digito1, digito2, digito1-digito2);
  2730.         }
  2731.         else if(strcmp(calculo,"+",true) == 0)
  2732.         {
  2733.             SendClientMessageFormatted(playerid, 0x78C100FF, "*** {68A100}%d{78C100} somado a {68A100}%d{78C100}. Resultado: {68A100}%d", digito1, digito2, digito1+digito2);
  2734.         }
  2735.         else SendClientMessage(playerid, COLOR_GREY, "*** Sinal inválido. [/,*,+ ou -]");
  2736.     }
  2737.     return 1;
  2738. }
  2739.  
  2740. /*-----------------------------------------------------------------------------*\
  2741.     Este comando é usado para mudar a senha do jogador
  2742.    
  2743.     Param:
  2744.         - playerid: O ID do jogador que utilizou o comando
  2745.         - zPass: A nova senha do jogador
  2746. \*-----------------------------------------------------------------------------*/
  2747. YCMD:mudarsenha(playerid, params[], help)
  2748. {
  2749.     if (help)
  2750.     {
  2751.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera sua senha atual.");
  2752.     }
  2753.     else
  2754.     {
  2755.         new
  2756.             zPass[32];
  2757.  
  2758.         if(sscanf(params, "s", zPass))
  2759.             return SendClientMessage(playerid, COLOR_SAMP, "*** /mudarsenha [novasenha]");
  2760.        
  2761.         if(strlen(zPass) > 32)
  2762.             return SendClientMessage(playerid, COLOR_GREY, "*** Senha muito comprida.");
  2763.  
  2764.         // Make the filename.
  2765.         new
  2766.             playerName[MAX_PLAYER_NAME];
  2767.         GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2768.         new
  2769.             userFile[32];
  2770.         format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  2771.         // Open the file.
  2772.         new
  2773.             INI:file = INI_Open(userFile);
  2774.         // Set the tag.
  2775.         INI_SetTag(file, "gungame");
  2776.         // Write the data.
  2777.         INI_WriteString(file, "password", zPass);
  2778.         // Close the file.
  2779.         INI_Close(file);
  2780.         SendClientMessageFormatted(playerid, 0xBBEA00FF, "*** Senha alterada para {7CAB00}%s", zPass);
  2781.     }
  2782.     return 1;
  2783. }
  2784.  
  2785. /*-----------------------------------------------------------------------------*\
  2786.     Este comando é usado para mudar o email do jogador
  2787.    
  2788.     Param:
  2789.         - playerid: O ID do jogador que utilizou o comando
  2790.         - zEmail: O novo email do jogador
  2791. \*-----------------------------------------------------------------------------*/
  2792. YCMD:mudaremail(playerid, params[], help)
  2793. {
  2794.     if (help)
  2795.     {
  2796.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera seu email atual.");
  2797.     }
  2798.     else
  2799.     {
  2800.         new
  2801.             zEmail[80];
  2802.  
  2803.         if(sscanf(params, "s", zEmail))
  2804.             return SendClientMessage(playerid, COLOR_SAMP, "*** /mudaremail [novoemail]");
  2805.        
  2806.         if(strlen(zEmail) < 5)
  2807.             return SendClientMessage(playerid, COLOR_GREY, "*** E-mail muito curto.");
  2808.        
  2809.         if(strlen(zEmail) > 80)
  2810.             return SendClientMessage(playerid, COLOR_GREY, "*** E-mail muito comprido.");
  2811.  
  2812.         if(strfind(zEmail, "@", true) != -1 && strfind(zEmail, ".", true) != -1)
  2813.         {
  2814.             // Make the filename.
  2815.             new
  2816.                 playerName[MAX_PLAYER_NAME];
  2817.             GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  2818.             new
  2819.                 userFile[32];
  2820.             format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  2821.             // Open the file.
  2822.             new
  2823.                 INI:file = INI_Open(userFile);
  2824.             // Set the tag.
  2825.             INI_SetTag(file, "gungame");
  2826.             // Write the data.
  2827.             INI_WriteString(file, "email", zEmail);
  2828.             // Close the file.
  2829.             INI_Close(file);
  2830.             SendClientMessageFormatted(playerid, 0xBBEA00FF, "*** E-mail alterado para {7CAB00}%s", zEmail);
  2831.         }
  2832.         else
  2833.         {
  2834.             SendClientMessage(playerid, COLOR_GREY, "*** E-mail inválido.");
  2835.         }
  2836.     }
  2837.     return 1;
  2838. }
  2839.  
  2840. /*-----------------------------------------------------------------------------*\
  2841.     Este comando é usado para enviar uma mensagem privada a um jogador
  2842.    
  2843.     Param:
  2844.         - playerid: O ID do jogador que utilizou o comando
  2845.         - iTarget: O ID do jogador que receberá a mensagem
  2846.         - zMessage: A mensagem que será enviada
  2847. \*-----------------------------------------------------------------------------*/
  2848. YCMD:pm(playerid, params[], help)
  2849. {
  2850.     if (help)
  2851.     {
  2852.         SendClientMessage(playerid, 0xFF0000AA, "*** Envia uma mensagem para os administradores online.");
  2853.     }
  2854.     else
  2855.     {
  2856.         new
  2857.             iTarget,
  2858.             zMessage[128],
  2859.             zString[156];
  2860.  
  2861.         if(sscanf(params, "us", iTarget, zMessage))
  2862.             return SendClientMessage(playerid, COLOR_SAMP, "*** /pm [playerid] [mensagem]");
  2863.            
  2864.         if(!IsPlayerConnected(iTarget))
  2865.             return SendClientMessage(playerid, COLOR_GREY, "*** Jogador não conectado.");
  2866.            
  2867.         if(playerid == iTarget)
  2868.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não pode enviar mensagens para você mesmo.");
  2869.        
  2870.         format(zString, 156, "*** Mensagem privada de {00ACFF}%s{33CCFF}: %s", GetPlayerNameEx(playerid), zMessage);
  2871.         SendClientMessage(iTarget, 0x33CCFFAA, zString);
  2872.        
  2873.         format(zString, 156, "*** Mensagem enviada a {00ACFF}%s{33CCFF}: %s", GetPlayerNameEx(iTarget), zMessage);
  2874.         SendClientMessage(playerid, 0x33CCFFAA, zString);
  2875.     }
  2876.     return 1;
  2877. }
  2878.  
  2879. /*-----------------------------------------------------------------------------*\
  2880.     Este comando é usado para enviar uma mensagem para os admins online
  2881.    
  2882.     Param:
  2883.         - playerid: O ID do jogador que utilizou o comando
  2884.         - zMessage: A mensagem que será enviada
  2885. \*-----------------------------------------------------------------------------*/
  2886. YCMD:relatorio(playerid, params[], help)
  2887. {
  2888.     if (help)
  2889.     {
  2890.         SendClientMessage(playerid, 0xFF0000AA, "*** Envia uma mensagem para os administradores online.");
  2891.     }
  2892.     else
  2893.     {
  2894.         new
  2895.             zMessage[128],
  2896.             zString[156];
  2897.  
  2898.         if(sscanf(params, "s", zMessage))
  2899.             return SendClientMessage(playerid, COLOR_SAMP, "*** /relatorio [mensagem]");
  2900.        
  2901.         format(zString, 156, "*** Relatório de {930000}%s{FF6347}: %s", GetPlayerNameEx(playerid), zMessage);
  2902.         SendClientMessage(playerid, COLOR_LIGHTRED, zString);
  2903.         AdministratorMessage(COLOR_LIGHTRED, zString, 1);
  2904.     }
  2905.     return 1;
  2906. }
  2907.  
  2908. /*-----------------------------------------------------------------------------*\
  2909.     Este comando é usado para enviar uma mensagem ao admin chat
  2910.    
  2911.     Param:
  2912.         - playerid: O ID do jogador que utilizou o comando
  2913.         - zMessage: A mensagem que será enviada
  2914. \*-----------------------------------------------------------------------------*/
  2915. YCMD:a(playerid, params[], help)
  2916. {
  2917.     if (help)
  2918.     {
  2919.         SendClientMessage(playerid, 0xFF0000AA, "*** Envia uma mensagem ao chat dos administradores.");
  2920.     }
  2921.     else
  2922.     {
  2923.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  2924.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  2925.  
  2926.         new
  2927.             zMessage[128];
  2928.  
  2929.         if(sscanf(params, "s", zMessage))
  2930.             return SendClientMessage(playerid, COLOR_SAMP, "*** /a [mensagem]");
  2931.        
  2932.         foreach(Player, i){if(gPlayerData[i][E_PLAYER_ADMIN] > 0) SendClientMessageFormatted(i, COLOR_LIGHTRED, "*** A-Chat {930000}%s{FF6347}: %s", GetPlayerNameEx(playerid), zMessage);}
  2933.     }
  2934.     return 1;
  2935. }
  2936.  
  2937. /*-----------------------------------------------------------------------------*\
  2938.     Este comando é usado para enviar uma mensagem destacada para todos
  2939.    
  2940.     Param:
  2941.         - playerid: O ID do jogador que utilizou o comando
  2942.         - zMessage: A mensagem que será enviada
  2943. \*-----------------------------------------------------------------------------*/
  2944. YCMD:say(playerid, params[], help)
  2945. {
  2946.     if (help)
  2947.     {
  2948.         SendClientMessage(playerid, 0xFF0000AA, "*** Envia uma mensagem a todos.");
  2949.     }
  2950.     else
  2951.     {
  2952.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  2953.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  2954.  
  2955.         new
  2956.             zMessage[128];
  2957.  
  2958.         if(sscanf(params, "s", zMessage))
  2959.             return SendClientMessage(playerid, COLOR_SAMP, "*** /say [mensagem]");
  2960.        
  2961.         SendClientMessageFormattedToAll(COLOR_LIGHTRED, "*** Admin {930000}%s{FF6347}: %s", GetPlayerNameEx(playerid), zMessage);
  2962.     }
  2963.     return 1;
  2964. }
  2965.  
  2966. /*-----------------------------------------------------------------------------*\
  2967.     Este comando é usado para descongelar um jogador
  2968.    
  2969.     Param:
  2970.         - playerid: O ID do jogador que utilizou o comando
  2971.         - iTarget: O ID do jogador que será descongelado
  2972. \*-----------------------------------------------------------------------------*/
  2973. YCMD:descongelar(playerid, params[], help)
  2974. {
  2975.     if (help)
  2976.     {
  2977.         SendClientMessage(playerid, 0xFF0000AA, "*** Desongela um jogador.");
  2978.     }
  2979.     else
  2980.     {
  2981.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  2982.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  2983.  
  2984.         new
  2985.             iTarget;
  2986.  
  2987.         if(sscanf(params, "u", iTarget))
  2988.             return SendClientMessage(playerid, COLOR_SAMP, "*** /descongelar [playerid]");
  2989.        
  2990.         if(!IsPlayerConnected(iTarget))
  2991.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  2992.        
  2993.         TogglePlayerControllable(iTarget, true);
  2994.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você descongelou {930000}%s{FF6347}.", GetPlayerNameEx(iTarget));
  2995.     }
  2996.     return 1;
  2997. }
  2998.  
  2999. /*-----------------------------------------------------------------------------*\
  3000.     Este comando é usado para congelar um jogador
  3001.    
  3002.     Param:
  3003.         - playerid: O ID do jogador que utilizou o comando
  3004.         - iTarget: O ID do jogador que será congelado
  3005. \*-----------------------------------------------------------------------------*/
  3006. YCMD:congelar(playerid, params[], help)
  3007. {
  3008.     if (help)
  3009.     {
  3010.         SendClientMessage(playerid, 0xFF0000AA, "*** Congela um jogador.");
  3011.     }
  3012.     else
  3013.     {
  3014.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3015.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3016.  
  3017.         new
  3018.             iTarget;
  3019.  
  3020.         if(sscanf(params, "u", iTarget))
  3021.             return SendClientMessage(playerid, COLOR_SAMP, "*** /congelar [playerid]");
  3022.        
  3023.         if(!IsPlayerConnected(iTarget))
  3024.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3025.        
  3026.         TogglePlayerControllable(iTarget, false);
  3027.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você congelou {930000}%s{FF6347}.", GetPlayerNameEx(iTarget));
  3028.     }
  3029.     return 1;
  3030. }
  3031.  
  3032. /*-----------------------------------------------------------------------------*\
  3033.     Este comando é usado para banir um jogador
  3034.    
  3035.     Param:
  3036.         - playerid: O ID do jogador que utilizou o comando
  3037.         - iTarget: O ID do jogador que será banido
  3038.         - zReason: A razão pela qual o jogador será banido
  3039. \*-----------------------------------------------------------------------------*/
  3040. YCMD:ban(playerid, params[], help)
  3041. {
  3042.     if (help)
  3043.     {
  3044.         SendClientMessage(playerid, 0xFF0000AA, "*** Ban um jogador.");
  3045.     }
  3046.     else
  3047.     {
  3048.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3049.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3050.  
  3051.         new
  3052.             iTarget,
  3053.             zReason[128];
  3054.  
  3055.         if(sscanf(params, "us", iTarget, zReason))
  3056.             return SendClientMessage(playerid, COLOR_SAMP, "*** /ban [playerid] [razão]");
  3057.        
  3058.         if(!IsPlayerConnected(iTarget))
  3059.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3060.        
  3061.         if(iTarget == playerid)
  3062.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não pode banir você mesmo.");
  3063.        
  3064.         new STR[215];
  3065.         format(STR, sizeof(STR), "*** {930000}%s {FF6347}foi banido do servidor por {930000}%s{FF6347}. Motivo: {930000}%s{FF6347}", GetPlayerNameEx(iTarget), GetPlayerNameEx(playerid), zReason);
  3066.         SendClientMessageToAll(0xFF6347FF, STR);
  3067.        
  3068.         BanEx( iTarget, zReason );
  3069.     }
  3070.     return 1;
  3071. }
  3072.  
  3073. /*-----------------------------------------------------------------------------*\
  3074.     Este comando é usado para alterar o nome de um jogador
  3075.    
  3076.     Param:
  3077.         - playerid: O ID do jogador que utilizou o comando
  3078.         - iTarget: O ID do jogador que terá o nome alterado
  3079.         - zName: O novo nome
  3080. \*-----------------------------------------------------------------------------*/
  3081. YCMD:mudarnome(playerid, params[], help)
  3082. {
  3083.     if (help)
  3084.     {
  3085.         SendClientMessage(playerid, 0xFF0000AA, "*** Muda o nome de um jogador.");
  3086.     }
  3087.     else
  3088.     {
  3089.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 10)
  3090.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3091.  
  3092.         new
  3093.             iTarget,
  3094.             zName[MAX_PLAYER_NAME];
  3095.  
  3096.         if(sscanf(params, "us", iTarget, zName))
  3097.             return SendClientMessage(playerid, COLOR_SAMP, "*** /mudarnome [playerid] [novonome]");
  3098.        
  3099.         if(!IsPlayerConnected(iTarget))
  3100.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3101.        
  3102.         if(strlen(zName) > MAX_PLAYER_NAME)
  3103.             return SendClientMessage(playerid, COLOR_GREY, "*** Nome muito longo.");
  3104.        
  3105.         new
  3106.             playerName[MAX_PLAYER_NAME];
  3107.         GetPlayerName(iTarget, playerName, MAX_PLAYER_NAME);
  3108.         new
  3109.             userFile[32];
  3110.         format(userFile, sizeof (userFile), "users/%s.ini", playerName);
  3111.  
  3112.         if(fexist(userFile))
  3113.             return SendClientMessage(playerid, COLOR_GREY, "*** Este nome já está em uso.");
  3114.        
  3115.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você alterou o nome de %s para %s.", GetPlayerNameEx(iTarget), zName);
  3116.         SendClientMessageFormatted(iTarget, COLOR_LIGHTRED, "*** %s alterou seu nome para %s.", GetPlayerNameEx(playerid), zName);
  3117.        
  3118.         switch(SetPlayerName(iTarget, zName))
  3119.         {
  3120.             case -1:
  3121.             {
  3122.                 SendClientMessage(playerid, COLOR_GREY, "*** Erro: Este nome está em uso, contém caractéres inválidos ou o jogador já está utilizando este nome.");
  3123.                 SendClientMessage(iTarget, COLOR_GREY, "*** Erro: Este nome está em uso, contém caractéres inválidos ou o você já está utilizando este nome.");
  3124.             }
  3125.             case 0:
  3126.             {
  3127.                 SendClientMessage(playerid, COLOR_GREY, "*** Erro: O jogador já está utilizando este nick.");
  3128.                 SendClientMessage(iTarget, COLOR_GREY, "*** Erro: Você já está utilizando este nome.");
  3129.             }
  3130.         }
  3131.     }
  3132.     return 1;
  3133. }
  3134.  
  3135. /*-----------------------------------------------------------------------------*\
  3136.     Este comando é usado para kickar um jogador
  3137.    
  3138.     Param:
  3139.         - playerid: O ID do jogador que utilizou o comando
  3140.         - iTarget: O ID do jogador que será kickado
  3141.         - zReason: A razão pela qual o jogador será kickado
  3142. \*-----------------------------------------------------------------------------*/
  3143. YCMD:kick(playerid, params[], help)
  3144. {
  3145.     if (help)
  3146.     {
  3147.         SendClientMessage(playerid, 0xFF0000AA, "*** Kick um jogador.");
  3148.     }
  3149.     else
  3150.     {
  3151.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3152.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3153.  
  3154.         new
  3155.             iTarget,
  3156.             zReason[128];
  3157.  
  3158.         if(sscanf(params, "us", iTarget, zReason))
  3159.             return SendClientMessage(playerid, COLOR_SAMP, "*** /kick [playerid] [razão]");
  3160.        
  3161.         if(!IsPlayerConnected(iTarget))
  3162.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3163.        
  3164.         if(iTarget == playerid)
  3165.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não pode kickar você mesmo.");
  3166.        
  3167.         new STR[215];
  3168.         format(STR, sizeof(STR), "*** {930000}%s {FF6347}foi kickado do servidor por {930000}%s{FF6347}. Motivo: {930000}%s{FF6347}", GetPlayerNameEx(iTarget), GetPlayerNameEx(playerid), zReason);
  3169.         SendClientMessageToAll(0xFF6347FF, STR);
  3170.        
  3171.         Kick( iTarget );
  3172.     }
  3173.     return 1;
  3174. }
  3175.  
  3176. /*-----------------------------------------------------------------------------*\
  3177.     Este comando é usado para alterar a saúde de todos os jogadores
  3178.    
  3179.     Param:
  3180.         - playerid: O ID do jogador que utilizou o comando
  3181.         - iHP: A quantia de saúde que será definida
  3182. \*-----------------------------------------------------------------------------*/
  3183. YCMD:armourall(playerid, params[], help)
  3184. {
  3185.     if (help)
  3186.     {
  3187.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera o colete de todos os jogadores.");
  3188.     }
  3189.     else
  3190.     {
  3191.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3192.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3193.  
  3194.         new
  3195.             iArmour;
  3196.  
  3197.         if(sscanf(params, "i", iArmour))
  3198.             return SendClientMessage(playerid, COLOR_SAMP, "*** /armourall [colete]");
  3199.        
  3200.        
  3201.         foreach(Player, i){SetPlayerArmour(i, iArmour);}
  3202.         SendClientMessageFormattedToAll(COLOR_LIGHTRED, "*** {930000}%s{FF6347} alterou o colete de todos os jogadores para {930000}%i{FF6347}.", GetPlayerNameEx(playerid), iArmour);
  3203.     }
  3204.     return 1;
  3205. }
  3206.  
  3207. /*-----------------------------------------------------------------------------*\
  3208.     Este comando é usado para alterar a saúde de todos os jogadores
  3209.    
  3210.     Param:
  3211.         - playerid: O ID do jogador que utilizou o comando
  3212.         - iHP: A quantia de saúde que será definida
  3213. \*-----------------------------------------------------------------------------*/
  3214. YCMD:hpall(playerid, params[], help)
  3215. {
  3216.     if (help)
  3217.     {
  3218.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera a saúde de todos os jogadores.");
  3219.     }
  3220.     else
  3221.     {
  3222.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3223.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3224.  
  3225.         new
  3226.             iHP;
  3227.  
  3228.         if(sscanf(params, "i", iHP))
  3229.             return SendClientMessage(playerid, COLOR_SAMP, "*** /hpall [saúde]");
  3230.        
  3231.        
  3232.         foreach(Player, i){SetPlayerHealth(i, iHP);}
  3233.         SendClientMessageFormattedToAll(COLOR_LIGHTRED, "*** {930000}%s{FF6347} alterou a saúde de todos os jogadores para {930000}%i{FF6347}.", GetPlayerNameEx(playerid), iHP);
  3234.     }
  3235.     return 1;
  3236. }
  3237.  
  3238. /*-----------------------------------------------------------------------------*\
  3239.     Este comando é usado para alterar a saúde de um jogador
  3240.    
  3241.     Param:
  3242.         - playerid: O ID do jogador que utilizou o comando
  3243.         - iTarget: O ID do jogador que terá a saúde alterada
  3244.         - iHP: A quantia de saúde que será definida
  3245. \*-----------------------------------------------------------------------------*/
  3246. YCMD:sethp(playerid, params[], help)
  3247. {
  3248.     if (help)
  3249.     {
  3250.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera a saúde de um jogador.");
  3251.     }
  3252.     else
  3253.     {
  3254.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3255.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3256.  
  3257.         new
  3258.             iTarget,
  3259.             iHP;
  3260.  
  3261.         if(sscanf(params, "ui", iTarget, iHP))
  3262.             return SendClientMessage(playerid, COLOR_SAMP, "*** /sethp [playerid] [saúde]");
  3263.        
  3264.         if(!IsPlayerConnected(iTarget))
  3265.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3266.        
  3267.         new STR[73+(MAX_PLAYER_NAME*2)];
  3268.         format(STR, sizeof(STR), "*** {930000}%s{FF6347} alterou a saúde de {930000}%s{FF6347} para {930000}%i{FF6347}.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget), iHP);
  3269.         AdministratorMessage(0xFF6347FF, STR, 1);
  3270.        
  3271.         SetPlayerHealth(iTarget, iHP);
  3272.     }
  3273.     return 1;
  3274. }
  3275.  
  3276. /*-----------------------------------------------------------------------------*\
  3277.     Este comando é usado para alterar o colete de um jogador
  3278.    
  3279.     Param:
  3280.         - playerid: O ID do jogador que utilizou o comando
  3281.         - iTarget: O ID do jogador que terá o colete alterado
  3282.         - iArmour: A quantia do colete que será definida
  3283. \*-----------------------------------------------------------------------------*/
  3284. YCMD:setarmour(playerid, params[], help)
  3285. {
  3286.     if (help)
  3287.     {
  3288.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera o colete de um jogador.");
  3289.     }
  3290.     else
  3291.     {
  3292.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3293.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3294.  
  3295.         new
  3296.             iTarget,
  3297.             iArmour;
  3298.  
  3299.         if(sscanf(params, "ui", iTarget, iArmour))
  3300.             return SendClientMessage(playerid, COLOR_SAMP, "*** /setarmour [playerid] [colete]");
  3301.        
  3302.         if(!IsPlayerConnected(iTarget))
  3303.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3304.        
  3305.         new STR[73+(MAX_PLAYER_NAME*2)];
  3306.         format(STR, sizeof(STR), "*** {930000}%s{FF6347} alterou o colete de {930000}%s{FF6347} para {930000}%i{FF6347}.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget), iArmour);
  3307.         AdministratorMessage(0xFF6347FF, STR, 1);
  3308.        
  3309.         SetPlayerArmour(iTarget, iArmour);
  3310.     }
  3311.     return 1;
  3312. }
  3313.  
  3314. /*-----------------------------------------------------------------------------*\
  3315.     Este comando é usado para alterar o nível de admin de um jogador
  3316.    
  3317.     Param:
  3318.         - playerid: O ID do jogador que utilizou o comando
  3319.         - iTarget: O ID do jogador que terá o nível alterado
  3320.         - iAdmin: A quantia do nível que será definida
  3321. \*-----------------------------------------------------------------------------*/
  3322. YCMD:setadmin(playerid, params[], help)
  3323. {
  3324.     if (help)
  3325.     {
  3326.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera o admin de um jogador.");
  3327.     }
  3328.     else
  3329.     {
  3330.         if(!IsPlayerAdmin(playerid))
  3331.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não tem permissão.");
  3332.  
  3333.         new
  3334.             iTarget,
  3335.             iAdmin;
  3336.  
  3337.         if(sscanf(params, "ui", iTarget, iAdmin))
  3338.             return SendClientMessage(playerid, COLOR_SAMP, "*** /setadmin [playerid] [nível]");
  3339.        
  3340.         if(!IsPlayerConnected(iTarget))
  3341.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3342.        
  3343.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você definiu {930000}%s {FF6347}como administrador nível {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), iAdmin);
  3344.         SendClientMessageFormatted(iTarget, COLOR_LIGHTRED, "*** Você se tornou administrador nível {930000}%i {FF6347}por {930000}%s{FF6347}.", iAdmin, GetPlayerNameEx(playerid));
  3345.        
  3346.         if(gPlayerData[iTarget][E_PLAYER_ADMIN] < 1 && gPlayerData[iTarget][E_PLAYER_ADMIN]+iAdmin > 0)
  3347.         {
  3348.             gGlobal[G_ADMIN]++;
  3349.             new newtext[8];
  3350.             format(newtext, sizeof(newtext), "~p~%02d", gGlobal[G_ADMIN]);
  3351.             TextDrawSetString(admonnum, newtext);
  3352.         }
  3353.         else if(gPlayerData[iTarget][E_PLAYER_ADMIN] > 0 && gPlayerData[iTarget][E_PLAYER_ADMIN]+iAdmin < 1)
  3354.         {
  3355.             gGlobal[G_ADMIN]--;
  3356.             new newtext[8];
  3357.             format(newtext, sizeof(newtext), "~p~%02d", gGlobal[G_ADMIN]);
  3358.             TextDrawSetString(admonnum, newtext);
  3359.         }
  3360.        
  3361.         gPlayerData[iTarget][E_PLAYER_ADMIN] = iAdmin;
  3362.     }
  3363.     return 1;
  3364. }
  3365.  
  3366. /*-----------------------------------------------------------------------------*\
  3367.     Este comando é usado para teleportar-se a um jogador
  3368.    
  3369.     Param:
  3370.         - playerid: O ID do jogador que utilizou o comando,
  3371.             e será teleportado
  3372.         - iTarget: O ID do jogador que o playerid irá se teleportar
  3373. \*-----------------------------------------------------------------------------*/
  3374. YCMD:ir(playerid, params[], help)
  3375. {
  3376.     if (help)
  3377.     {
  3378.         SendClientMessage(playerid, 0xFF0000AA, "*** Teleporta até um jogador.");
  3379.     }
  3380.     else
  3381.     {
  3382.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3383.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3384.  
  3385.         new
  3386.             iTarget;
  3387.  
  3388.         if(sscanf(params, "u", iTarget))
  3389.             return SendClientMessage(playerid, COLOR_SAMP, "*** /ir [playerid]");
  3390.        
  3391.         if(!IsPlayerConnected(iTarget))
  3392.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3393.        
  3394.         if(iTarget == playerid)
  3395.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não pode teleportar para você mesmo.");
  3396.        
  3397.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você se teleportou até {930000}%s{FF6347}.", GetPlayerNameEx(iTarget));
  3398.        
  3399.         new
  3400.             Float:pPos[3];
  3401.         GetPlayerPos(iTarget, pPos[0], pPos[1], pPos[2]);
  3402.         SetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
  3403.         SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(iTarget));
  3404.         SetPlayerInterior(playerid, GetPlayerInterior(iTarget));
  3405.     }
  3406.     return 1;
  3407. }
  3408.  
  3409. /*-----------------------------------------------------------------------------*\
  3410.     Este comando é usado para teleportar jogadores
  3411.    
  3412.     Param:
  3413.         - playerid: O ID do jogador que utilizou o comando,
  3414.             e teleportará o iTarget
  3415.         - iTarget: O ID do jogador que será teleportado
  3416. \*-----------------------------------------------------------------------------*/
  3417. YCMD:puxar(playerid, params[], help)
  3418. {
  3419.     if (help)
  3420.     {
  3421.         SendClientMessage(playerid, 0xFF0000AA, "*** Teleporta um jogador até você.");
  3422.     }
  3423.     else
  3424.     {
  3425.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 1)
  3426.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não é um administrador.");
  3427.  
  3428.         new
  3429.             iTarget;
  3430.  
  3431.         if(sscanf(params, "u", iTarget))
  3432.             return SendClientMessage(playerid, COLOR_SAMP, "*** /puxar [playerid]");
  3433.        
  3434.         if(!IsPlayerConnected(iTarget))
  3435.             return SendClientMessage(playerid, COLOR_GREY, "*** O jogador não está conectado.");
  3436.        
  3437.         if(iTarget == playerid)
  3438.             return SendClientMessage(playerid, COLOR_GREY, "*** Você não pode teleportar para você mesmo.");
  3439.        
  3440.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você teleportou {930000}%s{FF6347} até você.", GetPlayerNameEx(iTarget));
  3441.         SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Você foi teleportado até {930000}%s{FF6347}.", GetPlayerNameEx(playerid));
  3442.        
  3443.         new
  3444.             Float:pPos[3];
  3445.         GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
  3446.         SetPlayerPos(iTarget, pPos[0], pPos[1], pPos[2]);
  3447.         SetPlayerVirtualWorld(iTarget, GetPlayerVirtualWorld(playerid));
  3448.         SetPlayerInterior(iTarget, GetPlayerInterior(playerid));
  3449.     }
  3450.     return 1;
  3451. }
  3452.  
  3453. /*-----------------------------------------------------------------------------*\
  3454.     Este comando é alterar o status de um jogador
  3455.    
  3456.     Param:
  3457.         - playerid: O ID do jogador que utilizou o comando,
  3458.             e editará o stats
  3459.         - iTarget: O ID do jogador que o playerid irá se teleportar
  3460.         - codigo: O ID do código que alterará o stats
  3461.         - quantia: Quantidade definida do stats do código
  3462. \*-----------------------------------------------------------------------------*/
  3463. YCMD:setstat(playerid, params[], help)
  3464. {
  3465.     if(help)
  3466.     {
  3467.         SendClientMessage(playerid, 0xFF0000AA, "*** Altera o stats de algum jogador.");
  3468.     }
  3469.     else
  3470.     {
  3471.         if(gPlayerData[playerid][E_PLAYER_ADMIN] < 10) return SendClientMessage(playerid, COLOR_GREY, "*** Você não tem permissão.");
  3472.         new
  3473.             iTarget,
  3474.             codigo,
  3475.             quantia;
  3476.  
  3477.         if(sscanf(params, "udd", iTarget, codigo, quantia))
  3478.         {
  3479.             SendClientMessage(playerid, COLOR_SAMP, "*** /setstat [id] [código] [quantia]");
  3480.             SendClientMessage(playerid,0x00B6FFFF,"____________________Stats____________________");
  3481.             SendClientMessage(playerid, 0xE6E6E6E6, "(1)KillsG - (2)DeathsG - (3)Idade - (4)Sexo - (5)Nível - (6)Kills - (7)Deaths - (8)HorasJogadas");
  3482.             SendClientMessage(playerid,0x00B6FFFF, "______________________________________________________________________________________");
  3483.         }
  3484.         else if(!IsPlayerConnected(iTarget)) SendClientMessage(playerid, COLOR_GREY, "*** Jogador não encontrado.");
  3485.         else
  3486.         {
  3487.             switch(codigo)
  3488.             {
  3489.                 case 1:
  3490.                 {
  3491.                     gPlayerData[iTarget][E_PLAYER_GKILLS] = quantia;
  3492.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia de \"kills geral\" de {930000}%s{FF6347} alterada para {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), quantia);
  3493.                 }
  3494.                 case 2:
  3495.                 {
  3496.                     gPlayerData[iTarget][E_PLAYER_GDEATHS] = quantia;
  3497.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia de \"deaths geral\" de {930000}%s{FF6347} alterada para {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), quantia);
  3498.                 }
  3499.                 case 3:
  3500.                 {
  3501.                     gPlayerData[iTarget][E_PLAYER_AGE] = quantia;
  3502.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia da \"idade\" de {930000}%s{FF6347} alterada para {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), quantia);
  3503.                 }
  3504.                 case 4:
  3505.                 {
  3506.                     gPlayerData[iTarget][E_PLAYER_SEX] = quantia;
  3507.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia do \"sexo\" de {930000}%s{FF6347} alterado para {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), quantia);
  3508.                 }
  3509.                 case 5:
  3510.                 {
  3511.                     gPlayerData[iTarget][E_PLAYER_LVL] = quantia;
  3512.                     gPlayerData[iTarget][E_PLAYER_NXTLVL] = 0;
  3513.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia do \"level\" de {930000}%s{FF6347} alterada para {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), quantia);
  3514.                     CheckWeaponLevel(iTarget);
  3515.                 }
  3516.                 case 6:
  3517.                 {
  3518.                     gPlayerData[iTarget][E_PLAYER_KILLS] = quantia;
  3519.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia de \"deaths\" de {930000}%s{FF6347} alterada para {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), quantia);
  3520.                 }
  3521.                 case 7:
  3522.                 {
  3523.                     gPlayerData[iTarget][E_PLAYER_DEATHS] = quantia;
  3524.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia de \"kills\" de {930000}%s{FF6347} alterada para {930000}%i{FF6347}.", GetPlayerNameEx(iTarget), quantia);
  3525.                 }
  3526.                 case 8:
  3527.                 {
  3528.                     gPlayerData[iTarget][E_PLAYER_PLAYEDHOURS] = quantia;
  3529.                     SendClientMessageFormatted(playerid, COLOR_LIGHTRED, "*** Quantia de \"horas jogadas\" de {930000}%s{FF6347} alterada para {930000}%i{FF6347} segundos.", GetPlayerNameEx(iTarget), quantia);
  3530.                 }
  3531.                 default:
  3532.                 {
  3533.                     return SendClientMessage(playerid, COLOR_GREY, "*** Código inválido. (/setstat)");
  3534.                 }
  3535.             }
  3536.         }
  3537.     }
  3538.     return 1;
  3539. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement