Advertisement
Larceny

GM - GunGame

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