Advertisement
Guest User

VIP SYSTEM - UP.1.3 - ENGLISH

a guest
Mar 3rd, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.09 KB | None | 0 0
  1. /*
  2.  
  3.     #######################################################################################
  4.     ###                                                                                 ###
  5.     ###                                 VIP SYSTEM                                      ###
  6.     ###                                                                                 ###
  7.     ###                                                                                 ###
  8.     ###                     This script are free for edition                            ###
  9.     ###                                                                     By: Dry     ###
  10.     #######################################################################################
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.     Functions:
  18.  
  19.         - IsPlayerVIP(playerid)                 - Check if player is a VIP.
  20.         - LoadPlayerVIP(playerid)               - Load file from Player.
  21.         - SavePlayerVIP(playerid)               - Save data from a Player.
  22.         - CreateVipKey(playerid, Key[], Days)   - Create a new key.
  23.         - UseVipKey(playerid, Key[])            - Use one KEY for player.
  24.         - RemoveKey(playerid, Key[])            - Remove key file.
  25.         - GetExpirationDays(playerid)           - Get expiration days.
  26.         - SetVipForPlayer(playerid, Days)       - Set/Renew vip for player.
  27.         - ShowWelcomeMessage(playerid)          - Show welcome message in textdraw.
  28.  
  29.     Commands:
  30.    
  31.         - CMD:setvip [ID] [DAYS]        ( Admin )  // Set vip for player
  32.         - CMD:viphelp                   ( VIP )     // Info. VIP
  33.         - CMD:vipcode                   ( Default )// Active the key
  34.         - CMD:newkey                    ( Admin ) // Create a new key
  35.         - CMD:delkey [KEY]              ( Admin ) // Remove a exist key
  36.         - CMD:vips                      ( Default ) // List of Players VIPs online
  37.  
  38.     Config:
  39.    
  40.         #define CHAT_MODEL 3                    - Design of the chat
  41.         #define FULL_LIFE 1                     - Respawn with Life and Armour full
  42.         #define DEATH_RESPAWN_LOCAL 1           - Respawn in the death position
  43.        
  44.     Instalation:
  45.    
  46.         - Create a new folder  "vips " in scriptfiles
  47.         - Create two folders inside it:
  48.        
  49.         * Users
  50.         * Keys
  51.  
  52.         -Dry ( Lucas ).
  53.  
  54. */
  55.  
  56. #include <a_samp>
  57. #include <dof2>
  58. #include <zcmd>
  59. #include <sscanf>
  60.  
  61. #define ENGINE::%0(%1) stock %0(%1)
  62. #define Public::%0(%1) forward %0(%1); public %0(%1)
  63.  
  64. #define DIALOG_ATIV_KEY 779
  65. #define DIALOG_MAKE_KEY 779+1
  66. #define DIALOG_MAKE_DAYS 779+2
  67. #define DIALOG_CONFIRM 779+3
  68.  
  69. //Folder's
  70.  
  71. #define VIP_USERS "Vips/Users/%s.ini"
  72. #define VIP_KEYS "Vips/Keys/%s.ini"
  73.  
  74. //Colors
  75.  
  76. #define Default 0xDE3A3AFF
  77. #define Branco  0xFFFFFFFF
  78.  
  79. //Config
  80.  
  81. #define CHAT_MODEL 3
  82. #define FULL_LIFE 1
  83. #define DEATH_RESPAWN_LOCAL 1
  84.  
  85. #if DEATH_RESPAWN_LOCAL == 1
  86.  
  87. new Float: X[MAX_PLAYERS], Float: Y[MAX_PLAYERS], Float: Z[MAX_PLAYERS], Interior[MAX_PLAYERS];
  88.  
  89. #endif
  90.  
  91. //Player Definitions
  92.  
  93. enum PlayerParams
  94. {
  95.     bool:VIP,
  96.     dExpiration,
  97.     hExpiration
  98. };
  99.  
  100. new Player[MAX_PLAYERS][PlayerParams];
  101. new bool:VisibleWelcome[MAX_PLAYERS];
  102. new Text:DrawWelcome[MAX_PLAYERS][6];
  103. new TimerDraw[MAX_PLAYERS];
  104. new cKey[MAX_PLAYERS][128], cDays[MAX_PLAYERS];
  105.  
  106. public OnFilterScriptInit()
  107. {
  108.     for ( new playerid = 0; playerid < GetMaxPlayers(); playerid++)
  109.     {
  110.         if ( IsPlayerConnected(playerid))
  111.         {
  112.             LoadPlayerVIP(playerid);
  113.         }
  114.     }
  115.     SetTimer("CheckVipsInGame", 60000, true);
  116.     print("VIP System Loaded");
  117.     return 1;
  118. }
  119.  
  120. Public::CheckVipsInGame()
  121. {
  122.     for ( new playerid = 0; playerid < GetMaxPlayers(); playerid++)
  123.     {
  124.         if ( IsPlayerConnected(playerid) && IsPlayerVIP(playerid))
  125.         {
  126.             if ( GetExpirationDays(playerid) <= 0)
  127.             {
  128.                 SetVipForPlayer(playerid, 0);
  129.             }
  130.         }
  131.     }
  132. }
  133.  
  134. public OnFilterScriptExit()
  135. {
  136.     for ( new playerid = 0; playerid < GetMaxPlayers(); playerid++) HiddenWelcome(playerid);
  137.     print("VIP System UnLoaded.");
  138.     return 1;
  139. }
  140.  
  141. public OnPlayerConnect(playerid)
  142. {
  143.     LoadPlayerVIP(playerid);
  144.     return 1;
  145. }
  146.  
  147. public OnPlayerDisconnect(playerid, reason)
  148. {
  149.     HiddenWelcome(playerid);
  150.     Player[playerid][VIP] = false;
  151.     return 1;
  152. }
  153.  
  154. public OnPlayerSpawn(playerid)
  155. {
  156.     if ( IsPlayerVIP(playerid))
  157.     {
  158.         #if FULL_LIFE == 1
  159.         {
  160.             SetPlayerHealth(playerid, 100.0);
  161.             SetPlayerArmour(playerid, 100.0);
  162.         }
  163.         #endif
  164.         #if DEATH_RESPAWN_LOCAL == 1
  165.         {
  166.             SetPlayerInterior(playerid, Interior[playerid]);
  167.             SetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
  168.         }
  169.         #endif
  170.     }
  171.     return 1;
  172. }
  173.  
  174. public OnPlayerDeath(playerid, killerid, reason)
  175. {
  176.     #if DEATH_RESPAWN_LOCAL == 1
  177.     {
  178.         if ( IsPlayerVIP(playerid))
  179.         {
  180.             GetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
  181.             Interior[playerid] = GetPlayerInterior(playerid);
  182.         }
  183.     }
  184.     #endif
  185.     return 1;
  186. }
  187.  
  188. public OnPlayerText(playerid, text[])
  189. {
  190.     if ( IsPlayerVIP(playerid))
  191.     {
  192.         new Name[24];
  193.         GetPlayerName(playerid, Name, 24);
  194.         #if CHAT_MODEL == 1
  195.         {
  196.             new dStr[128];
  197.             format ( dStr, 128, "[%d]%s[V.I.P]: {FFFFFF}%s", playerid, Name, text);
  198.             SendClientMessageToAll(GetPlayerColor(playerid), dStr);
  199.             return 0;
  200.         }
  201.         #endif
  202.         #if CHAT_MODEL == 2
  203.         {
  204.             new dStr[128];
  205.             format ( dStr, 128, "%s[%d][V.I.P]: {FFFFFF}%s", Name, playerid, text);
  206.             SendClientMessageToAll(GetPlayerColor(playerid), dStr);
  207.             return 0;
  208.         }
  209.         #endif
  210.         #if CHAT_MODEL == 3
  211.         {
  212.             new dStr[128];
  213.             format ( dStr, 128, "{F9BD0B}VIP {FFFFFF}%s diz: {FFFFFF}%s", Name, text);
  214.             SendClientMessageToAll(GetPlayerColor(playerid), dStr);
  215.             return 0;
  216.         }
  217.         #endif
  218.     }
  219.     return 1;
  220. }
  221.  
  222. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  223. {
  224.     if ( dialogid == DIALOG_ATIV_KEY && response)
  225.     {
  226.         UseVipKey(playerid, inputtext);
  227.         return 1;
  228.     }
  229.     if ( dialogid == DIALOG_MAKE_KEY && response )
  230.     {
  231.         format ( cKey[playerid], 128, inputtext);
  232.         new Str[128];
  233.         format ( Str, sizeof Str, "{FFFFFF}Your VIP KEY: {DE3A3A}%s\n\n{FFFFFF}days from expiration:", cKey[playerid]);
  234.         ShowPlayerDialog(playerid, DIALOG_MAKE_DAYS, DIALOG_STYLE_INPUT, "{FFFFFF}Create a new key", Str, "Create", "Cancel");
  235.         return true;
  236.     }
  237.     if ( dialogid == DIALOG_MAKE_DAYS && response )
  238.     {
  239.         if ( !IsNumeric(inputtext)) return SendClientMessage(playerid, Default, "ERROR");
  240.         cDays[playerid] = strval(inputtext);
  241.         new Str[500];
  242.         format ( Str, sizeof Str,  "{FFFFFF}Informations from your new key:\n\nKey: {DE3A3A}%s\n{FFFFFF}Validity: {DE3A3A}%d dias\n\n{FFFFFF}Want to create ? ?", cKey[playerid], cDays[playerid]);
  243.         ShowPlayerDialog(playerid, DIALOG_CONFIRM, DIALOG_STYLE_MSGBOX, "{FFFFFF}Create a new KEY",Str, "Yes", "No");
  244.         return 1;
  245.     }
  246.     if ( dialogid == DIALOG_CONFIRM && response)
  247.     {
  248.         CreateVipKey(playerid, cKey[playerid], cDays[playerid]);
  249.         return 1;
  250.     }
  251.     return 1;
  252. }
  253. CMD:ativarvip(playerid)
  254. {
  255.     ShowPlayerDialog(playerid, DIALOG_ATIV_KEY, DIALOG_STYLE_INPUT, "{FFFFFF}VIP activate", "{FFFFFF}Welcome.\nInsert your key for activate your vip:", "Active", "Exit");
  256.     return 1;
  257. }
  258.  
  259. CMD:newkey(playerid, params[])
  260. {
  261.     if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Default, "Insufficient permissions");
  262.     ShowPlayerDialog(playerid, DIALOG_MAKE_KEY, DIALOG_STYLE_INPUT, "{FFFFFF}Create a new key", "{FFFFFF}Insert a new VIP KEY:", "Create", "Cancel");
  263.     return 1;
  264. }
  265.  
  266. CMD:viphelp(playerid)
  267. {
  268.     if ( !IsPlayerVIP(playerid)) return SendClientMessage(playerid, Default, "[Erro]{FFFFFF} You no are VIP");
  269.     new Str[1028]; format ( Str, sizeof Str, "{FFFFFF}VIP informations.\n\nYour VIP expires in: %d days.\n\nRenew your VIP.", GetExpirationDays(playerid));
  270.     ShowPlayerDialog(playerid, 775+1, DIALOG_STYLE_MSGBOX, "{FFFFFF}VIP", Str, "Exit", "");
  271.     return 1;
  272. }
  273.  
  274. CMD:delkey(playerid, params[])
  275. {
  276.     if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Default, "Insufficient permissions");
  277.     new Key[128];
  278.     if ( sscanf ( params, "s", Key)) return SendClientMessage(playerid, Default, "[Erro]{FFFFFF} Insert one name of the key");
  279.     RemoveKey(playerid, Key);
  280.     return 1;
  281. }
  282.  
  283. CMD:setvip(playerid, params[])
  284. {
  285.     if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Default, "Insufficient permissions");
  286.     new Nome, Dias;
  287.     if ( sscanf ( params, "id", Nome, Dias)) return SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Use: /setvip [ID/NAME] [DAYS]");
  288.     SetVipForPlayer(Nome, Dias);
  289.     return 1;
  290. }
  291.  
  292. CMD:vips(playerid)
  293. {
  294.     new Name[24], Str[128];
  295.     SendClientMessage(playerid, Default, "VIP's Online:");
  296.     for ( new i = 0; i < GetMaxPlayers(); i++)
  297.     {
  298.         if ( IsPlayerConnected(i) && IsPlayerVIP(i))
  299.         {
  300.             GetPlayerName(i, Name, 24);
  301.             format ( Str, sizeof Str, "[V.I.P]{FFFFFF} %s ID: %d", Name, i);
  302.             SendClientMessage(i, Default, Str);
  303.         }
  304.     }
  305.     return 1;
  306. }
  307.  
  308. ENGINE::IsPlayerVIP(playerid)
  309. {
  310.     if ( Player[playerid][VIP] == false ) return 0;
  311.     return 1;
  312. }
  313.  
  314. ENGINE::LoadPlayerVIP(playerid)
  315. {
  316.     new Name[24], dStr[128];
  317.     GetPlayerName(playerid, Name, sizeof Name);
  318.     format ( dStr, sizeof dStr, VIP_USERS, Name);
  319.     if ( !DOF2::FileExists(dStr)) return true;
  320.     Player[playerid][VIP] = true;
  321.     Player[playerid][dExpiration] = DOF2::GetInt(dStr, "Day_Expiration");
  322.     Player[playerid][hExpiration] = DOF2::GetInt(dStr, "Hour_Expiration");
  323.     ShowWelcomeMessage(playerid);
  324.     return true;
  325. }
  326.  
  327. ENGINE::SavePlayerVIP(playerid)
  328. {
  329.     new Name[24], Str[128];
  330.     GetPlayerName(playerid, Name, 24);
  331.     format ( Str, sizeof Str, VIP_USERS, Name);
  332.     if ( !DOF2::FileExists(Str)) DOF2::CreateFile(Str);
  333.     if ( !DOF2::FileExists(Str)) return printf ( "The VIP file %s not created ( unknown folder )", Name);
  334.     DOF2::SetInt(Str, "Day_Expiration", Player[playerid][dExpiration]);
  335.     DOF2::SetInt(Str, "Hour_Expiration", Player[playerid][hExpiration]);
  336.     DOF2::SaveFile();
  337.     return 1;
  338. }
  339.  
  340. ENGINE::CreateVipKey(playerid, Key[], Days)
  341. {
  342.     new Str[128];
  343.     format ( Str, sizeof Str, VIP_KEYS, Key);
  344.     if ( DOF2::FileExists(Str))
  345.     {
  346.         new Dayss = DOF2::GetInt(Str, "VIP_Days");
  347.         format ( Str, sizeof Str, "[Erro]{FFFFFF} [ %s ] - [ %d days ]",Key, Dayss);
  348.         SendClientMessage(playerid, Default, "[Erro] {FFFFFF}One similar key exists");
  349.         SendClientMessage(playerid, Default, Str);
  350.         return 1;
  351.     }
  352.     if ( Days <= 0) return SendClientMessage(playerid, Default, "[Erro]{FFFFFF} Impossible perform this operation ");
  353.     DOF2::CreateFile(Str);
  354.     DOF2::SetInt(Str, "VIP_Days", Days);
  355.     DOF2::SaveFile();
  356.     format ( Str, sizeof Str, "[VIP]{FFFFFF} [ %s ] - [ %d days ]", Key, Days);
  357.     SendClientMessage(playerid, Default, "[VIP]{FFFFFF} A new key has been created");
  358.     SendClientMessage(playerid, Default, "[VIP]{FFFFFF} Use /ativarvip");
  359.     SendClientMessage(playerid, Default, Str);
  360.     return 1;
  361. }
  362.  
  363. ENGINE::UseVipKey(playerid, Key[])
  364. {
  365.     new Str[128];
  366.     format ( Str, sizeof Str, VIP_KEYS, Key);
  367.     if ( !DOF2::FileExists(Str))
  368.     {
  369.         SendClientMessage(playerid, Default, "************************************************");
  370.         SendClientMessage(playerid, Default, " KEY does not exist or has already been used");
  371.         SendClientMessage(playerid, Default, "************************************************");
  372.         return 1;
  373.     }
  374.     new Days = DOF2::GetInt(Str, "VIP_Days");
  375.     SetVipForPlayer(playerid, Days);
  376.     DOF2::RemoveFile(Str);
  377.     new Name[24]; GetPlayerName(playerid, Name, 24);
  378.     printf ("The Player %s used the key %s - %d days", Name, Key, Days);
  379.     return 1;
  380. }
  381.  
  382. ENGINE::RemoveKey(playerid, Key[])
  383. {
  384.     new Str[128];
  385.     format ( Str, sizeof Str, VIP_KEYS, Key);
  386.     if ( !DOF2::FileExists(Str)) return SendClientMessage(playerid, Default, "unknown key");
  387.     DOF2::RemoveFile(Str);
  388.     format (Str, sizeof Str, "[VIP KEY]{FFFFFF} The Key %s has been removed.", Key);
  389.     SendClientMessage(playerid, Default, Str);
  390.     return 1;
  391. }
  392.    
  393. ENGINE::GetExpirationDays(playerid)
  394. {
  395.     new Days = 0;
  396.     if ( IsPlayerVIP(playerid))
  397.     {
  398.         Days = Player[playerid][dExpiration] - getdate();
  399.     }
  400.     return Days;
  401. }
  402.  
  403. ENGINE::SetVipForPlayer(playerid, Days)
  404. {
  405.     if ( !IsPlayerConnected(playerid)) return 1;
  406.     if ( Days == 0 )
  407.     {
  408.         new Nome[24], Str[128];
  409.         GetPlayerName(playerid, Nome, 24);
  410.         format ( Str, sizeof Str, VIP_USERS, Nome);
  411.         DOF2::RemoveFile(Str);
  412.         Player[playerid][VIP] = false;
  413.         SendClientMessage(playerid, Default, "[Vip] {FFFFFF}You VIP has been expired!");
  414.         SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Thanks for your help this server.");
  415.         return 1;
  416.     }
  417.     new Str[128];
  418.     if ( Player[playerid][VIP] == true )
  419.     {
  420.         format ( Str, sizeof Str, "[Vip] {FFFFFF}Your VIP has been renewed. ( %d days )", Days);
  421.         Player[playerid][dExpiration] += Days;
  422.         Player[playerid][hExpiration] = gettime();
  423.     }
  424.     else
  425.     {
  426.         format ( Str, sizeof Str, "[Vip] {FFFFFF}Your VIP has been activated. ( %d days )", Days);
  427.         Player[playerid][dExpiration] = getdate() + Days;
  428.         Player[playerid][hExpiration] = gettime();
  429.     }
  430.     Player[playerid][VIP] = true;
  431.     SavePlayerVIP(playerid);
  432.     SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Thanks for buy VIP");
  433.     SendClientMessage(playerid, Default, "[Vip] {FFFFFF}Use: /viphelp for more informations.");
  434.     SendClientMessage(playerid, Default, Str);
  435.     return 1;
  436. }
  437.  
  438. ENGINE::ShowWelcomeMessage(playerid)
  439. {
  440.     if ( IsPlayerVIP(playerid))
  441.     {
  442.         if ( VisibleWelcome[playerid] == false )
  443.         {
  444.             DrawWelcome[playerid][0]                    =TextDrawCreate(579.000000, 301.000000, "_");
  445.             TextDrawBackgroundColor     (DrawWelcome[playerid][0], 255);
  446.             TextDrawFont                (DrawWelcome[playerid][0], 1);
  447.             TextDrawLetterSize          (DrawWelcome[playerid][0], 0.500000, 7.199999);
  448.             TextDrawColor               (DrawWelcome[playerid][0], -1);
  449.             TextDrawSetOutline          (DrawWelcome[playerid][0], 0);
  450.             TextDrawSetProportional     (DrawWelcome[playerid][0], 1);
  451.             TextDrawSetShadow           (DrawWelcome[playerid][0], 1);
  452.             TextDrawUseBox              (DrawWelcome[playerid][0], 1);
  453.             TextDrawBoxColor            (DrawWelcome[playerid][0], -1010580690);
  454.             TextDrawTextSize            (DrawWelcome[playerid][0], 433.000000, 0.000000);
  455.  
  456.             DrawWelcome[playerid][1]                    =TextDrawCreate(579.000000, 301.000000, "_");
  457.             TextDrawBackgroundColor     (DrawWelcome[playerid][1], 255);
  458.             TextDrawFont                (DrawWelcome[playerid][1], 1);
  459.             TextDrawLetterSize          (DrawWelcome[playerid][1], 0.500000, 0.899999);
  460.             TextDrawColor               (DrawWelcome[playerid][1], -1);
  461.             TextDrawSetOutline          (DrawWelcome[playerid][1], 0);
  462.             TextDrawSetProportional     (DrawWelcome[playerid][1], 1);
  463.             TextDrawSetShadow           (DrawWelcome[playerid][1], 1);
  464.             TextDrawUseBox              (DrawWelcome[playerid][1], 1);
  465.             TextDrawBoxColor            (DrawWelcome[playerid][1], -1010580685);
  466.             TextDrawTextSize            (DrawWelcome[playerid][1], 433.000000, 0.000000);
  467.  
  468.             DrawWelcome[playerid][2]                    =TextDrawCreate(437.000000, 301.000000, "Welcome");
  469.             TextDrawBackgroundColor     (DrawWelcome[playerid][2], -1010580736);
  470.             TextDrawFont                (DrawWelcome[playerid][2], 2);
  471.             TextDrawLetterSize          (DrawWelcome[playerid][2], 0.159999, 0.899999);
  472.             TextDrawColor               (DrawWelcome[playerid][2], -1);
  473.             TextDrawSetOutline          (DrawWelcome[playerid][2], 0);
  474.             TextDrawSetProportional     (DrawWelcome[playerid][2], 1);
  475.             TextDrawSetShadow           (DrawWelcome[playerid][2], 1);
  476.  
  477.             DrawWelcome[playerid][3]                    =TextDrawCreate(437.000000, 318.000000, "VIP Activated.");
  478.             TextDrawBackgroundColor     (DrawWelcome[playerid][3], -1010580736);
  479.             TextDrawFont                (DrawWelcome[playerid][3], 2);
  480.             TextDrawLetterSize          (DrawWelcome[playerid][3], 0.149999, 0.799999);
  481.             TextDrawColor               (DrawWelcome[playerid][3], -1);
  482.             TextDrawSetOutline          (DrawWelcome[playerid][3], 0);
  483.             TextDrawSetProportional     (DrawWelcome[playerid][3], 1);
  484.             TextDrawSetShadow           (DrawWelcome[playerid][3], 1);
  485.  
  486.             DrawWelcome[playerid][4]                    =TextDrawCreate(437.000000, 329.000000, "Use: /viphelp");
  487.             TextDrawBackgroundColor     (DrawWelcome[playerid][4], -1010580736);
  488.             TextDrawFont                (DrawWelcome[playerid][4], 2);
  489.             TextDrawLetterSize          (DrawWelcome[playerid][4], 0.149999, 0.799999);
  490.             TextDrawColor               (DrawWelcome[playerid][4], -1);
  491.             TextDrawSetOutline          (DrawWelcome[playerid][4], 0);
  492.             TextDrawSetProportional     (DrawWelcome[playerid][4], 1);
  493.             TextDrawSetShadow           (DrawWelcome[playerid][4], 1);
  494.  
  495.             DrawWelcome[playerid][5]                    =TextDrawCreate(437.000000, 356.000000, "Your VIP expire in: ... dias");
  496.             TextDrawBackgroundColor     (DrawWelcome[playerid][5], -1010580736);
  497.             TextDrawFont                (DrawWelcome[playerid][5], 2);
  498.             TextDrawLetterSize          (DrawWelcome[playerid][5], 0.149999, 0.799999);
  499.             TextDrawColor               (DrawWelcome[playerid][5], -1);
  500.             TextDrawSetOutline          (DrawWelcome[playerid][5], 0);
  501.             TextDrawSetProportional     (DrawWelcome[playerid][5], 1);
  502.             TextDrawSetShadow           (DrawWelcome[playerid][5], 1);
  503.             new Str[128];
  504.             format ( Str, sizeof Str, "Seu VIP expira em: %d dias.", GetExpirationDays(playerid));
  505.             TextDrawSetString(DrawWelcome[playerid][5], Str);
  506.             for ( new t = 0; t < 6; t++) TextDrawShowForPlayer(playerid, DrawWelcome[playerid][t]);
  507.             VisibleWelcome[playerid] = true;
  508.             TimerDraw[playerid] = SetTimerEx("HiddenWelcome", 6000, false, "i", playerid);
  509.             if ( GetExpirationDays(playerid) < 5)
  510.             {
  511.                 format ( Str, sizeof Str, "[Vip] {FFFFFF}Your VIP expire in: %d days", GetExpirationDays(playerid));
  512.                 SendClientMessage(playerid, Default, Str);
  513.             }
  514.         }
  515.     }
  516. }
  517.  
  518. Public::HiddenWelcome(playerid)
  519. {
  520.     if ( VisibleWelcome[playerid] == true )
  521.     {
  522.         for ( new t = 0; t < 6; t++) TextDrawDestroy(DrawWelcome[playerid][t]);
  523.         TimerDraw[playerid] = 0;
  524.         VisibleWelcome[playerid] = false;
  525.     }
  526. }
  527.  
  528. ENGINE::IsNumeric(const string[])
  529. {
  530.         for (new i = 0, j = strlen(string); i < j; i++)
  531.         {
  532.                 if (string[i] > '9' || string[i] < '0') return 0;
  533.         }
  534.         return 1;
  535. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement