Advertisement
Guest User

C-VIP por Cleyson Stein

a guest
Sep 15th, 2015
1,638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 35.11 KB | None | 0 0
  1. // == Includes
  2. #include <a_samp>
  3. #include <sscanf2>
  4. #include <zcmd>
  5. #include <a_mysql>
  6.  
  7. // == Cores
  8. #define OURO                    0xEEC900FF
  9. #define PRATA                   0x9C9C9CFF
  10. #define BRONZE                  0x8B5A2BFF
  11. #define COR_VIP                 0x008B00FF
  12. #define VERMELHO                0xFF030FFF
  13. #define LARANJA                 0xF97804FF
  14. #define CINZA                   0xCECECEFF
  15.  
  16. // == Conexao MySql
  17. #define Host_Connection         "localhost"
  18. #define Host_User               "root"
  19. #define Host_DB                 "cvip"
  20. #define Host_Password           ""
  21.  
  22. // == Dialogs
  23. #define DIALOG_VIPS                     4995
  24. #define DIALOG_VENC_VIP                 4996
  25. #define DIALOG_COMANDOS_VIP             4997
  26. #define DIALOG_EFECTS                   4998
  27. #define DIALOG_TOYS                     4999
  28.  
  29. #define DIALOG_ENABLE_KEY               5000
  30. #define DIALOG_NEW_KEY                  5001
  31. #define DIALOG_NEW_KEY_LEVEL            5005
  32. #define DIALOG_NEW_KEY_DAYS             5002
  33. #define DIALOG_KEY_CONFIRM              5003
  34. #define DIALOG_REMOVE_KEY               5004
  35.  
  36.  
  37. enum pInfo
  38. {
  39.     Vip,
  40.     DiasVip,
  41.     TempoVip,
  42.     vKey[25],
  43.     vDias,
  44.     vNivel,
  45.     Nome,
  46.     bool:PegouKit,
  47.     bool:PegouColete
  48. };
  49. new PlayerInfo[MAX_PLAYERS][pInfo], Connection, Timer, CarrosCriados[100], TodosCarros = 0;
  50.  
  51. public OnFilterScriptInit()
  52. {
  53.     print("Sistema C-VIP carregado com sucesso.");
  54.     print("   Criado por: Cleyson Stein.");
  55.  
  56.     Timer = SetTimer("CheckVip", 60000, true);
  57.  
  58.     Connection = mysql_connect(Host_Connection, Host_User, Host_DB, Host_Password);
  59.  
  60.     mysql_query(Connection, "CREATE TABLE IF NOT EXISTS `Keys`(`Key` varchar(24) NOT NULL, `Dias` int(5) NOT NULL, `Nivel` int(5) NOT NULL)", false);
  61.     mysql_query(Connection, "CREATE TABLE IF NOT EXISTS `Vips`(`Nome` varchar(24) NOT NULL, `Dias` int(5) NOT NULL, `TempoVip` int(5) NOT NULL, `Nivel` int(5) NOT NULL)", false);
  62.  
  63.     if(mysql_errno(Connection) != 0)
  64.     {
  65.         print("C-VIP: FALHA AO SE CONECTAR COM BANCO DE DADOS MYSQL");
  66.         } else {
  67.         print("C-VIP: CONECTADO COM SUCESSO AO BANCO DE DADOS MYSQL");
  68.     }
  69.     return 1;
  70. }
  71.  
  72. public OnFilterScriptExit()
  73. {
  74.     KillTimer(Timer);
  75.     mysql_close(Connection);
  76.     return 1;
  77. }
  78.  
  79. public OnPlayerConnect(playerid)
  80. {
  81.     GetPlayerName(playerid, PlayerInfo[playerid][Nome], 24);
  82.  
  83.     new Query[70];
  84.     mysql_format(Connection, Query, sizeof(Query), "SELECT * FROM `Vips` WHERE `Nome`='%e'", PlayerInfo[playerid][Nome]);
  85.     mysql_tquery(Connection, Query, "LoadVips", "d", playerid);
  86.     //mysql_escape_string(Query, queryt);
  87.     return 1;
  88. }
  89.  
  90. forward LoadVips(playerid);
  91. public LoadVips(playerid)
  92. {
  93.     if(cache_get_row_count(Connection) == 1)
  94.     {
  95.         PlayerInfo[playerid][Vip] = cache_get_field_content_int(0, "Nivel");
  96.         PlayerInfo[playerid][DiasVip] = cache_get_field_content_int(0, "Dias");
  97.         PlayerInfo[playerid][TempoVip] = cache_get_field_content_int(0, "TempoVip");
  98.     } else {
  99.         PlayerInfo[playerid][Vip] = 0;
  100.         PlayerInfo[playerid][DiasVip] = 0;
  101.         PlayerInfo[playerid][TempoVip] = 0;
  102.     }
  103.     return 1;
  104. }
  105.  
  106. public OnPlayerDisconnect(playerid, reason)
  107. {
  108.     if(PlayerInfo[playerid][Vip] > 0)
  109.     {
  110.         new QueryVIP[80];
  111.         mysql_format(Connection, QueryVIP, sizeof(QueryVIP), "UPDATE `Vips` SET `Dias`=%d, `Nivel`=%d, `TempoVip`=%d WHERE `Nome`='%e'", PlayerInfo[playerid][DiasVip], PlayerInfo[playerid][Vip], PlayerInfo[playerid][TempoVip], PlayerInfo[playerid][Nome]);
  112.         mysql_tquery(Connection, QueryVIP, "","");
  113.     }
  114.     return 1;
  115. }
  116.  
  117. public OnPlayerDeath(playerid, killerid, reason)
  118. {
  119.     if(PlayerInfo[playerid][PegouKit] == true) LiberarKit(playerid);
  120.     if(PlayerInfo[playerid][PegouColete] == true) LiberarColete(playerid);
  121.     return 1;
  122. }
  123.  
  124. SetVip(playerid, Nivel, Dias)
  125. {
  126.     new stringV[70], Query[110];
  127.     if(PlayerInfo[playerid][Vip] > 0)
  128.     {
  129.         format(stringV, sizeof stringV, "C-VIP: Seu VIP foi renovado. + %d dias. Nivel: %d.", Dias, Nivel);
  130.         PlayerInfo[playerid][TempoVip] += Dias;
  131.         PlayerInfo[playerid][DiasVip] += Dias;
  132.         PlayerInfo[playerid][Vip] = Nivel;
  133.  
  134.         mysql_format(Connection, Query, sizeof(Query), "UPDATE `Vips` SET `Dias`=%d, `Nivel`=%d, `TempoVip`=%d WHERE `Nome`='%e'", PlayerInfo[playerid][DiasVip], PlayerInfo[playerid][Vip], PlayerInfo[playerid][TempoVip], PlayerInfo[playerid][Nome]);
  135.         mysql_tquery(Connection, Query, "", "");
  136.  
  137.     } else {
  138.  
  139.         format(stringV, sizeof stringV, "C-VIP: Seu VIP foi ativado. %d dias. Nivel: %d. /ComandosVip", Dias, Nivel);
  140.         PlayerInfo[playerid][TempoVip] = Dias;
  141.         PlayerInfo[playerid][DiasVip] = Dias;
  142.         PlayerInfo[playerid][Vip] = Nivel;
  143.  
  144.         mysql_format(Connection, Query, sizeof(Query), "INSERT INTO `Vips`(`Nome`, `Dias`, `Nivel`, `TempoVip`) VALUES ('%e', %d, %d, %d)", PlayerInfo[playerid][Nome], PlayerInfo[playerid][DiasVip], PlayerInfo[playerid][Vip], PlayerInfo[playerid][TempoVip]);
  145.         mysql_tquery(Connection, Query, "", "");
  146.  
  147.     }
  148.     SendClientMessage(playerid, COR_VIP, stringV);
  149.     return 1;
  150. }
  151.  
  152. RemoveVip(playerid)
  153. {
  154.     new query[70];
  155.     mysql_format(Connection, query, sizeof(query), "DELETE FROM `Vips` WHERE `Nome` = '%e'", PlayerInfo[playerid][Nome]);
  156.     mysql_tquery(Connection, query, "", "");
  157.  
  158.     PlayerInfo[playerid][TempoVip] = 0;
  159.     PlayerInfo[playerid][Vip] = 0;
  160.     PlayerInfo[playerid][DiasVip] = 0;
  161.     SendClientMessage(playerid, COR_VIP, "C-VIP: Seus dias VIP chegaram ao fim. Para renovar adquira uma nova key VIP.");
  162.     return 1;
  163. }
  164.  
  165. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  166. {
  167.     switch(dialogid)
  168.     {
  169.         case DIALOG_NEW_KEY:
  170.         {
  171.             if(!response) return 1;
  172.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_NEW_KEY, DIALOG_STYLE_INPUT, "KEYS VIP", "\nDigite uma nova key válida\n{FFFF00}Apenas letras são aceitas:\n\n", "Criar", "Cancelar");
  173.             format(PlayerInfo[playerid][vKey], 50, inputtext);
  174.             new Dialog[128];
  175.             format(Dialog, sizeof Dialog, "{FFFFFF}Seu novo codigo VIP: {DE3A3A}%s\n\n{FFFFFF}Agora nos informe a quantidade de dias VIP:", PlayerInfo[playerid][vKey]);
  176.             ShowPlayerDialog(playerid, DIALOG_NEW_KEY_DAYS, DIALOG_STYLE_INPUT, "KEYS VIP", Dialog, "Criar", "Cancelar");
  177.         }
  178.  
  179.         case DIALOG_NEW_KEY_DAYS:
  180.         {
  181.             if(!IsNumeric(inputtext)) return SendClientMessage(playerid, VERMELHO, "ERRO: Digite uma quantidade de dias válidos.");
  182.             if(strval(inputtext) <= 0) return SendClientMessage(playerid, VERMELHO, "ERRO: Não pode ser criada uma Key com 0 dias vips.");
  183.             PlayerInfo[playerid][vDias] = strval(inputtext);
  184.             new Dialog[170];
  185.             format(Dialog, sizeof Dialog, "{FFFFFF}Seu novo codigo VIP: {DE3A3A}%s\n{FFFFFF}Vencimento: {DE3A3A}%d dias\n\n{FFFFFF}Agora nos informe o nivel da key VIP: {DE3A3A}1 a 3", PlayerInfo[playerid][vKey], PlayerInfo[playerid][vDias]);
  186.             ShowPlayerDialog(playerid, DIALOG_NEW_KEY_LEVEL, DIALOG_STYLE_INPUT, "KEYS VIP", Dialog, "Criar", "Cancelar");
  187.         }
  188.  
  189.         case DIALOG_NEW_KEY_LEVEL:
  190.         {
  191.             if(!IsNumeric(inputtext)) return SendClientMessage(playerid, VERMELHO, "ERRO: Digite uma quantidade de nivel válidos 1 a 3.");
  192.             if(strval(inputtext) < 1 || strval(inputtext) > 3) return SendClientMessage(playerid, VERMELHO, "ERRO: Digite uma quantidade de nivel válidos 1 a 3.");
  193.             PlayerInfo[playerid][vNivel] = strval(inputtext);
  194.             new Dialog[190];
  195.             format(Dialog, sizeof Dialog, "{FFFFFF}Informações de sua nova key:\n\nCódigo: {DE3A3A}%s\n{FFFFFF}Vencimento: {DE3A3A}%d dias\n{FFFFFF}Nivel: {DE3A3A}%d\n\n{FFFFFF}Deseja criar ?", PlayerInfo[playerid][vKey], PlayerInfo[playerid][vDias], PlayerInfo[playerid][vNivel]);
  196.             ShowPlayerDialog(playerid, DIALOG_KEY_CONFIRM, DIALOG_STYLE_MSGBOX, "KEYS VIP", Dialog, "Sim", "Não");
  197.         }
  198.  
  199.         case DIALOG_KEY_CONFIRM:
  200.         {
  201.             if(!response) return 1;
  202.             new query[70];
  203.             mysql_format(Connection, query, sizeof(query),"SELECT * FROM `Keys` WHERE `Key` = '%e'", PlayerInfo[playerid][vKey]);
  204.             mysql_tquery(Connection, query, "KeyCheck", "isdd", playerid, PlayerInfo[playerid][vKey], PlayerInfo[playerid][vDias], PlayerInfo[playerid][vNivel]);
  205.         }
  206.  
  207.         case DIALOG_REMOVE_KEY:
  208.         {
  209.             new query[70];
  210.             mysql_format(Connection, query, sizeof(query),"SELECT * FROM `Keys` WHERE `key` = '%e'", inputtext);
  211.             mysql_tquery(Connection, query, "DeleteKey", "is", playerid, inputtext);
  212.         }
  213.  
  214.         case DIALOG_ENABLE_KEY:
  215.         {
  216.             if(!response) return 1;
  217.             new query[70];
  218.             mysql_format(Connection, query, sizeof(query),"SELECT * FROM `Keys` WHERE `key` = '%e'", inputtext);
  219.             mysql_tquery(Connection, query, "CheckKeyExist", "is", playerid, inputtext);
  220.         }
  221.         case DIALOG_TOYS:
  222.         {
  223.             if(!response) return 1;
  224.             SendClientMessage(playerid, COR_VIP, "C-VIP: Use /tbrinq para remover o brinquedo.");
  225.             GameTextForPlayer(playerid, "~g~/tbrinquedos", 2000, 3);
  226.             switch(listitem)
  227.             {
  228.                 case 0: SetPlayerAttachedObject(playerid, 0, 19330, 2, 0.166000, -0.038999, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  229.                 case 1: SetPlayerAttachedObject(playerid, 0, 19161, 2, 0.078999, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  230.                 case 2: SetPlayerAttachedObject(playerid, 0, 18639, 2, 0.131000, 0.019000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  231.                 case 3: SetPlayerAttachedObject(playerid, 0, 18638, 2, 0.148999, 0.031000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  232.                 case 4: SetPlayerAttachedObject(playerid, 0, 18939, 2, 0.164000, 0.001999, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  233.                 case 5: SetPlayerAttachedObject(playerid, 0, 19488, 2, 0.121999, 0.000000, -0.005999, -83.199966, 98.200027, -2.500000, 1.000000, 1.000000, 1.000000);
  234.                 case 6: SetPlayerAttachedObject(playerid, 0, 19352, 2, 0.106999, 0.016000, -0.010999, 4.500000, 82.099990, -3.100001, 1.000000, 1.000000, 1.000000);
  235.                 case 7: SetPlayerAttachedObject(playerid, 0, 19090, 2, -0.315999, 0.019999, 0.030000, 0.000000, 0.000000, 0.000000, 1.455999, 0.526000, 0.541000);
  236.                 case 8: SetPlayerAttachedObject(playerid, 0, 19424, 2, 0.070999, -0.026000, -0.002000, -85.299987, 1.600005, -99.500000, 0.944001, 0.915000, 0.809999);
  237.                 case 9: SetPlayerAttachedObject(playerid, 0, 19078, 1, -1.000000,-0.517000,0.000000,0.000000,0.299999,10.499994,8.673998,9.400999,7.410993);
  238.                 case 10: SetPlayerAttachedObject(playerid,0, 19078, 4, -0.067000,0.053999,0.018000,-168.400039,-169.800003,-2.800000,1.000000,1.000000,1.000000);
  239.                 case 11: SetPlayerAttachedObject(playerid,0, 19085, 2, 0.090999,0.035000,-0.015000,106.599983,83.199996,0.800003,1.000000,1.000000,1.000000);
  240.                 case 12: SetPlayerAttachedObject(playerid,1, 19086, 15, 0.051000,0.000000,-0.424999,0.000000,0.000000,-102.100006,1.000000,1.000000,1.000000);
  241.                 case 13: SetPlayerAttachedObject(playerid,0, 19137, 2, 0.101000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
  242.                 case 14: SetPlayerAttachedObject(playerid,0, 19137, 15, 0.040999,0.000000,-0.130000,-86.300003,106.100013,-96.100051,7.741999,4.874000,5.584998);
  243.                 case 15: SetPlayerAttachedObject(playerid,0, 19315, 1, -0.247999,0.509999,-0.015999,4.300004,86.900024,85.500015,3.010000,4.463000,3.824000);
  244.                 case 16: SetPlayerAttachedObject(playerid,0, 19314, 2, 0.157000,0.000000,0.000000,-0.199999,-7.600006,-88.599998,1.000000,1.000000,1.000000);
  245.                 case 17: SetPlayerAttachedObject(playerid,0, 19314, 2, 0.157000,0.000000,0.000000,1.400000,-7.600006,-28.599973,0.711000,0.919999,0.361999);
  246.                 case 18: SetPlayerAttachedObject(playerid,0, 19320, 2, 0.000000,0.000000,0.000000,4.299999,72.999992,3.199999,3.594999,3.787999,4.951001);
  247.                 case 19: SetPlayerAttachedObject(playerid,0, 18963, 2, 0.261000,0.084999,0.004999,4.999999,85.400039,84.699974,2.097000,2.627000,3.033999);
  248.                 case 20: SetPlayerAttachedObject(playerid,0, 1607, 2, 0.267000,0.000000,0.000000,-0.199999,81.199996,-3.499999,1.135000,1.000000,1.126999);
  249.                 case 21: SetPlayerAttachedObject(playerid,0, 1608, 1, 0.000000,0.000000,0.000000,0.499999,89.200042,0.199999,1.000000,1.000000,1.000000);
  250.                 case 22: SetPlayerAttachedObject(playerid,0, 1609, 1, -0.358000,0.000000,0.170000,0.000000,93.099998,0.000000,1.427000,1.509000,1.641000);
  251.                 case 23: SetPlayerAttachedObject(playerid,0, 16442, 15, 0.000000,0.000000,0.259000,0.000000,0.000000,-104.400001,1.000000,1.000000,1.000000);
  252.                 case 24: SetPlayerAttachedObject(playerid,1, 373, 1, 0.33, -0.029, -0.15, 65, 25, 35);
  253.                 case 25: SetPlayerAttachedObject(playerid,1, 1240, 1, 0.15, 0.17, 0.06, 0.0, 90.0, 0.0);
  254.                 case 26: SetPlayerAttachedObject(playerid,1, 1252, 1, 0.1, -0.2, 0.0, 0.0, 90.0, 0.0);
  255.                 case 27: SetPlayerAttachedObject(playerid,1, 356, 1, -0.2, -0.15, 0.0, 0.0, 24.0, 0.0);
  256.                 case 28: SetPlayerAttachedObject(playerid,1 ,359, 15 ,-0.02 ,0.08 ,-0.3 ,0 ,50 ,-10);
  257.                 case 29: SetPlayerAttachedObject(playerid,0, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
  258.                 case 30: SetPlayerAttachedObject(playerid,0 ,1852 ,2 ,0.1 ,0 ,-0.01 ,0 ,15 ,0);
  259.                 case 31: SetPlayerAttachedObject(playerid,1, 1654, 1, 0.1,0.20,0.0,180.0,100.0,0.0);
  260.             }
  261.         }
  262.  
  263.         case DIALOG_EFECTS:
  264.         {
  265.             if(!response) return 1;
  266.             SendClientMessage(playerid, COR_VIP, "C-VIP: Use /tefeitos para remover o efeito.");
  267.             GameTextForPlayer(playerid, "~g~/tefeitos", 2000, 3);
  268.             switch(listitem)
  269.             {
  270.                 case 0: SetPlayerAttachedObject(playerid,1,18688,1,-0.895839,0.631365,-1.828601,21.642332,7.385670,13.958697,1.232679,1.000000,1.090367); // fire - Bruno
  271.                 case 1: SetPlayerAttachedObject(playerid,1,18742,1,0.036487,-1.759890,1.772809,225.616638,1.132580,0.677276,1.000000,1.000000,1.000000); // water_speed - explosaoaquatica
  272.                 case 2: SetPlayerAttachedObject(playerid,1,18864,1,2.178843,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000); // FakeSnow1 - neve
  273.                 case 3: SetPlayerAttachedObject(playerid,1,867,1,-0.213616,-0.444311,0.070721,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000); // p_rubble04col - pedras
  274.                 case 4: SetPlayerAttachedObject(playerid,1,1254,1,0.448984,0.065604,0.006619,4.313228,89.284942,0.000000,1.000000,1.000000,1.000000); // killfrenzy - caveira
  275.                 case 5: SetPlayerAttachedObject(playerid,1,1242,1,0.090351,0.088730,-0.000036,0.000000,89.157951,0.000000,1.619548,1.000000,1.348966); // bodyarmour - colete
  276.                 case 6: SetPlayerAttachedObject(playerid,1,18735,1,0.000000,-0.479024,-1.590823,0.000000,0.000000,0.000000,13.498819,1.000000,0.678294); // vent2 - fumaçao
  277.                 case 7: SetPlayerAttachedObject(playerid,1,19065,15,-0.025,-0.04,0.23,0,0,270,2,2,2); // Toca de Natal
  278.  
  279.                 case 8:
  280.                 {
  281.                     SetPlayerAttachedObject(playerid,1,18688,1,-0.895839,0.631365,-1.828601,21.642332,7.385670,13.958697,1.232679,1.000000,1.090367); // fire - Bruno
  282.                     SetPlayerAttachedObject(playerid,2,1254,1,0.448984,0.065604,0.006619,4.313228,89.284942,0.000000,1.000000,1.000000,1.000000); // killfrenzy - caveira
  283.                 }
  284.                 case 9:
  285.                 {
  286.                     SetPlayerAttachedObject(playerid,1,1242,1,0.090351,0.088730,-0.000036,0.000000,89.157951,0.000000,1.619548,1.000000,1.348966); // bodyarmour - colete
  287.                     SetPlayerAttachedObject(playerid,2,18735,1,0.000000,-0.479024,-1.590823,0.000000,0.000000,0.000000,13.498819,1.000000,0.678294); // vent2 - fumaçao
  288.  
  289.                 }
  290.                 case 10:
  291.                 {
  292.                     SetPlayerAttachedObject(playerid,1,867,1,-0.213616,-0.444311,0.070721,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000); // p_rubble04col - pedras
  293.                     SetPlayerAttachedObject(playerid,2,18742,1,0.036487,-1.759890,1.772809,225.616638,1.132580,0.677276,1.000000,1.000000,1.000000); // water_speed - explosaoaquatica
  294.                 }
  295.                 case 11:
  296.                 {
  297.                     SetPlayerAttachedObject(playerid,1,19065,15,-0.025,-0.04,0.23,0,0,270,2,2,2); // Toca de Natal
  298.                     SetPlayerAttachedObject(playerid,2,18864,1,2.178843,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000); // FakeSnow1 - neve
  299.                 }
  300.             }
  301.         }
  302.     }
  303.     return 1;
  304. }
  305.  
  306. // ativar key
  307. forward CheckKeyExist(playerid, Key[]);
  308. public CheckKeyExist(playerid, Key[])
  309. {
  310.     if(cache_get_row_count(Connection) == 0) return SendClientMessage(playerid, VERMELHO, "ERRO: Key inexistente.");
  311.  
  312.     new ValorDias = cache_get_field_content_int(0, "Dias");
  313.     new Nivel = cache_get_field_content_int(0, "Nivel");
  314.     SetVip(playerid, Nivel, ValorDias);
  315.  
  316.     new query[70];
  317.     mysql_format(Connection, query, sizeof(query), "DELETE FROM `Keys` WHERE `Key` = '%e'", Key);
  318.     mysql_tquery(Connection, query, "", "");
  319.     return 1;
  320. }
  321.  
  322. // criar key
  323. forward KeyCheck(playerid, Key[], Dias, Nivel);
  324. public KeyCheck(playerid, Key[], Dias, Nivel)
  325. {
  326.     if(cache_get_row_count(Connection) == 1) return SendClientMessage(playerid, VERMELHO, "ERRO: Key ja existente.");
  327.  
  328.     new query[150];
  329.     mysql_format(Connection, query, sizeof(query), "INSERT INTO `Keys` (`Key`, `Dias`, `Nivel`) VALUES ('%e', %d, %d)", Key, Dias, Nivel);
  330.     mysql_tquery(Connection, query, "KeyCreated", "isii", playerid, Key, Dias, Nivel);
  331.     return 1;
  332. }
  333.  
  334. forward KeyCreated(playerid, Key[], Dias, Nivel);
  335. public KeyCreated(playerid, Key[], Dias, Nivel)
  336. {
  337.     new MsgKeyVip[70];
  338.     SendClientMessage(playerid, LARANJA, "KEY: Nova Key VIP criada.");
  339.     format(MsgKeyVip, sizeof MsgKeyVip, "KEY: [%s] - DIAS: [%d] - NIVEL: [%d]", Key, Dias, Nivel);
  340.     SendClientMessage(playerid, LARANJA, MsgKeyVip);
  341.     return 1;
  342. }
  343.  
  344. // deletarkey
  345. forward DeleteKey(playerid, Key[]);
  346. public DeleteKey(playerid, Key[])
  347. {
  348.     if(cache_get_row_count(Connection) == 0) return SendClientMessage(playerid, VERMELHO, "ERRO: Key inexistente.");
  349.  
  350.     new query[70];
  351.     mysql_format(Connection, query, sizeof(query), "DELETE FROM `Keys` WHERE `Key` = '%e'", Key);
  352.     mysql_tquery(Connection, query, "KeyDeleted", "is", playerid, Key);
  353.     return 1;
  354. }
  355.  
  356. forward KeyDeleted(playerid, Key[]);
  357. public KeyDeleted(playerid, Key[])
  358. {
  359.     new MsgKeyVip[60];
  360.     format(MsgKeyVip, sizeof MsgKeyVip, "ADMIN: A key %s foi removida com sucesso.", Key);
  361.     SendClientMessage(playerid, LARANJA, MsgKeyVip);
  362.     return 1;
  363. }
  364.  
  365. // verificar dias
  366. forward CheckVip();
  367. public CheckVip()
  368. {
  369.     for(new i = 0; i < MAX_PLAYERS; i++)
  370.     {
  371.         if(IsPlayerConnected(i) && PlayerInfo[i][Vip] == 1)
  372.         {
  373.             if(PlayerInfo[i][TempoVip] > 0)
  374.             {
  375.                 PlayerInfo[i][TempoVip] = gettime() - ExpireVIP(i);
  376.                 } else {
  377.                 RemoveVip(i);
  378.             }
  379.         }
  380.     }
  381.     return 1;
  382. }
  383.  
  384. ExpireVIP(playerid)
  385. {
  386.     new Dias = PlayerInfo[playerid][DiasVip] * 86400; // 86400 == 24horas
  387.     return Dias;
  388. }
  389.  
  390. IsNumeric(const string[])
  391. {
  392.     for (new i = 0, j = strlen(string); i < j; i++)
  393.     {
  394.         if (string[i] > '9' || string[i] < '0') return 0;
  395.     }
  396.     return 1;
  397. }
  398.  
  399. LiberarKit(playerid)
  400. {
  401.     SendClientMessage(playerid, COR_VIP, "C-VIP: Você ja pode pegar seu KIT-VIP novamente!");
  402.     PlayerInfo[playerid][PegouKit] = false;
  403. }
  404.  
  405. LiberarColete(playerid)
  406. {
  407.     SendClientMessage(playerid, COR_VIP, "C-VIP: Você ja pode pegar seu COLETE-VIP novamente!!");
  408.     PlayerInfo[playerid][PegouColete] = false;
  409. }
  410.  
  411. VerificarNivelVip(playerid, lvl)
  412. {
  413.     if(PlayerInfo[playerid][Vip] < lvl)
  414.     {
  415.         new MsgErro[30];
  416.         format(MsgErro, sizeof(MsgErro), "ERRO: Comando indisponivel. Vip %d+", lvl);
  417.         SendClientMessage(playerid, VERMELHO, MsgErro);
  418.         return 0;
  419.     }
  420.     return 1;
  421. }
  422.  
  423. PosicaoFrentePlayer(playerid, &Float:x, &Float:y, Float:distance)
  424. {
  425.     new Float:a;
  426.     GetPlayerPos( playerid, x, y, a);
  427.     GetPlayerFacingAngle( playerid, a);
  428.     if(GetPlayerVehicleID( playerid ))
  429.     {
  430.         GetVehicleZAngle(GetPlayerVehicleID( playerid ), a);
  431.     }
  432.     x += (distance * floatsin(-a, degrees));
  433.     y += (distance * floatcos(-a, degrees));
  434. }
  435.  
  436. ShowToys(playerid)
  437. {
  438.     new string[1700];
  439.     strcat(string, "{FFFF00}-{FFFFFF} Chapéu de Bombeiro {0088FF}Slot 1 \n"); // 0
  440.     strcat(string, "{FFFF00}-{FFFFFF} Chapéu de Policial {0088FF}Slot 1 \n"); //   1
  441.     strcat(string, "{FFFF00}-{FFFFFF} Chapéu Michael Jackson {0088FF}Slot 1 \n"); // 2
  442.     strcat(string, "{FFFF00}-{FFFFFF} Chapéu Operário {0088FF}Slot 1 \n"); // 3
  443.     strcat(string, "{FFFF00}-{FFFFFF} Chapéu de Funkeiro {0088FF}Slot 1 \n"); // 4
  444.     strcat(string, "{FFFF00}-{FFFFFF} Chapéu de Veio {0088FF}Slot 1 \n"); // 5
  445.     strcat(string, "{FFFF00}-{FFFFFF} Chapéu do Harry Potter {0088FF}Slot 1 \n"); // 6
  446.     strcat(string, "{FFFF00}-{FFFFFF} Bolsa de sequestrador {0088FF}Slot 1 \n");// 7
  447.     strcat(string, "{FFFF00}-{FFFFFF} Fones de ouvido {0088FF}Slot 1 \n");// 8
  448.     strcat(string, "{FFFF00}-{FFFFFF} Loro José Gigante {0088FF}Slot 1 \n");// 9
  449.     strcat(string, "{FFFF00}-{FFFFFF} Loro José menor (Ombro) {0088FF}Slot 2 \n");// 10
  450.     strcat(string, "{FFFF00}-{FFFFFF} Tapa olho de pirata {0088FF}Slot 2 \n");// 11
  451.     strcat(string, "{FFFF00}-{FFFFFF} Dildo {0088FF}Slot 2\n");// 12
  452.     strcat(string, "{FFFF00}-{FFFFFF} Cabeça de galo {0088FF}Slot 1 \n");// 13
  453.     strcat(string, "{FFFF00}-{FFFFFF} Cabeça de galo gigante Slot 1 \n");// 14
  454.     strcat(string, "{FFFF00}-{FFFFFF} Cervo {0088FF}Slot 1 \n");// 15
  455.     strcat(string, "{FFFF00}-{FFFFFF} Chifre de boi 1 {0088FF}Slot 1 \n");// 16
  456.     strcat(string, "{FFFF00}-{FFFFFF} Chifre de boi 2 {0088FF}Slot 1 \n");// 17
  457.     strcat(string, "{FFFF00}-{FFFFFF} Fanstasia de obóbora {0088FF}Slot 1 \n");// 18
  458.     strcat(string, "{FFFF00}-{FFFFFF} Cabeção do CJ {0088FF}Slot 1 \n"); // 19
  459.     strcat(string, "{FFFF00}-{FFFFFF} Golfinho {0088FF}Slot 1 \n"); // 20
  460.     strcat(string, "{FFFF00}-{FFFFFF} Tubarão {0088FF}Slot 1 \n"); // 21
  461.     strcat(string, "{FFFF00}-{FFFFFF} Fantasia de tartaruga {0088FF}Slot 1 \n"); // 22
  462.     strcat(string, "{FFFF00}-{FFFFFF} Vaca {0088FF}Slot 1 \n"); // 23
  463.     strcat(string, "{FFFF00}-{FFFFFF} Colete no corpo {0088FF}Slot 2 \n");// 24
  464.     strcat(string, "{FFFF00}-{FFFFFF} Coração no peito {0088FF}Slot 2 \n");// 25
  465.     strcat(string, "{FFFF00}-{FFFFFF} C4 nas costas {0088FF}Slot 2 \n");// 26
  466.     strcat(string, "{FFFF00}-{FFFFFF} M4 nas costas  {0088FF}Slot 2 \n");// 27
  467.     strcat(string, "{FFFF00}-{FFFFFF} Bazzuka nas costas  {0088FF}Slot 2 \n");// 28
  468.     strcat(string, "{FFFF00}-{FFFFFF} Toca do Papai Noel  {0088FF}Slot 1 \n");// 29
  469.     strcat(string, "{FFFF00}-{FFFFFF} Dado na cabeça  {0088FF}Slot 1 \n");// 30
  470.     strcat(string, "{FFFF00}-{FFFFFF} C4 no peito  {0088FF}Slot 2 \n");// 31
  471.     ShowPlayerDialog(playerid, DIALOG_TOYS, DIALOG_STYLE_LIST, "C-VIP: Selecione para adicionar a seu skin:", string, "APLICAR", "SAIR");
  472.     return 1;
  473. }
  474.  
  475. ShowEfects(playerid)
  476. {
  477.     new string[800];
  478.     strcat(string, "{FFFF00}-{FFFFFF} Fogo na Skin {0088FF}Slot 1\n"); // 0
  479.     strcat(string, "{FFFF00}-{FFFFFF} Explosão Aquatica {0088FF}Slot 1\n"); //   1
  480.     strcat(string, "{FFFF00}-{FFFFFF} Neve {0088FF}Slot 1\n"); // 2
  481.     strcat(string, "{FFFF00}-{FFFFFF} Pedras {0088FF}Slot 1\n"); // 3
  482.     strcat(string, "{FFFF00}-{FFFFFF} Caveira {0088FF}Slot 1\n"); // 4
  483.     strcat(string, "{FFFF00}-{FFFFFF} Colete {0088FF}Slot 1\n"); // 5
  484.     strcat(string, "{FFFF00}-{FFFFFF} Fumaça {0088FF}Slot 1\n"); // 6
  485.     strcat(string, "{FFFF00}-{FFFFFF} Touca de Natal {0088FF}Slot 1\n");// 7
  486.     strcat(string, "{FFFF00}-{FFFFFF} Caveira e Fogo {0088FF}Slot 1 e 2\n");// 8
  487.     strcat(string, "{FFFF00}-{FFFFFF} Colete e Fumaça {0088FF}Slot 1 e 2\n");// 9
  488.     strcat(string, "{FFFF00}-{FFFFFF} Pedras e Explosão Aquatica {0088FF}Slot 1 e 2\n");// 10
  489.     strcat(string, "{FFFF00}-{FFFFFF} Touca de Natal e Neve {0088FF}Slot 1 e 2\n");// 11
  490.     ShowPlayerDialog(playerid, DIALOG_EFECTS, DIALOG_STYLE_LIST, "C-VIP: Selecione para adicionar a seu skin:", string, "APLICAR", "SAIR");
  491.     return 1;
  492. }
  493.  
  494. forward SendVipMessageToAll(playerid, const string[]);
  495. public SendVipMessageToAll(playerid, const string[])
  496. {
  497.     switch(PlayerInfo[playerid][Vip])
  498.     {
  499.         case 1: SendClientMessageToAll(BRONZE, string);
  500.         case 2: SendClientMessageToAll(PRATA, string);
  501.         case 3: SendClientMessageToAll(OURO, string);
  502.     }
  503.     return 1;
  504. }
  505.  
  506. forward ChatVIP(const string[]);
  507. public ChatVIP(const string[])
  508. {
  509.     for(new i = 0; i < MAX_PLAYERS; i++)
  510.     {
  511.         if(IsPlayerConnected(i) && PlayerInfo[i][Vip] > 0)
  512.         {
  513.             switch(PlayerInfo[i][Vip])
  514.             {
  515.                 case 1: SendClientMessage(i, BRONZE, string);
  516.                 case 2: SendClientMessage(i, PRATA, string);
  517.                 case 3: SendClientMessage(i, OURO, string);
  518.             }
  519.         }
  520.     }
  521.     return 1;
  522. }
  523.  
  524. // ==================== Comandos VIP nivel 1
  525.  
  526. CMD:comandosvip(playerid)
  527. {
  528.     //if(!VerificarNivelVip(playerid, 1)) return 1;
  529.     new String[800];
  530.     strcat(String, "{FFFFFF}.: COMANDOS VIP {8B5A2B}BRONZE{FFFFFF} :.\n\n");
  531.     strcat(String, "{8B5A2B} /v {FFFFFF}- Falar no modo VIP\n");
  532.     strcat(String, "{8B5A2B} /cv {FFFFFF}- Falar no chat VIP\n");
  533.     strcat(String, "{8B5A2B} /souvip {FFFFFF}- Ostentar seu VIP\n");
  534.     strcat(String, "{8B5A2B} /venc {FFFFFF}- Ver vencimento do seu VIP\n\n\n");
  535.     strcat(String, "{FFFFFF}.: COMANDOS VIP {9C9C9C}PRATA{FFFFFF} :.\n\n");
  536.     strcat(String, "{9C9C9C} /vkit {FFFFFF}- Pegar KIT-VIP\n");
  537.     strcat(String, "{9C9C9C} /vcolete {FFFFFF}- Colocar um colete\n");
  538.     strcat(String, "{9C9C9C} /vjetpack {FFFFFF}- Criar um jetpack\n");
  539.     strcat(String, "{9C9C9C} /vreparar {FFFFFF}- Reparar um veiculo\n\n\n");
  540.     strcat(String, "{FFFFFF}.: COMANDOS VIP {EEC900}OURO{FFFFFF} :.\n\n");
  541.     strcat(String, "{EEC900} /vcar {FFFFFF}- Criar carro VIP\n");
  542.     strcat(String, "{EEC900} /vbike {FFFFFF}- Criar moto VIP\n");
  543.     strcat(String, "{EEC900} /efeitos {FFFFFF}- Abre um menu de efeitos VIP\n");
  544.     strcat(String, "{EEC900} /brinquedos {FFFFFF}- Abre um menu de brinquedos VIP\n");
  545.     ShowPlayerDialog(playerid, DIALOG_COMANDOS_VIP, DIALOG_STYLE_MSGBOX, "{EEC900}C-VIP: - Comandos VIP", String, "Fechar", #);
  546.     return 1;
  547. }
  548.  
  549. CMD:venc(playerid)
  550. {
  551.     if(!VerificarNivelVip(playerid, 1)) return 1;
  552.     new String[256], Str[128];
  553.     format(Str, sizeof(Str), "{ffffff}NICK: {008B00}%s{FFFFFF} [{008B00}%d{FFFFFF}]   -   ", PlayerInfo[playerid][Nome], playerid);
  554.     strcat(String, Str);
  555.     format(Str, sizeof(Str), "{ffffff}VENCIMENTO EM: {008B00}%d {FFFFFF}DIAS\n\n", PlayerInfo[playerid][DiasVip]);
  556.     strcat(String, Str);
  557.     ShowPlayerDialog(playerid, DIALOG_VENC_VIP, DIALOG_STYLE_MSGBOX, "{EEC900}C-VIP: - Vencimento VIP ", String, "Fechar", #);
  558.     return 1;
  559. }
  560.  
  561. CMD:cv(playerid, params[])
  562. {
  563.     if(!VerificarNivelVip(playerid, 1)) return 1;
  564.     new texto[100], String[128];
  565.     if(sscanf(params, "s", texto)) return SendClientMessage(playerid, CINZA, "Use: /cv [texto]");
  566.     if(strval(texto) > 100) return SendClientMessage(playerid, VERMELHO, "ERRO: Texto muito grande, diminua por favor!");
  567.     format(String, sizeof(String), "%s {FFFF00}.:CHAT-VIP:.{FFFFFF} %s", PlayerInfo[playerid][Nome], texto);
  568.     ChatVIP(String);
  569.     return 1;
  570. }
  571.  
  572. CMD:souvip(playerid)
  573. {
  574.     if(!VerificarNivelVip(playerid, 1)) return 1;
  575.     new String[60];
  576.     format(String, sizeof(String), "-VIP » %s: Eu sou VIP, então me chupa!", PlayerInfo[playerid][Nome]);
  577.     SendVipMessageToAll(playerid, String);
  578.     return 1;
  579. }
  580.  
  581. CMD:v(playerid, params[])
  582. {
  583.     if(!VerificarNivelVip(playerid, 1)) return 1;
  584.     new texto[100], String[128];
  585.     if(sscanf(params, "s", texto)) return SendClientMessage(playerid, CINZA, "Use: /v [Texto]");
  586.  
  587.     format(String, sizeof(String), "-VIP » %s: %s", PlayerInfo[playerid][Nome], texto);
  588.     SendVipMessageToAll(playerid, String);
  589.     return 1;
  590. }
  591.  
  592. // ======================================================
  593.  
  594.  
  595. // ==================== Comandos VIP nivel 2
  596. CMD:vjetpack(playerid)
  597. {
  598.     if(!VerificarNivelVip(playerid, 2)) return 1;
  599.     if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, VERMELHO, "ERRO: Você não pode utilizar esse comando em um veículo!");
  600.     SendClientMessage(playerid, COR_VIP, "C-VIP: Jetpack criado com sucesso!");
  601.     SetPlayerSpecialAction(playerid, 2);
  602.     return 1;
  603. }
  604.  
  605. CMD:vcolete(playerid)
  606. {
  607.     if(!VerificarNivelVip(playerid, 3)) return 1;
  608.     if(PlayerInfo[playerid][PegouColete] == true) return SendClientMessage(playerid, VERMELHO, "ERRO: Você já pegou seu COLETE-VIP recentemente!");
  609.     SendClientMessage(playerid, COR_VIP, "C-VIP: Colete criado com sucesso!");
  610.     SetPlayerArmour(playerid, 100.0);
  611.     PlayerInfo[playerid][PegouColete] = true;
  612.     return 1;
  613. }
  614.  
  615. CMD:vkit(playerid)
  616. {
  617.     if(!VerificarNivelVip(playerid, 2)) return 1;
  618.     if(PlayerInfo[playerid][PegouKit] == true) return SendClientMessage(playerid, VERMELHO, "ERRO: Você já pegou seu KIT-VIP recentemente!");
  619.     SendClientMessage(playerid, COR_VIP, "C-VIP: Você pegou seu KIT-VIP com sucesso!");
  620.     GivePlayerWeapon(playerid,  4, 99999);
  621.     GivePlayerWeapon(playerid, 24, 99999);
  622.     GivePlayerWeapon(playerid, 26, 99999);
  623.     GivePlayerWeapon(playerid, 31, 99999);
  624.     GivePlayerWeapon(playerid, 32, 99999);
  625.     GivePlayerWeapon(playerid, 34, 99999);
  626.  
  627.     PlayerInfo[playerid][PegouKit] = true;
  628.     return 1;
  629. }
  630.  
  631. CMD:vreparar(playerid)
  632. {
  633.     if(!VerificarNivelVip(playerid, 2)) return 1;
  634.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, VERMELHO, "ERRO: Você não pode utilizar esse comando fora de um veículo!");
  635.     SendClientMessage(playerid, COR_VIP, "C-VIP: Veiculo reparado com sucesso!");
  636.     RepairVehicle(GetPlayerVehicleID(playerid));
  637.     return 1;
  638. }
  639.  
  640. // ======================================================
  641.  
  642.  
  643. // ==================== Comandos VIP nivel 3
  644.  
  645. CMD:vcar(playerid, params[])
  646. {
  647.     if(!VerificarNivelVip(playerid, 3)) return 1;
  648.     new Cor1, Cor2, idcarro;
  649.     if(sscanf(params, "ii", Cor1, Cor2)) return SendClientMessage(playerid, CINZA, "Use: /vcar [Cor1] [Cor2]");
  650.     new Float:X, Float:Y, Float:Z, Float:X1, Float:Y1, Float:A;
  651.     PosicaoFrentePlayer(playerid, X, Y, 3);
  652.     GetPlayerPos(playerid, X1, Y1, Z);
  653.     GetPlayerFacingAngle(playerid, A);
  654.     idcarro = AddStaticVehicle(411, X, Y, Z, A+90, Cor1, Cor2);
  655.     CarrosCriados[TodosCarros] = idcarro;
  656.     TodosCarros ++;
  657.     SendClientMessage(playerid, COR_VIP, "C-VIP: Veiculo VIP criado com sucesso!");
  658.     return 1;
  659. }
  660.  
  661. CMD:vbike(playerid, params[])
  662. {
  663.     if(!VerificarNivelVip(playerid, 3)) return 1;
  664.     new Cor1, Cor2, idcarro;
  665.     if(sscanf(params, "ii", Cor1, Cor2)) return SendClientMessage(playerid, CINZA, "Use: /vbike [Cor1] [Cor2]");
  666.     new Float:X, Float:Y, Float:Z, Float:X1, Float:Y1, Float:A;
  667.     PosicaoFrentePlayer(playerid, X, Y, 3);
  668.     GetPlayerPos(playerid, X1, Y1, Z);
  669.     GetPlayerFacingAngle(playerid, A);
  670.     idcarro = AddStaticVehicle(522, X, Y, Z, A+90, Cor1, Cor2);
  671.     CarrosCriados[TodosCarros] = idcarro;
  672.     TodosCarros ++;
  673.     SendClientMessage(playerid, COR_VIP, "C-VIP: Moto VIP criada com sucesso!");
  674.     return 1;
  675. }
  676.  
  677. CMD:brinquedos(playerid)
  678. {
  679.     if(!VerificarNivelVip(playerid, 3)) return 1;
  680.     if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, VERMELHO, "ERRO: Você não pode utilizar esse comando em um veículo!");
  681.     SendClientMessage(playerid, COR_VIP, "C-VIP: Lista de Brinquedos.");
  682.     ShowToys(playerid);
  683.     return 1;
  684. }
  685.  
  686. CMD:tbrinquedos(playerid)
  687. {
  688.     if(!VerificarNivelVip(playerid, 3)) return 1;
  689.     for(new i=0; i< MAX_PLAYER_ATTACHED_OBJECTS; i++)
  690.     {
  691.         if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
  692.     }
  693.     SendClientMessage(playerid, COR_VIP, "C-VIP: Brinquedos removidos com sucesso!");
  694.     return 1;
  695. }
  696.  
  697. CMD:efeitos(playerid)
  698. {
  699.     if(!VerificarNivelVip(playerid, 3)) return 1;
  700.     if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, VERMELHO, "ERRO: Você não pode utilizar esse comando em um veículo!");
  701.     SendClientMessage(playerid, COR_VIP, "C-VIP: Lista de Efeitos.");
  702.     ShowEfects(playerid);
  703.     return 1;
  704. }
  705.  
  706. CMD:tefeitos(playerid)
  707. {
  708.     if(!VerificarNivelVip(playerid, 3)) return 1;
  709.     RemovePlayerAttachedObject(playerid, 1); // Remoçao dos Efeitos
  710.     RemovePlayerAttachedObject(playerid, 2); // Remoçao dos Efeitos2
  711.     SendClientMessage(playerid, COR_VIP, "C-VIP: Efeitos removidos com sucesso!");
  712.     return 1;
  713. }
  714.  
  715. // ======================================================
  716.  
  717.  
  718. // ==================== Comandos PLAYER
  719.  
  720. CMD:ativarvip(playerid)
  721. {
  722.     SendClientMessage(playerid, COR_VIP, "C-VIP: Adicione uma Key valída para ativar o VIP.");
  723.     ShowPlayerDialog(playerid, DIALOG_ENABLE_KEY, DIALOG_STYLE_INPUT, "VIP", "\nNos informe sua key para ativar seu beneficio VIP:\n\n", "Ativar", "Sair");
  724.     return 1;
  725. }
  726.  
  727. CMD:vips(playerid)
  728. {
  729.     new ContVIP = 0, String[1000], Str[128];
  730.     for(new i = 0; i < MAX_PLAYERS; i++)
  731.     {
  732.         if(IsPlayerConnected(i) && PlayerInfo[i][Vip] > 0)
  733.         {
  734.             format(Str, sizeof(Str), ".:: VIP ON ::.  {008B00}%s {FFFFFF}   [{008B00}%i{FFFFFF}]\n", PlayerInfo[i][Nome], i);
  735.             strcat(String, Str);
  736.             ContVIP++;
  737.         }
  738.     }
  739.     if(ContVIP == 0)
  740.     {
  741.         ShowPlayerDialog(playerid, DIALOG_VIPS, DIALOG_STYLE_MSGBOX, "{EEC900}C-VIP: - VIPs Online", "{FF0000}Nenhum VIP online no momento!", "Fechar", #);
  742.     } else {
  743.         ShowPlayerDialog(playerid, DIALOG_VIPS, DIALOG_STYLE_MSGBOX, "{EEC900}C-VIP: - VIPs Online", String, "Fechar", #);
  744.     }
  745.     return 1;
  746. }
  747. // ======================================================
  748.  
  749.  
  750. // ==================== Comandos ADMIN RCON
  751.  
  752. CMD:criarkey(playerid)
  753. {
  754.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO,"ERRO: Comando indisponivel. Admin RCON");
  755.     ShowPlayerDialog(playerid, DIALOG_NEW_KEY, DIALOG_STYLE_INPUT, "KEYS VIP", "\nDigite uma nova key válida\n{FFFF00}Apenas letras são aceitas:\n\n", "Criar", "Cancelar");
  756.     return 1;
  757. }
  758.  
  759. CMD:removerkey(playerid)
  760. {
  761.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO,"ERRO: Comando indisponivel. Admin RCON");
  762.     ShowPlayerDialog(playerid, DIALOG_REMOVE_KEY, DIALOG_STYLE_INPUT, "KEYS VIP", "\nDigite a Key que deseja Remover:\n\n", "Remover", "Cancelar");
  763.     return 1;
  764. }
  765.  
  766. CMD:darvip(playerid, params[])
  767. {
  768.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO,"ERRO: Comando indisponivel. Admin RCON");
  769.     new Nivel, Dias, ID;
  770.     if(sscanf(params, "udd", ID, Nivel, Dias)) return SendClientMessage(playerid, CINZA, "ADMIN: Use /darvip [ID] [Nivel] [Dias]");
  771.     if(Nivel < 1 || Nivel > 3) return SendClientMessage(playerid, VERMELHO, "ERRO: Nivel Inválido! Disponível de 1 a 3.");
  772.     if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, VERMELHO, "ERRO: Jogador não conectado.");
  773.     SendClientMessage(playerid, LARANJA, "ADMIN: Comando efetuado com sucesso !");
  774.     SetVip(ID, Nivel, Dias);
  775.     return 1;
  776. }
  777.  
  778. CMD:removervip(playerid, params[])
  779. {
  780.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO,"ERRO: Comando indisponivel. Admin RCON");
  781.     new Motivo[100], Msg[128], ID;
  782.     if(sscanf(params, "us", ID, Motivo)) return SendClientMessage(playerid, CINZA, "ADMIN: Use /tirarvipmysql_escape_string() [ID] [Motivo]");
  783.     if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, VERMELHO, "ERRO: Jogador não conectado.");
  784.     format(Msg, sizeof Msg, "C-VIP: O admin %s retirou seu VIP. Motivo: %s.", PlayerInfo[playerid][Nome], Motivo);
  785.     SendClientMessage(ID, COR_VIP, Msg);
  786.     RemoveVip(ID);
  787.     SendClientMessage(playerid, LARANJA, "ADMIN: Comando efetuado com sucesso !");
  788.     return 1;
  789. }
  790.  
  791. CMD:respawn(playerid)
  792. {
  793.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO,"ERRO: Comando indisponivel. Admin RCON");
  794.     new String[70];
  795.     format(String, sizeof(String), "ADMIN: O Admin %s deu respawn em todos os veiculos VIP criados!", PlayerInfo[playerid][Nome]);
  796.     SendClientMessageToAll(LARANJA, String);
  797.     SendClientMessage(playerid, LARANJA, "ADMIN: Todos os veiculos VIP criados foram destruidos!");
  798.     for(new i = 0; i < sizeof(CarrosCriados); i++) DestroyVehicle(CarrosCriados[i]);
  799.     return 1;
  800. }
  801. // ======================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement