Request Free V.I.P Time Plugin

Unpaid Requests, Public Plugins
Post Reply
Muhammet20
Veteran Member
Veteran Member
Posts: 407
Joined: 5 years ago
Contact:

Request Free V.I.P Time Plugin

#1

Post by Muhammet20 » 5 years ago

Hi All,
I Want From You Guys
A Free V.I.P Time For Zombie Escape

Please I Want Them Without Any Addons , I Mean Without Multi-Jump Or Double Damage Or Other Thing

Please If Some one Read This Topic And Have That Plugin , Give Me Them , Please Fast Answer

Thanks.........

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#2

Post by sPe3doN » 5 years ago

viewtopic.php?f=15&t=39 use this vip plugin and remove wht you dont need it
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#3

Post by Raheem » 5 years ago

Hello, compile this (No -multijump, parachute, damage-):

  1. #include <zombie_escape>
  2. #include <ze_vip>
  3.  
  4. // Defines - Comment MULTIJUMP or PARACHUTE, so you don't need to run multijump/parachute plugin.
  5. #define VIP_MESSAGES    VIP_A
  6. //#define MULTIJUMP     VIP_B
  7. //#define PARACHUTE     VIP_C
  8. #define SCOREBOARD      VIP_D
  9. #define DAMAGE          VIP_E
  10. #define NON_VIP         VIP_Z
  11.  
  12. #if defined PARACHUTE
  13.     #include <ze_parachute>
  14. #endif
  15.  
  16. #if defined MULTIJUMP
  17.     #include <ze_multijump>
  18. #endif
  19.  
  20. // Variables
  21. new g_szPasswordKey[65],
  22.     g_szPassword[65],
  23.     bool:g_bIsUserVIP[33],
  24.     bool:g_bSetVIP[33],
  25.     g_iFlags[33],
  26.     bool:g_bIsHappyHour,
  27.     g_iMaxPlayers
  28.  
  29. // Const.
  30. static const g_szLocalFile[] = "addons/amxmodx/configs/ze_vips.ini"
  31.  
  32. new const szCommands[][] =
  33. {
  34.     "say /vip",
  35.     "say /vips",
  36.     "say_team /vip",
  37.     "say_team /vips"
  38. }
  39.  
  40. // Cvars
  41. new g_pCvarVIPScoreboard,
  42.     g_pCvarConnectMessage,
  43.     g_pCvarAdminContact,
  44.     g_pCvarEnableHappyHours,
  45.     g_pCvarHappyHours,
  46.     g_pCvarHappyHoursFlags,
  47.     g_pCvarDamage
  48.  
  49. #if defined PARACHUTE
  50.     new g_pCvarParachute
  51. #endif
  52.  
  53. #if defined MULTIJUMP
  54.     new g_pCvarMultijump
  55. #endif
  56.  
  57. public plugin_natives()
  58. {
  59.     register_native("ze_get_vip_flags", "native_ze_get_vip_flags", 1)
  60.     register_native("ze_set_vip_flags", "native_ze_set_vip_flags", 1)
  61.     register_native("ze_is_user_vip", "native_ze_is_user_vip", 1)
  62. }
  63.  
  64. public plugin_init()
  65. {
  66.     register_plugin("[ZE] Zombie Escape VIP", VIP_VERSION, AUTHORS)
  67.    
  68.     // Hookchain
  69.     RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_TakeDamage_Pre", 0)
  70.    
  71.     // Cvars
  72.     g_pCvarConnectMessage = register_cvar("ze_connect_message", "1")
  73.     g_pCvarAdminContact = register_cvar("ze_admin_contact", "Admin Name")
  74.     g_pCvarVIPScoreboard = register_cvar("ze_show_vip_scoreboard", "1")
  75.     g_pCvarEnableHappyHours = register_cvar("ze_enable_happy_hours", "1")
  76.     g_pCvarHappyHours = register_cvar("ze_vip_happy_hours", "9-12")
  77.     g_pCvarHappyHoursFlags = register_cvar("ze_happy_hours_vip_flags", "abcd")
  78.     g_pCvarDamage = register_cvar("ze_vip_multiply_damage", "0")
  79.     #if defined MULTIJUMP
  80.         g_pCvarMultijump = register_cvar("ze_give_vip_multijump", "1")
  81.     #endif
  82.     #if defined PARACHUTE
  83.         g_pCvarParachute = register_cvar("ze_give_vip_parachute", "1")
  84.     #endif
  85.    
  86.     register_cvar("ze_vip_version", VIP_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
  87.     set_cvar_string("ze_vip_version", VIP_VERSION)
  88.    
  89.     // Commands
  90.     for (new i = 0; i < charsmax(szCommands); i++)
  91.         register_clcmd(szCommands[i], "CmdVIP")
  92.  
  93.     register_clcmd("say /getvip", "CmdMotd")
  94.     register_clcmd("say_team /getvip", "CmdMotd")
  95.    
  96.     // Get Password Key
  97.     get_cvar_string("amx_password_field", g_szPasswordKey, charsmax(g_szPasswordKey))
  98.    
  99.     // Initialize Arrays
  100.     arrayset(g_bIsUserVIP, false, 32)
  101.     arrayset(g_bSetVIP, false, 32)
  102.    
  103.     // Get max players
  104.     g_iMaxPlayers = get_member_game(m_nMaxPlayers)
  105. }
  106.  
  107. public plugin_cfg()
  108. {
  109.     // Get our configiration file and Execute it
  110.     new szCfgDir[64]
  111.     get_localinfo("amxx_configsdir", szCfgDir, charsmax(szCfgDir))
  112.     server_cmd("exec %s/ze_vip.cfg", szCfgDir)
  113. }
  114.  
  115. public Fw_TakeDamage_Pre(iVictim, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
  116. {
  117.     if (!is_user_alive(iVictim) || !is_user_alive(iAttacker))
  118.         return HC_CONTINUE
  119.    
  120.     if (!(ze_get_vip_flags(iAttacker) & DAMAGE) || get_pcvar_num(g_pCvarDamage) == 0)
  121.         return HC_CONTINUE
  122.  
  123.     SetHookChainArg(4, ATYPE_FLOAT, flDamage * get_pcvar_float(g_pCvarDamage))
  124.    
  125.     return HC_CONTINUE
  126. }
  127.  
  128. public client_authorized(id)
  129. {
  130.     // Get password from Setinfo
  131.     new szPassword[65]
  132.     get_user_info(id, g_szPasswordKey, szPassword, charsmax(szPassword))
  133.    
  134.     // Player VIP?
  135.     ze_get_vip_flags(id)
  136.    
  137.     if (g_bIsUserVIP[id])
  138.     {
  139.         if (!equal(szPassword, g_szPassword))
  140.         {
  141.             // VIP and wrong Password? Kick him
  142.             client_cmd(id, "echo ^"* VIP Invalid Password!^"")
  143.             server_cmd("kick #%d ^"You have no entry to the server...^"", get_user_userid(id))
  144.         }
  145.         else
  146.         {
  147.             client_cmd(id, "echo ^"* VIP Password Accepted!^"")
  148.         }
  149.     }
  150. }
  151.  
  152. public client_putinserver(id)
  153. {
  154.     if (ze_get_vip_flags(id) & VIP_MESSAGES)
  155.     {
  156.         if (get_pcvar_num(g_pCvarConnectMessage) != 0)
  157.         {
  158.             new szName[32]
  159.             get_user_name(id, szName, charsmax(szName))
  160.             ze_colored_print(0, "!tVIP !g%s !thas connected to the server!y.", szName)
  161.         }
  162.     }
  163. }
  164.  
  165. public CmdMotd(id)
  166. {
  167.     show_motd(id, "ze_vip.txt", "Zombie Escape VIP")
  168. }
  169.  
  170. public CmdVIP(id)
  171. {
  172.     set_task(0.1, "Print_List")
  173. }
  174.  
  175. public Print_List()
  176. {
  177.     Print_VIP_List()
  178. }
  179.  
  180. public Print_VIP_List()
  181. {
  182.     new szVIPName[33][32], szMessage[700], szContact[256]
  183.    
  184.     new iPlayer, i, iVIPCount = 0, iLen = 0;
  185.    
  186.     for (iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++)
  187.     {
  188.         if (!is_user_connected(iPlayer))
  189.             continue
  190.        
  191.         if (ze_get_vip_flags(iPlayer) & VIP_MESSAGES)
  192.         {
  193.             get_user_name(iPlayer, szVIPName[iVIPCount], charsmax(szVIPName))
  194.             iVIPCount++
  195.         }
  196.     }
  197.    
  198.     iLen = formatex(szMessage, charsmax(szMessage), "^4VIPs ONLINE^1: ")
  199.    
  200.     if (iVIPCount > 0)
  201.     {
  202.         for (i = 0; i <= iVIPCount; i++)
  203.         {
  204.             iLen += formatex(szMessage[iLen], charsmax(szMessage) - iLen, "^3%s^1%s^3", szVIPName[i], (i < (iVIPCount - 1)) ? ", " : "")
  205.         }
  206.     }
  207.     else
  208.     {
  209.         szMessage = "^4No VIPs online^1."
  210.     }
  211.    
  212.     client_print_color(0, print_team_default, szMessage)
  213.    
  214.     get_pcvar_string(g_pCvarAdminContact, szContact, charsmax(szContact))
  215.    
  216.     if (szContact[0])
  217.     {
  218.         client_print_color(0, print_team_default, "^1- ^4Contact Server Admin ^1-- ^3%s", szContact)
  219.     }
  220. }
  221.  
  222. public ze_user_humanized(id)
  223. {
  224.     if (!is_user_alive(id))
  225.         return
  226.    
  227.     Happy_Hours()
  228.    
  229.     if (g_bIsHappyHour == true && get_pcvar_num(g_pCvarEnableHappyHours) != 0)
  230.     {
  231.         new szFlags[VIP_MAX_FLAGS]
  232.         get_pcvar_string(g_pCvarHappyHoursFlags, szFlags, charsmax(szFlags))
  233.         ze_set_vip_flags(id, read_flags(szFlags))
  234.     }
  235.    
  236.     // Get password from Setinfo
  237.     new szPassword[65]
  238.     get_user_info(id, g_szPasswordKey, szPassword, charsmax(szPassword))
  239.    
  240.     ze_get_vip_flags(id)
  241.    
  242.     if (g_bIsUserVIP[id])
  243.     {
  244.         if (!equal(szPassword, g_szPassword))
  245.         {
  246.             // VIP and wrong Password? Kick him
  247.             client_cmd(id, "echo ^"* VIP Invalid Password!^"")
  248.             server_cmd("kick #%d ^"You have no entry to the server...^"", get_user_userid(id))
  249.         }
  250.         else
  251.         {
  252.             client_cmd(id, "echo ^"* VIP Password Accepted!^"")
  253.         }
  254.     }
  255.    
  256.     #if defined MULTIJUMP
  257.         if (ze_get_vip_flags(id) & MULTIJUMP)
  258.         {
  259.             if (get_pcvar_num(g_pCvarMultijump) != 0)
  260.             {
  261.                 ze_give_user_multijump(id)
  262.             }
  263.         }
  264.     #endif
  265.    
  266.     #if defined PARACHUTE
  267.         if (ze_get_vip_flags(id) & PARACHUTE)
  268.         {
  269.             if (get_pcvar_num(g_pCvarParachute) != 0)
  270.             {
  271.                 ze_give_user_parachute(id)
  272.             }
  273.         }
  274.     #endif
  275.  
  276.     set_task(0.1, "Update_Attribute", id, _, _, "a", 10)
  277. }
  278.  
  279. public ze_roundend(WinTeam)
  280. {
  281.     for (new i = 0; i < get_member_game(m_nMaxPlayers); i++)
  282.     {
  283.         g_bSetVIP[i] = false
  284.     }
  285. }
  286.  
  287. public Update_Attribute(id)
  288. {
  289.     if ((ze_get_vip_flags(id) & SCOREBOARD) && get_pcvar_num(g_pCvarVIPScoreboard) != 0)
  290.     {
  291.         message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"), {0, 0, 0}, id)
  292.         write_byte(id)
  293.         write_byte(4)
  294.         message_end()
  295.     }
  296. }
  297.  
  298. public native_ze_get_vip_flags(id)
  299. {
  300.     // Our file exists?
  301.     if (file_exists(g_szLocalFile))
  302.     {
  303.         /*
  304.         *   We can't use new file system here, because if file opened it can not be deleted.
  305.         *   Old system provide the suitable way for doing it simply. That's a reason.
  306.         */
  307.  
  308.         // Declare some useful variables
  309.         new iMaxLines, szLineToRead[129], szParse[4][65], szName[32], szSteamID[36], iTextLen
  310.        
  311.         // Get max lines number in the file
  312.         iMaxLines = file_size(g_szLocalFile, FSOPT_LINES_COUNT)
  313.        
  314.         // Get our player name and steamid
  315.         get_user_authid(id, szSteamID, charsmax(szSteamID))
  316.         get_user_name(id, szName, charsmax(szName))
  317.        
  318.         // Loop through the whole file
  319.         for (new iLine = 0; iLine < iMaxLines; iLine++)
  320.         {
  321.             // Read line by line
  322.             read_file(g_szLocalFile, iLine, szLineToRead, charsmax(szLineToRead), iTextLen)
  323.            
  324.             // Remove any space, useful to remove blank lines which only contain spaces
  325.             trim(szLineToRead)
  326.            
  327.             // Check if string empty or starting with ; or // ignore the line
  328.             if (strlen(szLineToRead) == 0 || szLineToRead[0] == ';' || (szLineToRead[0] == '/' && szLineToRead[1] == '/'))
  329.                 continue
  330.            
  331.             // Split our line by spaces to 4 parts: name or steam, password, flags, expire date
  332.             parse(szLineToRead, szParse[0], charsmax(szParse[]), szParse[1], charsmax(szParse[]), szParse[2], charsmax(szParse[]), szParse[3], charsmax(szParse[]))
  333.            
  334.             // Remove all "" from our 4 parts
  335.             remove_quotes(szParse[0])
  336.             remove_quotes(szParse[1])
  337.             remove_quotes(szParse[2])
  338.             remove_quotes(szParse[3])
  339.            
  340.             // Check expire date for this steam/name (Steam/Name unique to check with)
  341.             CheckDate(szParse[3], szParse[0])
  342.            
  343.             // Check if user in file is same who we check
  344.             if (equali(szSteamID, szParse[0]) || equali(szName, szParse[0]))
  345.             {
  346.                 // Player exists in the file, this means he is VIP
  347.                 g_bIsUserVIP[id] = true
  348.                 copy(g_szPassword, charsmax(g_szPassword), szParse[1])
  349.                
  350.                 // Return his flags
  351.                 return read_flags(szParse[2])
  352.             }
  353.         }
  354.     }
  355.     else
  356.     {
  357.         // File not exists, then create it (Here we can use new file system without problems)
  358.         new iFileHandler = fopen(g_szLocalFile, "wt")
  359.        
  360.         fputs(iFileHandler, "; Zombie Escape VIP^n^n")
  361.         fputs(iFileHandler, ";Flags:^n^n")
  362.         fputs(iFileHandler, "; a -- Connect Message and VIP List^n")
  363.         fputs(iFileHandler, "; b -- Multi-Jump^n")
  364.         fputs(iFileHandler, "; c -- Parachute^n")
  365.         fputs(iFileHandler, "; d -- Scoreboard Attrib.^n")
  366.         fputs(iFileHandler, "; e -- VIP Damage^n^n")
  367.         fputs(iFileHandler, ";Usage Example:^n^n")
  368.         fputs(iFileHandler, "; ^"Steam/Nick^" ^"Password^" ^"Flags^" ^"ExpireDate^"")
  369.  
  370.         fclose(iFileHandler)
  371.     }
  372.    
  373.     g_bIsUserVIP[id] = false
  374.    
  375.     if (g_bSetVIP[id] == true)
  376.     {
  377.         return g_iFlags[id]
  378.     }
  379.     else
  380.     {
  381.         return NON_VIP
  382.     }
  383. }
  384.  
  385. public native_ze_set_vip_flags(id, Flags)
  386. {
  387.     g_bSetVIP[id] = true
  388.     g_iFlags[id] = Flags
  389.     ze_get_vip_flags(id)
  390. }
  391.  
  392. public native_ze_is_user_vip(id)
  393. {
  394.     if (ze_get_vip_flags(id) & VIP_Z)
  395.         return false
  396.    
  397.     return true
  398. }
  399.  
  400. /*
  401. *   Dedicated stock for our plugin, to delete expired lines.
  402. *   You should give it the expire date, and key.
  403. *   Key should be unique like steam or name, so we can in another stock detect this line and delete it.
  404. */
  405. stock CheckDate(const szEndDate[], const szKey[])
  406. {
  407.     new szCurrentDate[64],
  408.         szFormatedEndDate[64],
  409.         szCurrentDay[32],
  410.         szCurrentMonth[32],
  411.         szCurrentYear[32],
  412.         szEndDay[32],
  413.         szEndMonth[32],
  414.         szEndYear[32]
  415.        
  416.     copy(szFormatedEndDate, charsmax(szFormatedEndDate), szEndDate)
  417.     get_time("%d-%m-%Y", szCurrentDate, charsmax(szCurrentDate))
  418.    
  419.     for (new ch = 0; ch <= charsmax(szFormatedEndDate); ch++)
  420.     {
  421.         if (szFormatedEndDate[ch] == '-')
  422.             szFormatedEndDate[ch] = ' '
  423.     }
  424.    
  425.     for (new ch = 0; ch <= charsmax(szCurrentDate); ch++)
  426.     {
  427.         if (szCurrentDate[ch] == '-')
  428.             szCurrentDate[ch] = ' '
  429.     }
  430.  
  431.     parse(szCurrentDate, szCurrentDay, charsmax(szCurrentDay), szCurrentMonth, charsmax(szCurrentMonth), szCurrentYear, charsmax(szCurrentYear))
  432.     parse(szFormatedEndDate, szEndDay, charsmax(szEndDay), szEndMonth, charsmax(szEndMonth), szEndYear, charsmax(szEndYear))
  433.    
  434.     if (str_to_num(szFormatedEndDate) == 0)
  435.         return
  436.    
  437.     new iCurrentDay,
  438.         iCurrentMonth,
  439.         iCurrentYear,
  440.         iEndDay,
  441.         iEndMonth,
  442.         iEndYear
  443.    
  444.     iCurrentDay   = str_to_num(szCurrentDay)
  445.     iCurrentMonth = str_to_num(szCurrentMonth)
  446.     iCurrentYear  = str_to_num(szCurrentYear)
  447.    
  448.     iEndDay   = str_to_num(szEndDay)
  449.     iEndMonth = str_to_num(szEndMonth)
  450.     iEndYear  = str_to_num(szEndYear)
  451.    
  452.     // Just a check, maybe useless
  453.     if ((!iCurrentDay && !iCurrentMonth && !iCurrentYear) || (!iEndDay && !iEndMonth && !iEndYear))
  454.         return
  455.    
  456.     /*
  457.     *   Check expire date algorithm idea:
  458.     *  
  459.     *   If current year > Expire year -- This means it's already expired so delete this line.
  460.     *
  461.     *   If Same year then check by month:
  462.     *   If current month > expire month -- Expired delete the line.
  463.     *
  464.     *   If same month then check by day:
  465.     *   If current day > expire date -- Expired detete the line.
  466.     */
  467.    
  468.     if (iEndYear < iCurrentYear)
  469.     {
  470.         Delete_Line(g_szLocalFile, szKey)
  471.     }
  472.     else if (iEndYear == iCurrentYear)
  473.     {
  474.         if (iEndMonth < iCurrentMonth)
  475.         {
  476.             Delete_Line(g_szLocalFile, szKey)
  477.         }
  478.         else if (iEndMonth == iCurrentMonth)
  479.         {
  480.             if (iEndDay < iCurrentDay)
  481.             {
  482.                 Delete_Line(g_szLocalFile, szKey)
  483.             }
  484.         }
  485.     }
  486. }
  487.  
  488. /*
  489. *   Stock used to delete line in file, based on key.
  490. *   Key is steamid or name.
  491. *   For some purposes we can't use new file system here.
  492. */
  493. stock Delete_Line(const szFile[], const szKey[])
  494. {
  495.     // Check if file there or not
  496.     if (file_exists(szFile))
  497.     {
  498.         // Get max lines in the file
  499.         new iMaxLines = file_size(szFile, FSOPT_LINES_COUNT)
  500.        
  501.         // Some variables
  502.         new Array:szFileLines, szLineToRead[400], iTextLen, szParse[4][65]
  503.        
  504.         // Create dynamic array to handle all lines in our file (every line will be in element)
  505.         szFileLines = ArrayCreate(400)
  506.        
  507.         // Loop through whole file
  508.         for (new iLine = 0; iLine < iMaxLines; iLine++)
  509.         {
  510.             // Read line by line
  511.             read_file(szFile, iLine, szLineToRead, charsmax(szLineToRead), iTextLen)
  512.            
  513.             // Just split our line so we get the steamid or name and compare with key
  514.             parse(szLineToRead, szParse[0], charsmax(szParse[]), szParse[1], charsmax(szParse[]), szParse[2], charsmax(szParse[]), szParse[3], charsmax(szParse[]))
  515.            
  516.             // Remove any ""
  517.             remove_quotes(szParse[0])
  518.             remove_quotes(szParse[1])
  519.             remove_quotes(szParse[2])
  520.             remove_quotes(szParse[3])
  521.            
  522.             // If steamid or name is same as one we need to delete, then don't copy to our array
  523.             if (equal(szParse[0], szKey))
  524.                 continue
  525.            
  526.             // Push all lines to our array except one we need to delete
  527.             ArrayPushString(szFileLines, szLineToRead)
  528.         }
  529.        
  530.         // Delete the file
  531.         delete_file(szFile)
  532.        
  533.         // Recreate the file and print all data to it
  534.         for (new iLine = 0; iLine < ArraySize(szFileLines); iLine++)
  535.         {
  536.             // Get strings in our array
  537.             ArrayGetString(szFileLines, iLine, szLineToRead, charsmax(szLineToRead))
  538.            
  539.             // Write them to our file
  540.             write_file(szFile, szLineToRead)
  541.         }
  542.        
  543.         // Destroy this array and free it's memory
  544.         ArrayDestroy(szFileLines)
  545.     }
  546. }
  547.  
  548. stock Happy_Hours()
  549. {
  550.     new szTime[3], szHappyHours[32], szHappyHours_Start[32], szHappyHours_End[32]
  551.     get_time("%H", szTime, charsmax(szTime))
  552.    
  553.     get_pcvar_string(g_pCvarHappyHours, szHappyHours, charsmax(szHappyHours))
  554.    
  555.     for (new ch = 0; ch <= charsmax(szHappyHours); ch++)
  556.     {
  557.         if (szHappyHours[ch] == '-')
  558.             szHappyHours[ch] = ' '
  559.     }
  560.    
  561.     parse(szHappyHours, szHappyHours_Start, charsmax(szHappyHours_Start), szHappyHours_End, charsmax(szHappyHours_End))
  562.    
  563.     new iTime, iHappyHourStart, iHappyHourEnd
  564.    
  565.     iTime = str_to_num(szTime)
  566.     iHappyHourStart = str_to_num(szHappyHours_Start)
  567.     iHappyHourEnd = str_to_num(szHappyHours_End)
  568.    
  569.     if(iHappyHourEnd > iTime >= iHappyHourStart)
  570.     {
  571.         g_bIsHappyHour = true
  572.     }
  573.     else
  574.     {
  575.         g_bIsHappyHour = false
  576.     }
  577. }
He who fails to plan is planning to fail

Muhammet20
Veteran Member
Veteran Member
Posts: 407
Joined: 5 years ago
Contact:

#4

Post by Muhammet20 » 5 years ago

sPe3doN wrote: 5 years ago viewtopic.php?f=15&t=39 use this vip plugin and remove wht you dont need it
thanks i will try them

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest