Approved VIP System

Gameplay Addons
User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1950
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

VIP System

#1

Post by Raheem » 2 Years Ago

VIP System

Description:
  • VIP system for our Zombie Escape Mod, With this plugin you can make VIPs. This system now have:
    1. MultiJump
    2. Parachute
    3. Free Hours - Time All players will became VIPs
    4. Connect & Contact Messages
    5. Scoreboard Tag
    6. Multiply Weapons Damage
Cvars:
  • ze_connect_message 1 Show chat notice Message When VIP Connected? 1 = Show | 0 = Don't Show
  • ze_admin_contact "Admin Name" Add your name or any contact method. To disable this change "Admin Name" to ""
  • ze_give_vip_multijump 1 Enable or Disable MultiJump for VIPs? 1 = Enable | 0 = Disable
  • ze_show_vip_scoreboard 1 Show VIP in the Score Board? 1 = Show | 0 = Don't Show
  • ze_give_vip_parachute 1 Enable or Disable Parachute for VIPs? 1 = Enable | 0 = Disable
  • ze_enable_happy_hours 1 Enable or Disable Happy Hours? 1 = Enable | 0 = Disable
  • ze_vip_happy_hours "9-12" Happy hours: Start-End
  • ze_happy_hours_vip_flags "abcde" Flags to give to all players in Happy Hours?
  • ze_vip_multiply_damage 1.2 Multiply VIP damage by this factor. 0 = Disabled

Natives (API):
  • ze_get_vip_flags(id) This will return player flags as a bitflag sum. id is player index.
  • ze_set_vip_flags(id, iFlags) Set player flags. id is the player index and iFlags is flags to give as bitflag sum.
  • ze_is_user_vip(id) Check if user VIP or not. id is the player index.
Commands:
  • say /vip OR say_team /vip Show Online VIPs and Contact Message.
  • say /vips OR say_team /vips Show Online VIPs and Contact Message.
  • say /getvip OR say_team /getvip Show Motd about VIP.

Examples & Instructions:
  • VIPs are set in ze_vips.ini in configs folder. There is flags and every flag give the player ability so default flags is:
    1. a -- Connect Message and VIP List
    2. b -- Multi-Jump
    3. c -- Parachute
    4. d -- Scoreboard Attrib.
    5. e -- VIP Damage
  • Making VIPs Syntax: "Steam/Nick" "Password" "Flags" "ExpireDate"
  • Some Examples:
    1. "STEAM_1:0:1442018137" "550" "abcde" "11-09-2018" - This VIP will get all flags and will be able to use all of them. Also will be removed at the expire date defined.
    2. "Raheem" "EscapersZone" "ab" "0" - This VIP will get only Connect Message and VIP List and Multi-Jump. This VIP will not expire will never automatically removed.
  • Player can set the password normally from setinfo same as normal admin.
  • ze_happy_hours_vip_flags "Flags" Will define when happy hours come what flags to be given for all players?
  • You can change all cvars easily from ze_vip.cfg
  • You need to install MultiJump and Parachute So that VIP system works correctly. Recommended Cvar:
    1. ze_give_all_multijump 0
    2. ze_give_all_parachute 0
  • Don't forget to edit motd file ze_vip.txt and set your information there.
  • Happy hours start and end time is depend on server time and server time depend on the machine which your server hosted on. Say thetime to get your server time inside the game.
  • ze_get_vip_flags(id) Use it same as you use get_user_flags() Find flags in ze_vip.inc you can also add more flags as you need. Flag z mean this is normal player not vip.
  • ze_set_vip_flags(id, iFlags) This native will set flags you give to player at the spawn and these flags will be removed at the end of the round. This not need password you can use in awards plugins and so on. iFlags is the flag in this format: VIP_A, VIP_B .... Some examples:
    1. ze_set_vip_flags(id, VIP_A) This will set to the player Flag a only.
    2. ze_set_vip_flags(id, VIP_A|VIP_B) This will set to player flags a and b.
    3. ze_set_vip_flags(id, VIP_A|VIP_B|VIP_C|VIP_D) This will set to the players all the flags abcd
  • In set vip flags native we can make things easy and you can set player flags like:
    1. ze_set_vip_flags(id, read_flags("a")) This will give player flag a
    2. ze_set_vip_flags(id, read_flags("abc")) This will give the player flags abc the three flags.
  • You can change flags from code and recompile the plugin:
    • Code: Select all

      #define VIP_MESSAGES    VIP_A
      #define MULTIJUMP	VIP_B
      #define PARACHUTE	VIP_C
      #define SCOREBOARD	VIP_D
      #define DAMAGE		VIP_E
      #define NON_VIP		VIP_Z
    Comment #define MULTIJUMP or #define PARACHUTE or both, so in this case you will not need to install these plugins so VIP plugin run correctly.
  • At expire date, the VIP will automatically removed from the ze_vips.ini file. If you set expire date to 0 then it will never expire.
  • Expire date format: day-month-year, Examples: 09-09-2019 or 9-9-2019 both valid.
  • If you need to set happy hours start at 9 and end at 11 then: ze_vip_happy_hours "9-11"
Changelog:
  • Spoiler!
    Image
    • First Release.
    Image
    • Added contact message and say /vip to show all online VIPs.
    • Added new motd for VIP say /getvip.
    • Added Parachute.
    • Added new two natives
    • Added New flags now used rather than old ones used in users.ini the new file is ze_vip.ini
    • Added new config file for VIP system ze_vip.cfg
    • Added support with name & steamid in VIP system.
    • Added cvar to know servers running our vip system: ze_vip_version
    Image
    • Fixed vips online list.
    • Fixed flags order, this will fix all Happy Hours problems.
    • Added ability to disable parachute/multijump from definations in code, so you will not need to run these plugins so VIP plugin works.
    • Fixed some code problems, updated code style.
    • Edited including method.
    • Some optimization by jack.
    • Added description for functions, check Natives API.
    Image [Current Version]
    • Added option to set expire date to automatically remove VIPs at this date.
    • Added multiple damage by x factor for VIPs on specific flag.
    • Combined happy hours start and end cvars in one cvar.
    • Used new file system function (fopen, fgets ...) whenever it's possible.
    • Fixed some problems in ze_get_vip_flags() native.
    • Updated motd with good style and new things.
    • Added new native to check if user VIP or not ze_is_user_vip().

Downloads:
You don't know? Learn and you will know.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1950
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#2

Post by Raheem » 2 Years Ago

-Simple update inserted, So if you use this plugin please download the new Version.
You don't know? Learn and you will know.

k1llerZm
Member
Member
Posts: 3
Joined: 2 Years Ago
Has thanked: 0
Been thanked: 0
Contact:

#3

Post by k1llerZm » 2 Years Ago

you can't make new ini for it ? vips.ini

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1950
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#4

Post by Raheem » 2 Years Ago

k1llerZm wrote:
2 Years Ago
you can't make new ini for it ? vips.ini
I can make it but i assume that using the default one "users.ini" is more efficient. And can you tell me why you need another vips.ini? if you need it for good reason i'll make it.
You don't know? Learn and you will know.

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 577
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#5

Post by Jack GamePlay » 2 Years Ago

Would you try this? :)
Features:
Motd.
/vips --> Shows online VIPs.
Custom DMG.
Prefix.
  1. #include <zombie_escape>
  2.  
  3. #define VIP ADMIN_LEVEL_H
  4.  
  5. new Pcvars[4]
  6.  
  7. static const COLOR[] = "^x04" //green
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin("[ZE] VIP Features", "1.0", "JaCk")
  12.     register_clcmd("say /vip", "show_vip_motd")
  13.     register_clcmd("say", "handle_say")
  14.    
  15.     // Cvars
  16.     Pcvars[0] = register_cvar("ze_vip_enable_damage", "1") // 0 = Disable custom Damage || 1 = Enable
  17.     Pcvars[1] = register_cvar("ze_vip_damage", "3")
  18.     Pcvars[2] = register_cvar("ze_vip_contact_info", "Who to contact?") // Remember! Change this
  19.     Pcvars[3] = register_cvar("ze_vip_enable_prefix", "1") // 1 = Enable Prefix || 0 = Disable
  20.    
  21.     //Ham
  22.     RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG", 1)
  23.    
  24.     // Message(s)
  25.     register_message(get_user_msgid("SayText"),"Say_Text")
  26. }
  27.  
  28. public show_vip_motd(id)
  29. {
  30.     show_motd(id, "vip.txt", "VIP Features")
  31. }
  32.  
  33. public Fw_Take_DMG(attacker, Inflictor, victim, Float:Damage, bitsDamageType)
  34. {
  35.     if(!is_user_alive(attacker) || !is_user_alive(victim))
  36.         return HC_SUPERCEDE;
  37.        
  38.     if((get_user_flags(attacker) & VIP) && get_pcvar_num(Pcvars[0]))
  39.     {
  40.         SetHamParamFloat(4, Damage * get_pcvar_float(Pcvars[1]))
  41.     }
  42. }
  43.  
  44. public Say_Text(msgId, msgDest, msgEnt)
  45. {
  46.     new id = get_msg_arg_int(1);
  47.    
  48.     if(is_user_connected(id) && get_user_flags(id) & VIP && get_pcvar_num(Pcvars[3])
  49.     {
  50.         new szTmp[256], szTmp2[256]
  51.         get_msg_arg_string(2, szTmp, charsmax(szTmp))
  52.         new szPrefix[64] = "^x01[ ^x04VIP ^x01]" // Chnage Prefix from here !!!
  53.        
  54.         if(!equal(szTmp, "#Cstrike_Chat_All"))
  55.         {
  56.             add(szTmp2, charsmax(szTmp2), szPrefix)
  57.             add(szTmp2, charsmax(szTmp2), " ")
  58.             add(szTmp2, charsmax(szTmp2), szTmp)
  59.         }
  60.         else
  61.         {
  62.             add(szTmp2, charsmax(szTmp2), szPrefix)
  63.             add(szTmp2, charsmax(szTmp2), "^x03 %s1^x01 :  %s2")
  64.         }
  65.         set_msg_arg_string(2, szTmp2)
  66.     }
  67.     return PLUGIN_CONTINUE;
  68. }
  69.  
  70. public handle_say(id)
  71. {
  72.     new said[192]
  73.     read_args(said, charsmax(said))
  74.     if((containi(said, "who") != -1 && containi(said, "vip") != -1) || contain(said, "/vips") != -1)
  75.     {
  76.         set_task(0.1,"print_adminlist",id)
  77.     }
  78.     return PLUGIN_CONTINUE;
  79. }
  80.  
  81. public print_adminlist(user)
  82. {
  83.     new adminnames[33][32], message[256], contactinfo[256], contact[112], id, count, x, len
  84.     for(id = 1 ; id <= get_maxplayers() ; id++)
  85.     {
  86.         if(is_user_connected(id) && get_user_flags(id) & VIP)
  87.         {
  88.             get_user_name(id, adminnames[count++], charsmax(adminnames))
  89.             len = format(message, charsmax(message), "%s VIPs ONLINE: ", COLOR)
  90.             if(count > 0)
  91.             {
  92.                 for(x = 0 ; x < count ; x++)
  93.                 {
  94.                     len += format(message[len], charsmax(message)-len, "%s%s ", adminnames[x], x < (count-1) ? ", " : "")
  95.                     if(len > 96 )
  96.                     {
  97.                         print_message(user, message)
  98.                         len = format(message, 255, "%s ",COLOR)
  99.                     }
  100.                 }
  101.                 print_message(user, message)
  102.             }
  103.             else
  104.             {
  105.                 len += format(message[len], 255-len, "No VIPs online.")
  106.                 print_message(user, message)
  107.             }
  108.    
  109.             get_pcvar_num(Pcvars[2], contact, charsmax(contact))
  110.             if(contact[0])
  111.             {
  112.                 format(contactinfo, charsmax(contactinfo), "%s Contact Server Admin -- %s", COLOR, contact)
  113.                 print_message(user, contactinfo)
  114.             }
  115.         }
  116.     }
  117. }
  118.  
  119. print_message(id, msg[])
  120. {
  121.     message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
  122.     write_byte(id)
  123.     write_string(msg)
  124.     message_end()
  125. }
NOTE: I didn't test or compile but should work fine. :)
Not interested in CS/Pawn anymore.
Accepting web projects.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1950
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#6

Post by Raheem » 2 Years Ago

JaCk GamePlay, Nice ideas i'll include it in the next update.
You don't know? Learn and you will know.

OxiCorm
Member
Member
Posts: 33
Joined: 2 Years Ago
Has thanked: 0
Been thanked: 0
Contact:

#7

Post by OxiCorm » 2 Years Ago

Raheem wrote:
2 Years Ago
JaCk GamePlay, Nice ideas i'll include it in the next update.
raheem ze vip system its free for all ?
how can i add it only for admin flag and set happy hours

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1950
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#8

Post by Raheem » 2 Years Ago

OxiCorm, Not free for all you can control the Free VIP Hours from Cvars posted above. Also you can turn off happy hours if you need just set this to 0 like: ze_enable_happy_hours 0
So if you disabled this it will be for Players who have the access you give from users.ini
You don't know? Learn and you will know.

OxiCorm
Member
Member
Posts: 33
Joined: 2 Years Ago
Has thanked: 0
Been thanked: 0
Contact:

#9

Post by OxiCorm » 2 Years Ago

Oh ok thanks raheem ithought will be vip cfg or ini but thanks any way

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1950
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#10

Post by Raheem » 2 Years Ago

In the new coming versions i'll try make nice new things but this now is just a start.
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest