Advertisement
Guest User

VIP SYSTEM - UP.1.3

a guest
Mar 3rd, 2014
805
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 18.57 KB | None | 0 0
  1. /*
  2.  
  3.     #######################################################################################
  4.     ###                                                                                 ###
  5.     ###                                 Sistema VIP                                     ###
  6.     ###                                                                                 ###
  7.     ###         Todos os scripts feitos aqui são te total autoria do criador.          ###
  8.     ###         Este script está livre para edição e implementação em gamemodes.       ###
  9.     ###                                                                                 ###
  10.     ###                     Mantenha os devidos creditos no script.                     ###
  11.     ###                                                                                 ###
  12.     ###                      Criador, desenvolvedor e tester: Dry.                      ###
  13.     ###                                                                                 ###
  14.     #######################################################################################
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.     Funções:
  22.  
  23.         - IsPlayerVIP(playerid)                 - Chechar se um jogador é VIP.
  24.         - LoadPlayerVIP(playerid)               - Carregar dados de VIP de um jogador a partir do arquivo.
  25.         - SavePlayerVIP(playerid)               - Salvar dados de VIP dentro do arquivo.
  26.         - CreateVipKey(playerid, Key[], Days)   - Criar uma nova Key.
  27.         - UseVipKey(playerid, Key[])            - Usar determinada key.
  28.         - RemoveKey(playerid, Key[])            - Deletar uma key existente e não usada.
  29.         - GetExpirationDays(playerid)           - Getar quantos dias faltam para expirar o VIP.
  30.         - SetVipForPlayer(playerid, Days)       - Setar ou renovar o VIP de algum jogador.
  31.         - ShowWelcomeMessage(playerid)          - Abre uma mensagem de boas vindas, contendo algumas info.
  32.  
  33.     Comandos:
  34.  
  35.         - CMD:setvip [ID] [DIAS]        ( Admin )  // Setamos um jogador como VIP
  36.         - CMD:viphelp                   ( VIP )     // Algumas informações sobre o seu VIP.
  37.         - CMD:ativarvip                 ( Default )// Um dialog será aberto solicitando o código.
  38.         - CMD:novakey                   ( Admin ) // Uma nova key será criada na pasta "Keys" para livre uso.
  39.         - CMD:delkey [KEY]              ( Admin ) // Deletar uma key existente
  40.         - CMD:vips                      ( Default ) // Checar jogadores VIP online.
  41.  
  42.     Configurações:
  43.  
  44.         #define CHAT_MODEL 3                    - Modelo ao falar no chat. Preview In-Forúm
  45.         #define FULL_LIFE 1                     - Spawnar com COLETE E VIDA FULL
  46.         #define DEATH_RESPAWN_LOCAL 1           - Spawnar no local onde morreu
  47.  
  48.     Instalação:
  49.  
  50.         - Crie uma pasta chamada "Vips" localizada em scriptfiles.
  51.         - Dentro da mesma crie as seguintas pastas:
  52.  
  53.         * Users
  54.         * Keys
  55.  
  56.         - O precesso de criação de VIP's e keys é automatico, siga os passos e comandos dentro do game.
  57.         -Atenciosamente Dry ( Lucas ).
  58.  
  59. */
  60.  
  61. #include <a_samp>
  62. #include <dof2>
  63. #include <zcmd>
  64. #include <sscanf>
  65.  
  66. #define ENGINE::%0(%1) stock %0(%1)
  67. #define Public::%0(%1) forward %0(%1); public %0(%1)
  68.  
  69. #define DIALOG_ATIV_KEY 779
  70. #define DIALOG_MAKE_KEY 779+1
  71. #define DIALOG_MAKE_DAYS 779+2
  72. #define DIALOG_CONFIRM 779+3
  73.  
  74. //Folder's
  75.  
  76. #define VIP_USERS "Vips/Users/%s.ini"
  77. #define VIP_KEYS "Vips/Keys/%s.ini"
  78.  
  79. //Colors
  80.  
  81. #define Default 0xDE3A3AFF
  82. #define Branco  0xFFFFFFFF
  83.  
  84. //Config
  85.  
  86. #define CHAT_MODEL 3
  87. #define FULL_LIFE 1
  88. #define DEATH_RESPAWN_LOCAL 1
  89.  
  90. #if DEATH_RESPAWN_LOCAL == 1// Usado para armazenar Locais de onde morreu
  91.  
  92. new Float: X[MAX_PLAYERS], Float: Y[MAX_PLAYERS], Float: Z[MAX_PLAYERS], Interior[MAX_PLAYERS];
  93.  
  94. #endif
  95.  
  96. //Player Definitions
  97.  
  98. enum PlayerParams
  99. {
  100.     bool:VIP,
  101.     dExpiration,
  102.     hExpiration
  103. };
  104.  
  105. new Player[MAX_PLAYERS][PlayerParams];
  106. new bool:VisibleWelcome[MAX_PLAYERS];
  107. new Text:DrawWelcome[MAX_PLAYERS][6];
  108. new TimerDraw[MAX_PLAYERS];
  109. new cKey[MAX_PLAYERS][128], cDays[MAX_PLAYERS];
  110.  
  111. public OnFilterScriptInit()
  112. {
  113.     for ( new playerid = 0; playerid < GetMaxPlayers(); playerid++)
  114.     {
  115.         if ( IsPlayerConnected(playerid))
  116.         {
  117.             LoadPlayerVIP(playerid);
  118.         }
  119.     }
  120.     SetTimer("CheckVipsInGame", 60000, true);
  121.     print("VIP System Loaded");
  122.     return 1;
  123. }
  124.  
  125. Public::CheckVipsInGame()
  126. {
  127.     for ( new playerid = 0; playerid < GetMaxPlayers(); playerid++)
  128.     {
  129.         if ( IsPlayerConnected(playerid) && IsPlayerVIP(playerid))
  130.         {
  131.             if ( GetExpirationDays(playerid) <= 0)
  132.             {
  133.                 SetVipForPlayer(playerid, 0);
  134.             }
  135.         }
  136.     }
  137. }
  138.  
  139. public OnFilterScriptExit()
  140. {
  141.     for ( new playerid = 0; playerid < GetMaxPlayers(); playerid++) HiddenWelcome(playerid);
  142.     print("VIP System UnLoaded.");
  143.     return 1;
  144. }
  145.  
  146. public OnPlayerConnect(playerid)
  147. {
  148.     LoadPlayerVIP(playerid);
  149.     return 1;
  150. }
  151.  
  152. public OnPlayerDisconnect(playerid, reason)
  153. {
  154.     HiddenWelcome(playerid);
  155.     Player[playerid][VIP] = false;
  156.     return 1;
  157. }
  158.  
  159. public OnPlayerSpawn(playerid)
  160. {
  161.     if ( IsPlayerVIP(playerid))
  162.     {
  163.         #if FULL_LIFE == 1
  164.         {
  165.             SetPlayerHealth(playerid, 100.0);
  166.             SetPlayerArmour(playerid, 100.0);
  167.         }
  168.         #endif
  169.         #if DEATH_RESPAWN_LOCAL == 1
  170.         {
  171.             SetPlayerInterior(playerid, Interior[playerid]);
  172.             SetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
  173.         }
  174.         #endif
  175.     }
  176.     return 1;
  177. }
  178.  
  179. public OnPlayerDeath(playerid, killerid, reason)
  180. {
  181.     #if DEATH_RESPAWN_LOCAL == 1
  182.     {
  183.         if ( IsPlayerVIP(playerid))
  184.         {
  185.             GetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
  186.             Interior[playerid] = GetPlayerInterior(playerid);
  187.         }
  188.     }
  189.     #endif
  190.     return 1;
  191. }
  192.  
  193. public OnPlayerText(playerid, text[])
  194. {
  195.     if ( IsPlayerVIP(playerid))
  196.     {
  197.         new Name[24];
  198.         GetPlayerName(playerid, Name, 24);
  199.         #if CHAT_MODEL == 1
  200.         {
  201.             new dStr[128];
  202.             format ( dStr, 128, "[%d]%s[V.I.P]: {FFFFFF}%s", playerid, Name, text);
  203.             SendClientMessageToAll(GetPlayerColor(playerid), dStr);
  204.             return 0;
  205.         }
  206.         #endif
  207.         #if CHAT_MODEL == 2
  208.         {
  209.             new dStr[128];
  210.             format ( dStr, 128, "%s[%d][V.I.P]: {FFFFFF}%s", Name, playerid, text);
  211.             SendClientMessageToAll(GetPlayerColor(playerid), dStr);
  212.             return 0;
  213.         }
  214.         #endif
  215.         #if CHAT_MODEL == 3
  216.         {
  217.             new dStr[128];
  218.             format ( dStr, 128, "{F9BD0B}VIP {FFFFFF}%s diz: {FFFFFF}%s", Name, text);
  219.             SendClientMessageToAll(GetPlayerColor(playerid), dStr);
  220.             return 0;
  221.         }
  222.         #endif
  223.     }
  224.     return 1;
  225. }
  226.  
  227. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  228. {
  229.     if ( dialogid == DIALOG_ATIV_KEY && response)
  230.     {
  231.         UseVipKey(playerid, inputtext);
  232.         return 1;
  233.     }
  234.     if ( dialogid == DIALOG_MAKE_KEY && response )
  235.     {
  236.         format ( cKey[playerid], 128, inputtext);
  237.         new Str[128];
  238.         format ( Str, sizeof Str, "{FFFFFF}Seu novo codigo VIP: {DE3A3A}%s\n\n{FFFFFF}Agora nos informe a quantidade de dias do VIP:", cKey[playerid]);
  239.         ShowPlayerDialog(playerid, DIALOG_MAKE_DAYS, DIALOG_STYLE_INPUT, "Criação de Nova Key", Str, "Criar", "Cancelar");
  240.         return true;
  241.     }
  242.     if ( dialogid == DIALOG_MAKE_DAYS && response )
  243.     {
  244.         if ( !IsNumeric(inputtext)) return SendClientMessage(playerid, Default, "Dias são compostos de números.");
  245.         cDays[playerid] = strval(inputtext);
  246.         new Str[500];
  247.         format ( Str, sizeof Str,  "{FFFFFF}Informações de sua nova key:\n\nCódigo: {DE3A3A}%s\n{FFFFFF}Vencimento: {DE3A3A}%d dias\n\n{FFFFFF}Deseja criar ?", cKey[playerid], cDays[playerid]);
  248.         ShowPlayerDialog(playerid, DIALOG_CONFIRM, DIALOG_STYLE_MSGBOX, "{FFFFFF}Criação de Nova Key",Str, "Sim", "Não");
  249.         return 1;
  250.     }
  251.     if ( dialogid == DIALOG_CONFIRM && response)
  252.     {
  253.         CreateVipKey(playerid, cKey[playerid], cDays[playerid]);
  254.         return 1;
  255.     }
  256.     return 1;
  257. }
  258. CMD:ativarvip(playerid)
  259. {
  260.     ShowPlayerDialog(playerid, DIALOG_ATIV_KEY, DIALOG_STYLE_INPUT, "{FFFFFF}Ativar VIP", "{FFFFFF}Bem vindo.\nNos informe sua key para ativar seu beneficio VIP:", "Ativar", "Sair");
  261.     return 1;
  262. }
  263.  
  264. CMD:novakey(playerid, params[])
  265. {
  266.     if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Default, "Você não tem perissão para isso.");
  267.     ShowPlayerDialog(playerid, DIALOG_MAKE_KEY, DIALOG_STYLE_INPUT, "{FFFFFF}Criação de Nova Key", "{FFFFFF}Nos informe um novo código VIP:", "Criar", "Cancelar");
  268.     return 1;
  269. }
  270.  
  271. CMD:viphelp(playerid)
  272. {
  273.     if ( !IsPlayerVIP(playerid)) return SendClientMessage(playerid, Default, "[Erro]{FFFFFF} Você não é vip.");
  274.     new Str[1028]; format ( Str, sizeof Str, "{FFFFFF}Confira aqui comandos e status do seu VIP.\n\nSeu VIP expira em: %d dias.\n\nContate um administrador para renovar seu plano.", GetExpirationDays(playerid));
  275.     ShowPlayerDialog(playerid, 775+1, DIALOG_STYLE_MSGBOX, "{FFFFFF}Informações do VIP", Str, "Sair", "");
  276.     return 1;
  277. }
  278.  
  279. CMD:delkey(playerid, params[])
  280. {
  281.     if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Default, "Você não tem perissão para isso.");
  282.     new Key[128];
  283.     if ( sscanf ( params, "s", Key)) return SendClientMessage(playerid, Default, "[Erro]{FFFFFF} Nos informe o nome da key.");
  284.     RemoveKey(playerid, Key);
  285.     return 1;
  286. }
  287.  
  288. CMD:setvip(playerid, params[])
  289. {
  290.     if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Você não tem permissão para isso.");
  291.     new Nome, Dias;
  292.     if ( sscanf ( params, "id", Nome, Dias)) return SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Use: /setvip [ID/NAME] [DIAS]");
  293.     SetVipForPlayer(Nome, Dias);
  294.     return 1;
  295. }
  296.  
  297. CMD:vips(playerid)
  298. {
  299.     new Name[24], Str[128];
  300.     SendClientMessage(playerid, Default, "VIP's Online:");
  301.     for ( new i = 0; i < GetMaxPlayers(); i++)
  302.     {
  303.         if ( IsPlayerConnected(i) && IsPlayerVIP(i))
  304.         {
  305.             GetPlayerName(i, Name, 24);
  306.             format ( Str, sizeof Str, "[V.I.P]{FFFFFF} %s ID: %d", Name, i);
  307.             SendClientMessage(i, Default, Str);
  308.         }
  309.     }
  310.     return 1;
  311. }
  312.  
  313. ENGINE::IsPlayerVIP(playerid)
  314. {
  315.     if ( Player[playerid][VIP] == false ) return 0;
  316.     return 1;
  317. }
  318.  
  319. ENGINE::LoadPlayerVIP(playerid)
  320. {
  321.     new Name[24], dStr[128];
  322.     GetPlayerName(playerid, Name, sizeof Name);
  323.     format ( dStr, sizeof dStr, VIP_USERS, Name);
  324.     if ( !DOF2::FileExists(dStr)) return true;
  325.     Player[playerid][VIP] = true;
  326.     Player[playerid][dExpiration] = DOF2::GetInt(dStr, "Day_Expiration");
  327.     Player[playerid][hExpiration] = DOF2::GetInt(dStr, "Hour_Expiration");
  328.     ShowWelcomeMessage(playerid);
  329.     return true;
  330. }
  331.  
  332. ENGINE::SavePlayerVIP(playerid)
  333. {
  334.     if ( IsPlayerVIP(playerid))
  335.     {
  336.         new Name[24], Str[128];
  337.         GetPlayerName(playerid, Name, 24);
  338.         format ( Str, sizeof Str, VIP_USERS, Name);
  339.         if ( !DOF2::FileExists(Str)) DOF2::CreateFile(Str);
  340.         if ( !DOF2::FileExists(Str)) return printf ( "O arquivo de VIP %s não pode ser criado ( PASTA INEXISTENTE )", Name);
  341.         DOF2::SetInt(Str, "Day_Expiration", Player[playerid][dExpiration]);
  342.         DOF2::SetInt(Str, "Hour_Expiration", Player[playerid][hExpiration]);
  343.         DOF2::SaveFile();
  344.     }
  345.     return 1;
  346. }
  347.  
  348. ENGINE::CreateVipKey(playerid, Key[], Days)
  349. {
  350.     new Str[128];
  351.     format ( Str, sizeof Str, VIP_KEYS, Key);
  352.     if ( DOF2::FileExists(Str))
  353.     {
  354.         new Dayss = DOF2::GetInt(Str, "VIP_Days");
  355.         format ( Str, sizeof Str, "[Erro]{FFFFFF} [ %s ] - [ %d dias ]",Key, Dayss);
  356.         SendClientMessage(playerid, Default, "[Erro] {FFFFFF}Um codigo semelhante ja está criado.");
  357.         SendClientMessage(playerid, Default, Str);
  358.         return 1;
  359.     }
  360.     if ( Days <= 0) return SendClientMessage(playerid, Default, "[Erro]{FFFFFF} Impossível realizar esta operação.");
  361.     DOF2::CreateFile(Str);
  362.     DOF2::SetInt(Str, "VIP_Days", Days);
  363.     DOF2::SaveFile();
  364.     format ( Str, sizeof Str, "[VIP]{FFFFFF} [ %s ] - [ %d dias ]", Key, Days);
  365.     SendClientMessage(playerid, Default, "[VIP]{FFFFFF} Um novo código VIP foi criado.");
  366.     SendClientMessage(playerid, Default, "[VIP]{FFFFFF} Use /ativarvip para usa-lo");
  367.     SendClientMessage(playerid, Default, Str);
  368.     return 1;
  369. }
  370.  
  371. ENGINE::UseVipKey(playerid, Key[])
  372. {
  373.     new Str[128];
  374.     format ( Str, sizeof Str, VIP_KEYS, Key);
  375.     if ( !DOF2::FileExists(Str))
  376.     {
  377.         SendClientMessage(playerid, Default, "************************************************");
  378.         SendClientMessage(playerid, Default, " O codigo fornecido já foi usado ou não existe.");
  379.         SendClientMessage(playerid, Default, " Não tem um código VIP ? Contate um adminstrador.");
  380.         SendClientMessage(playerid, Default, "************************************************");
  381.         return 1;
  382.     }
  383.     new Days = DOF2::GetInt(Str, "VIP_Days");
  384.     SetVipForPlayer(playerid, Days);
  385.     DOF2::RemoveFile(Str);
  386.     new Name[24]; GetPlayerName(playerid, Name, 24);
  387.     printf ("O jogador %s ativou o codigo %s com %d dias", Name, Key, Days);
  388.     return 1;
  389. }
  390.  
  391. ENGINE::RemoveKey(playerid, Key[])
  392. {
  393.     new Str[128];
  394.     format ( Str, sizeof Str, VIP_KEYS, Key);
  395.     if ( !DOF2::FileExists(Str)) return SendClientMessage(playerid, Default, "Key Inexistente");
  396.     DOF2::RemoveFile(Str);
  397.     format (Str, sizeof Str, "[VIP KEY]{FFFFFF} O codigo %s foi removido.", Key);
  398.     SendClientMessage(playerid, Default, Str);
  399.     return 1;
  400. }
  401.  
  402. ENGINE::GetExpirationDays(playerid)
  403. {
  404.     new Days = 0;
  405.     if ( IsPlayerVIP(playerid))
  406.     {
  407.         Days = Player[playerid][dExpiration] - getdate();
  408.     }
  409.     return Days;
  410. }
  411.  
  412. ENGINE::SetVipForPlayer(playerid, Days)
  413. {
  414.     if ( !IsPlayerConnected(playerid)) return 1;
  415.     if ( Days == 0 )
  416.     {
  417.         new Nome[24], Str[128];
  418.         GetPlayerName(playerid, Nome, 24);
  419.         format ( Str, sizeof Str, VIP_USERS, Nome);
  420.         DOF2::RemoveFile(Str);
  421.         Player[playerid][VIP] = false;
  422.         SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Informamos que seu VIP expirou.");
  423.         SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Contate um administrador o mais rapido possível para renova-lo.");
  424.         SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Obrigado por colaborar com nosso servidor.");
  425.         return 1;
  426.     }
  427.     new Str[128];
  428.     if ( Player[playerid][VIP] == true )
  429.     {
  430.         format ( Str, sizeof Str, "[Vip] {FFFFFF}Seu VIP foi renovado. ( %d dias )", Days);
  431.         Player[playerid][dExpiration] += Days;
  432.         Player[playerid][hExpiration] = gettime();
  433.     }
  434.     else
  435.     {
  436.         format ( Str, sizeof Str, "[Vip] {FFFFFF}Seu VIP foi ativado. ( %d dias )", Days);
  437.         Player[playerid][dExpiration] = getdate() + Days;
  438.         Player[playerid][hExpiration] = gettime();
  439.     }
  440.     Player[playerid][VIP] = true;
  441.     SavePlayerVIP(playerid);
  442.     SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Obrigado por adquirir nosso plano VIP.");
  443.     SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Use: /viphelp para mais informações.");
  444.     SendClientMessage(playerid, Default, Str);
  445.     return 1;
  446. }
  447.  
  448. ENGINE::ShowWelcomeMessage(playerid)
  449. {
  450.     if ( IsPlayerVIP(playerid))
  451.     {
  452.         if ( VisibleWelcome[playerid] == false )
  453.         {
  454.             DrawWelcome[playerid][0]                    =TextDrawCreate(579.000000, 301.000000, "_");
  455.             TextDrawBackgroundColor     (DrawWelcome[playerid][0], 255);
  456.             TextDrawFont                (DrawWelcome[playerid][0], 1);
  457.             TextDrawLetterSize          (DrawWelcome[playerid][0], 0.500000, 7.199999);
  458.             TextDrawColor               (DrawWelcome[playerid][0], -1);
  459.             TextDrawSetOutline          (DrawWelcome[playerid][0], 0);
  460.             TextDrawSetProportional     (DrawWelcome[playerid][0], 1);
  461.             TextDrawSetShadow           (DrawWelcome[playerid][0], 1);
  462.             TextDrawUseBox              (DrawWelcome[playerid][0], 1);
  463.             TextDrawBoxColor            (DrawWelcome[playerid][0], -1010580690);
  464.             TextDrawTextSize            (DrawWelcome[playerid][0], 433.000000, 0.000000);
  465.  
  466.             DrawWelcome[playerid][1]                    =TextDrawCreate(579.000000, 301.000000, "_");
  467.             TextDrawBackgroundColor     (DrawWelcome[playerid][1], 255);
  468.             TextDrawFont                (DrawWelcome[playerid][1], 1);
  469.             TextDrawLetterSize          (DrawWelcome[playerid][1], 0.500000, 0.899999);
  470.             TextDrawColor               (DrawWelcome[playerid][1], -1);
  471.             TextDrawSetOutline          (DrawWelcome[playerid][1], 0);
  472.             TextDrawSetProportional     (DrawWelcome[playerid][1], 1);
  473.             TextDrawSetShadow           (DrawWelcome[playerid][1], 1);
  474.             TextDrawUseBox              (DrawWelcome[playerid][1], 1);
  475.             TextDrawBoxColor            (DrawWelcome[playerid][1], -1010580685);
  476.             TextDrawTextSize            (DrawWelcome[playerid][1], 433.000000, 0.000000);
  477.  
  478.             DrawWelcome[playerid][2]                    =TextDrawCreate(437.000000, 301.000000, "Bem Vindo Novamente");
  479.             TextDrawBackgroundColor     (DrawWelcome[playerid][2], -1010580736);
  480.             TextDrawFont                (DrawWelcome[playerid][2], 2);
  481.             TextDrawLetterSize          (DrawWelcome[playerid][2], 0.159999, 0.899999);
  482.             TextDrawColor               (DrawWelcome[playerid][2], -1);
  483.             TextDrawSetOutline          (DrawWelcome[playerid][2], 0);
  484.             TextDrawSetProportional     (DrawWelcome[playerid][2], 1);
  485.             TextDrawSetShadow           (DrawWelcome[playerid][2], 1);
  486.  
  487.             DrawWelcome[playerid][3]                    =TextDrawCreate(437.000000, 318.000000, "Seu VIP ainda esta ativo.");
  488.             TextDrawBackgroundColor     (DrawWelcome[playerid][3], -1010580736);
  489.             TextDrawFont                (DrawWelcome[playerid][3], 2);
  490.             TextDrawLetterSize          (DrawWelcome[playerid][3], 0.149999, 0.799999);
  491.             TextDrawColor               (DrawWelcome[playerid][3], -1);
  492.             TextDrawSetOutline          (DrawWelcome[playerid][3], 0);
  493.             TextDrawSetProportional     (DrawWelcome[playerid][3], 1);
  494.             TextDrawSetShadow           (DrawWelcome[playerid][3], 1);
  495.  
  496.             DrawWelcome[playerid][4]                    =TextDrawCreate(437.000000, 329.000000, "Use: /viphelp para mais info.");
  497.             TextDrawBackgroundColor     (DrawWelcome[playerid][4], -1010580736);
  498.             TextDrawFont                (DrawWelcome[playerid][4], 2);
  499.             TextDrawLetterSize          (DrawWelcome[playerid][4], 0.149999, 0.799999);
  500.             TextDrawColor               (DrawWelcome[playerid][4], -1);
  501.             TextDrawSetOutline          (DrawWelcome[playerid][4], 0);
  502.             TextDrawSetProportional     (DrawWelcome[playerid][4], 1);
  503.             TextDrawSetShadow           (DrawWelcome[playerid][4], 1);
  504.  
  505.             DrawWelcome[playerid][5]                    =TextDrawCreate(437.000000, 356.000000, "Seu vip expira em: ... dias");
  506.             TextDrawBackgroundColor     (DrawWelcome[playerid][5], -1010580736);
  507.             TextDrawFont                (DrawWelcome[playerid][5], 2);
  508.             TextDrawLetterSize          (DrawWelcome[playerid][5], 0.149999, 0.799999);
  509.             TextDrawColor               (DrawWelcome[playerid][5], -1);
  510.             TextDrawSetOutline          (DrawWelcome[playerid][5], 0);
  511.             TextDrawSetProportional     (DrawWelcome[playerid][5], 1);
  512.             TextDrawSetShadow           (DrawWelcome[playerid][5], 1);
  513.             new Str[128];
  514.             format ( Str, sizeof Str, "Seu VIP expira em: %d dias.", GetExpirationDays(playerid));
  515.             TextDrawSetString(DrawWelcome[playerid][5], Str);
  516.             for ( new t = 0; t < 6; t++) TextDrawShowForPlayer(playerid, DrawWelcome[playerid][t]);
  517.             VisibleWelcome[playerid] = true;
  518.             TimerDraw[playerid] = SetTimerEx("HiddenWelcome", 6000, false, "i", playerid);
  519.             if ( GetExpirationDays(playerid) < 5)
  520.             {
  521.                 format ( Str, sizeof Str, "[Vip] {FFFFFF}Seu VIP expira em %d dias.", GetExpirationDays(playerid));
  522.                 SendClientMessage(playerid, Default, Str);
  523.             }
  524.         }
  525.     }
  526. }
  527.  
  528. Public::HiddenWelcome(playerid)
  529. {
  530.     if ( VisibleWelcome[playerid] == true )
  531.     {
  532.         for ( new t = 0; t < 6; t++) TextDrawDestroy(DrawWelcome[playerid][t]);
  533.         TimerDraw[playerid] = 0;
  534.         VisibleWelcome[playerid] = false;
  535.     }
  536. }
  537.  
  538. ENGINE::IsNumeric(const string[])
  539. {
  540.         for (new i = 0, j = strlen(string); i < j; i++)
  541.         {
  542.                 if (string[i] > '9' || string[i] < '0') return 0;
  543.         }
  544.         return 1;
  545. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement