Plugin Available Ultimate VIP Features

Unpaid Requests, Public Plugins
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

Ultimate VIP Features

#1

Post by Spir0x » 3 Months Ago

Hey everyone, today i'm here with new big idea for VIP. it's Ultimate VIP Features.

It's all about to add a special case "VIP Menu" in main menu allowed only for VIP's with Flag "T" // I mean (ADMIN_LEVEL_H).

Example:

1. Buy weapons
2. Extra-Items
3. VIP Menu

/// What's new in this menu when you click on it ?

1. Knife Menu (Allowed Only for VIP's Of Course)

► Karambit
► Butterfly
► Flachion
► Dual Katana

2. Guns Menu (Allowed Only for VIP's Of Course)

► Lycanthrope [Human]
► Dual Infinity [Human]


3. Glow Menu (Allowed Only for VIP's Of Course)

► Server will choose a random glow for vip's every round .



4. Daily Coins

► (Get 1000 Coins every 24h)



Zombie VIP's can use only: (Daily Golds)


And never forget there's a simple vip features plugin that gives fire/frost nades & more damage, if there's a new idea or update i will add it.
Last edited by Spir0x on 28 Jun 2019, 15:51, edited 5 times in total.
I trynna make money, not friends.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#2

Post by Spir0x » 3 Months Ago

So no one start thinking about making that useful plugin ?!
I trynna make money, not friends.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 609
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#3

Post by Mohamed Alaa » 3 Months Ago

1) You didn't provide resources for these knives:
► Karambit
► Butterfly
► Flachion
► Dual Katana

2) ► Lycanthrope [Human]
► Unlimited Clip [Human]
► Dual Infinity [Human]
► Leap [Zombie]
► Knockback Bomb [Zombie]
► Blind Bomb [Zombie]

3)
► Skin 1
► Skin 2
► Skin 3
► Skin 4

This is too much for a free one, you shall start making it and post any issues you face
Want your own mod edition? PM me.
Accepting web projects.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#4

Post by Spir0x » 3 Months Ago

I don't even know how to make it. this is why i posted here to search help, I can upload knife menu for vips and all extra-items & skins menu for vips too.
I trynna make money, not friends.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#5

Post by Spir0x » 3 Months Ago

So here you are. check the topic again now. updated
ze_glow_menu.rar
(1.46 KiB) Downloaded 21 times
ze_glow_menu.rar
(1.46 KiB) Downloaded 21 times
ze_extra_leap_vip.rar
(1.83 KiB) Downloaded 20 times
ze_extra_leap_vip.rar
(1.83 KiB) Downloaded 20 times
ze_dual_infinity_vip.rar
(4.62 KiB) Downloaded 20 times
ze_dual_infinity_vip.rar
(4.62 KiB) Downloaded 20 times
ze_daily_golds.rar
(1.4 KiB) Downloaded 19 times
ze_daily_golds.rar
(1.4 KiB) Downloaded 19 times
ze_anti_dote_owner.rar
(702 Bytes) Downloaded 12 times
ze_anti_dote_owner.rar
(702 Bytes) Downloaded 12 times
I trynna make money, not friends.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#6

Post by Spir0x » 3 Months Ago

ze_vip_trail.rar
(1.1 KiB) Downloaded 18 times
ze_vip_trail.rar
(1.1 KiB) Downloaded 18 times
ze_no_recoil_owner.rar
(1.08 KiB) Downloaded 16 times
ze_no_recoil_owner.rar
(1.08 KiB) Downloaded 16 times
ze_lycanthrope_vip.rar
(4.14 KiB) Downloaded 17 times
ze_lycanthrope_vip.rar
(4.14 KiB) Downloaded 17 times
ze_knife_menu.rar
(2.41 KiB) Downloaded 17 times
ze_knife_menu.rar
(2.41 KiB) Downloaded 17 times
All done !
I trynna make money, not friends.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 609
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#7

Post by Mohamed Alaa » 3 Months Ago

VIP Menu:
  1. #include <zombie_escape>
  2. #include <ze_vip>
  3.  
  4. native ze_open_knife_menu(id)
  5. native ze_open_glow_menu(id)
  6. native ze_give_lycanthrope_vip(id)
  7. native ze_give_infinity(id)
  8. native ze_give_norecoil(id)
  9. native ze_give_antidote(id)
  10. native ze_give_leap(id)
  11. native ze_give_free_coins(id)
  12.  
  13. const OFFSET_CSMENUCODE = 205
  14. const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
  15.  
  16. public plugin_natives()
  17. {
  18.     register_native("ze_open_ultvip_menu", "native_ze_open_ultvip_menu", 1)
  19. }
  20.  
  21. public native_ze_open_ultvip_menu(id)
  22. {
  23.     if (!is_user_connected(id))
  24.         return -1
  25.  
  26.     if (!(get_user_flags(id) & ADMIN_LEVEL_H))
  27.         return false
  28.  
  29.     Show_Menu(id)
  30.     return true
  31. }
  32.  
  33. public plugin_init()
  34. {
  35.     register_plugin("[ZE] Ultimate VIP", "1.0", "Jack")
  36.     register_menu("VIP Menu", KEYSMENU, "Main_Menu")
  37. }
  38.  
  39. public Show_Menu(id)
  40. {
  41.     static szMenu[250]
  42.     new iLen
  43.    
  44.     iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\rUltimate VIP menu^n")
  45.    
  46.     iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y1\d. \wKnife menu")
  47.    
  48.     if (is_user_alive(id))
  49.     {
  50.         iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y2\d. \wGuns menu")
  51.     }
  52.     else
  53.     {
  54.         iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\d2. Guns menu")
  55.     }
  56.  
  57.     iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y3\d. \wGlow menu")
  58.     iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y4\d. \wFree 500 EC")
  59.     iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\y0\d. \r%L", id, "EXIT")
  60.    
  61.     set_pdata_int(id, OFFSET_CSMENUCODE, 0)
  62.     show_menu(id, KEYSMENU, szMenu, -1, "Main Menu")
  63. }
  64.  
  65. public Main_Menu(id, key)
  66. {
  67.     if (!is_user_connected(id))
  68.         return PLUGIN_HANDLED
  69.    
  70.     switch (key)
  71.     {
  72.         case 0: ze_open_knife_menu(id)
  73.         case 1:
  74.         {
  75.             if (is_user_alive(id))
  76.             {
  77.                 if (ze_is_user_zombie(id))
  78.                     Open_ZGunMenu(id)
  79.                 else
  80.                     Open_HGunMenu(id)
  81.             }
  82.             else
  83.             {
  84.                 ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
  85.             }
  86.         }
  87.         case 2: ze_open_glow_menu(id)
  88.         case 3: ze_give_free_coins(id)
  89.     }
  90.     return PLUGIN_HANDLED
  91. }
  92.  
  93. public Open_ZGunMenu(id)
  94. {
  95.     new iMenu = menu_create("\rVIP Items:^n^n", "ZVIPMenu_Handler")
  96.     menu_additem(iMenu, "Antidote")
  97.     menu_additem(iMenu, "Leap")
  98.  
  99.     menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
  100.     menu_display(id, iMenu, 0)
  101. }
  102.  
  103. public ZVIPMenu_Handler(id, iMenu, iItem)
  104. {
  105.     if (!is_user_connected(id))
  106.         return PLUGIN_CONTINUE
  107.  
  108.     switch (iItem)
  109.     {
  110.         case 0: ze_give_antidote(id)
  111.         case 1: ze_give_leap(id)
  112.     }
  113.    
  114.     menu_destroy(iMenu)
  115.     return PLUGIN_HANDLED
  116. }
  117.  
  118. public Open_HGunMenu(id)
  119. {
  120.     new iMenu = menu_create("\rVIP Items:^n^n", "HVIPMenu_Handler")
  121.     menu_additem(iMenu, "Lycanthrope")
  122.     menu_additem(iMenu, "Dual Infinity")
  123.     menu_additem(iMenu, "No Recoil")
  124.     menu_additem(iMenu, "Antidote")
  125.  
  126.     menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
  127.     menu_display(id, iMenu, 0)
  128. }
  129.  
  130. public HVIPMenu_Handler(id, iMenu, iItem)
  131. {
  132.     if (!is_user_connected(id))
  133.         return PLUGIN_CONTINUE
  134.  
  135.     switch (iItem)
  136.     {
  137.         case 0: ze_give_lycanthrope_vip(id)
  138.         case 1: ze_give_infinity(id)
  139.         case 2: ze_give_norecoil(id)
  140.     }
  141.    
  142.     menu_destroy(iMenu)
  143.     return PLUGIN_HANDLED
  144. }

Trail:
  1. #include <zombie_escape>
  2.  
  3. #define VIP_ACCESS ADMIN_LEVEL_H
  4.  
  5. new gTrailSprite, gTrailRandomColor[33][3], bPlayerTrailStatus[33], Float:bflNextCheck[33]
  6. const IN_MOVING = IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("VIP Trail", "2.0", "Jack")
  11.     register_forward(FM_CmdStart, "forward_cmdstart")
  12.     register_clcmd("say trail", "cmdMakeOwnerTrail", VIP_ACCESS)
  13.     register_clcmd("say_team trail", "cmdMakeOwnerTrail", VIP_ACCESS)
  14.    
  15.     RegisterHookChain(RG_CBasePlayer_Spawn, "Fw_PlayerSpawn_Post", 1)
  16. }
  17.  
  18. public plugin_precache()    gTrailSprite = precache_model("sprites/new_trail_1.spr")
  19. public client_connect(id)   bPlayerTrailStatus[id] = 0
  20. public Fw_PlayerSpawn_Post(id)
  21. {
  22.     if(get_user_flags(id) & VIP_ACCESS)
  23.     {
  24.         bPlayerTrailStatus[id] = 1
  25.         gTrailRandomColor[id][0] = random_num(0, 255)
  26.         gTrailRandomColor[id][1] = random_num(0, 255)
  27.         gTrailRandomColor[id][2] = random_num(0, 255)
  28.         set_task(10.0, "change_color", id+81732519124, "b")
  29.     }
  30. }
  31.  
  32. public change_color(taskid)
  33. {
  34.     new id = taskid - 81732519124
  35.  
  36.     if(!is_user_alive(id))
  37.     {
  38.         remove_task(taskid)
  39.         return
  40.     }
  41.  
  42.     gTrailRandomColor[id][0] = random_num(0, 255)
  43.     gTrailRandomColor[id][1] = random_num(0, 255)
  44.     gTrailRandomColor[id][2] = random_num(0, 255)
  45. }
  46.  
  47. public cmdMakeOwnerTrail(id)
  48. {
  49.     if(!is_user_alive(id) || !(get_user_flags(id) & VIP_ACCESS))
  50.         return
  51.  
  52.     if(bPlayerTrailStatus[id] == 1)
  53.     {
  54.         bPlayerTrailStatus[id] = 0
  55.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  56.         write_byte(TE_KILLBEAM)  
  57.         write_short(id)
  58.         message_end()
  59.         bflNextCheck[id] = -5000.0
  60.         ze_colored_print(id, "!gTrail !thas been de-activated !y!")
  61.     }
  62.     else if(bPlayerTrailStatus[id] == 0)
  63.     {  
  64.         bPlayerTrailStatus[id] = 1    
  65.         gTrailRandomColor[id][0] = random_num(0, 255)
  66.         gTrailRandomColor[id][1] = random_num(0, 255)
  67.         gTrailRandomColor[id][2] = random_num(0, 255)
  68.         ze_colored_print(id, "!gTrail !thas been activated !y!")
  69.     }
  70. }
  71.  
  72. public forward_cmdstart(id, handle)
  73. {
  74.     if(!is_user_alive(id) || bPlayerTrailStatus[id] == 0)   return
  75.    
  76.     if(!(get_uc(handle, UC_Buttons) & IN_MOVING))
  77.     {
  78.         if(bflNextCheck[id] < get_gametime())
  79.         {  
  80.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  81.             write_byte(TE_KILLBEAM)  
  82.             write_short(id)
  83.             message_end()
  84.            
  85.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  86.             write_byte(TE_BEAMFOLLOW)
  87.             write_short(id)
  88.             write_short(gTrailSprite)
  89.             write_byte(15)
  90.             write_byte(20)
  91.             write_byte(gTrailRandomColor[id][0])
  92.             write_byte(gTrailRandomColor[id][1])
  93.             write_byte(gTrailRandomColor[id][2])
  94.             write_byte(255)
  95.             message_end()
  96.    
  97.             bflNextCheck[id] = get_gametime() + (15/8)
  98.         }
  99.     }
  100. }
  101. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  102. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1042\\ f0\\ fs16 \n\\ par }
  103. */

Antidote:
  1. #include <zombie_escape>
  2.  
  3. public plugin_natives()
  4. {
  5.     register_native("ze_give_antidote", "native_ze_give_antidote", 1)
  6. }
  7.  
  8. public native_ze_give_antidote(id)
  9. {
  10.     if (!is_user_connected(id))
  11.         return -1
  12.  
  13.     Get_Antidote(id)
  14.     return true
  15. }
  16.  
  17. public plugin_init()
  18. {
  19.   register_plugin("[ZE] Extra Item: Antidote", "1.0", "Spi")
  20. }
  21.  
  22. public Get_Antidote(id)
  23. {
  24.   new szName[32]
  25.   ze_set_user_human(id)
  26.   get_user_name(id, szName, charsmax(szName))
  27.   set_hudmessage(0, 0, 255, -0.05, -0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
  28.   show_hudmessage(0, "%s has used antidote!", szName)
  29. }
  30.  
  31. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  32. *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
  33. */

EC reward:
  1. #include <zombie_escape>
  2. #include <nvault>
  3.  
  4. #define NV_NAME "GET_GOLDS"
  5.  
  6. enum player_struct {
  7.     mtime,bool:ftime,key[64]
  8. }
  9. new g_player[33][player_struct];
  10.  
  11. new cvar_save_type,cvar_time,cvar_coins;
  12.  
  13. public plugin_natives()
  14. {
  15.     register_plugin("ze_give_free_coins", "native_ze_give_free_coins", 1)
  16. }
  17.  
  18. public native_ze_give_free_coins(id)
  19. {
  20.     if (!is_user_connected(id))
  21.         return -1
  22.  
  23.     cmd_coins(id)
  24.     return true
  25. }
  26.  
  27. public plugin_init() {
  28.  
  29.     register_plugin("Get Escape Coins", "1.0", "ZE DEV TEAM");
  30.    
  31.     cvar_save_type = register_cvar("get_golds_save_type","1"); // how to save data 1 by authid, 2 by ip or 3 by name
  32.     cvar_time = register_cvar("get_golds_minutes","720"); // time in minutes, 720minutes=12hours it will be auto calculated
  33.     cvar_coins = register_cvar("get_golds_coins","200"); // how many coins to give
  34. }
  35.        
  36. public cmd_coins(id) {
  37.  
  38.     new nv = nvault_open(NV_NAME);
  39.    
  40.     if(nv == INVALID_HANDLE) {
  41.         ze_colored_print(id, "!tFor the moment getting golds system is inactive..");
  42.         return;
  43.     }
  44.    
  45.     new txt_min[32],txt_coins[10];
  46.     new coins = get_pcvar_num(cvar_coins),pminutes = get_pcvar_num(cvar_time);
  47.     copy(txt_coins,charsmax(txt_coins),(coins==1)?"coin":"coins");
  48.     build_time(pminutes,txt_min,charsmax(txt_min));
  49.    
  50.     if(g_player[id][ftime]) {
  51.         ze_colored_print(id, "!tYou have received !g%d !tGolds!y, !tget another in !g%s!y!",coins,txt_min);
  52.         ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);
  53.         g_player[id][ftime]=false;
  54.         nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
  55.         return;
  56.     }
  57.    
  58.     new user_time=get_systime()-g_player[id][mtime];
  59.     new diff_min=(user_time<(pminutes*60))?pminutes-(user_time/60):pminutes;
  60.     build_time(diff_min,txt_min,charsmax(txt_min));
  61.    
  62.     if(user_time>=(pminutes*60)) {
  63.         ze_colored_print(id, "!tYou have just received !g%d !tGolds!y, !tsince !g%s !tpassed!y!",coins,txt_min);
  64.         ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);  
  65.         nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
  66.     }
  67.     else
  68.         ze_colored_print(id, "!tRetry again in !g%s !tfor getting !g%d !tmore Golds!y.",txt_min,coins);
  69.        
  70.     nvault_close(nv);
  71. }
  72.  
  73. public client_putinserver(id) {
  74.        
  75.     new nv,data[32];
  76.     get_auth(id,g_player[id][key],charsmax(g_player[][key]));
  77.     g_player[id][mtime]=get_systime();
  78.     g_player[id][ftime]=false;
  79.     formatex(data,charsmax(data),"%d",g_player[id][mtime]);
  80.    
  81.     if((nv=nvault_open(NV_NAME))==INVALID_HANDLE)
  82.         return;
  83.    
  84.     if(!nvault_lookup(nv,g_player[id][key],data,charsmax(data),g_player[id][mtime])) {
  85.         nvault_set(nv,g_player[id][key],data);
  86.         g_player[id][ftime]=true;
  87.     }
  88.    
  89.     nvault_close(nv);
  90. }    
  91.  
  92. public client_disconnected(id) {
  93.    
  94.     g_player[id][mtime]=0;
  95.     g_player[id][ftime]=false;
  96. }
  97.  
  98. stock get_auth(id,data[],len)
  99.     switch(get_pcvar_num(cvar_save_type)) {
  100.         case 1: get_user_authid(id,data,len);
  101.         case 2: get_user_ip(id,data,len,1);
  102.         case 3: get_user_name(id,data,len);
  103.     }
  104.  
  105. stock build_time(pminutes,data[],len)
  106.     if(pminutes==1)
  107.         copy(data,len,"1 minute");
  108.     else if(pminutes!=1&&pminutes<60)
  109.         formatex(data,len,"%d minutes",pminutes);
  110.     else if(pminutes==60)
  111.         copy(data,len,"1 hour");
  112.     else {
  113.         new ptime=pminutes/60;
  114.         if(ptime*60==pminutes)
  115.             formatex(data,len,"%d %s",ptime,(ptime==1)?"hour":"hours");
  116.         else {
  117.             new diff=pminutes-ptime*60;
  118.             formatex(data,len,"%d %s and %d %s",ptime,(ptime==1)?"hour":"hours",diff,(diff==1)?"minute":"minutes");
  119.         }
  120.     }
  121. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  122. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
  123. */

Infinity:
  1. #include <ze_vip>
  2. #include <cstrike>
  3. #include <fakemeta_util>
  4.  
  5.  
  6. #define PLUGIN "[ZE] Extra : DualInfinity"
  7. #define VERSION "1.0"
  8. #define AUTHOR "Spi"
  9.  
  10. #define CONFIG_CFG_FILE "weapons/dual_infinity.cfg"
  11.  
  12. #define OFFSET_LINUX_WEAPONS 4
  13. #define OFFSET_LINUX 5
  14.  
  15. #define m_flNextAttack  83
  16. #define m_flNextPrimaryAttack   46
  17. #define m_flTimeWeaponIdle  48
  18. #define m_fInReload     54
  19.  
  20. #define pev_weaponkey pev_impulse
  21. #define weaponkey_value 18318
  22.  
  23. #define CSW_INFINITY CSW_ELITE
  24. #define VIP_ACCESS ADMIN_LEVEL_H
  25.  
  26. new const g_weapon_entity[]="weapon_elite"
  27. new const g_weapon_event1[]="events/elite_right.sc"
  28. new const g_weapon_event2[]="events/elite_left.sc"
  29. new const g_weapon_weaponbox_model[]="models/w_elite.mdl"
  30.  
  31. new const weapon_list_txt[]="weapon_dual_infinity2"
  32.  
  33. new const weapon_list_sprites[][]=
  34. {  
  35.     "sprites/640hud42.spr",
  36.     "sprites/640hud43.spr",
  37.     "sprites/640hud7.spr"
  38. }
  39.  
  40. new const ViewModel[]="models/Premuim_ZE/v_infinity.mdl"
  41. new const PlayerModel[]="models/Premuim_ZE/p_infinity.mdl"
  42. new const WorldModel[]="models/Premuim_ZE/w_infinity.mdl"
  43.  
  44. new const Sounds[][]=
  45. {
  46.     "weapons/infi-1.wav",
  47.     "weapons/infi_clipin.wav",
  48.     "weapons/infi_clipon.wav",
  49.     "weapons/infi_clipout.wav",
  50.     "weapons/infi_draw.wav"
  51. }
  52.  
  53. new Blood[2]
  54.  
  55. new g_orig_event_dinfinity
  56.  
  57. new g_HasInfinity[33], g_player_weapon_ammo[33], Float:cl_pushangle[33][3],  g_shoot_anim[33], g_hitgroup[33]
  58. new g_mode[33], g_anim_mode[33]
  59.  
  60. new pcvar_item_name, pcvar_clipammo, pcvar_bpammo, pcvar_cost, pcvar_time_fire_normal, pcvar_time_fire_fast
  61.  
  62. new pcvar_normal_damage_head, pcvar_normal_damage_chest, pcvar_normal_damage_stomach, pcvar_normal_damage_arms, pcvar_normal_damage_legs
  63. new pcvar_fast_damage_head, pcvar_fast_damage_chest, pcvar_fast_damage_stomach, pcvar_fast_damage_arms, pcvar_fast_damage_legs
  64.  
  65. new Float:cvar_time_fire_normal, Float:cvar_time_fire_fast
  66.  
  67. const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
  68.  
  69. public plugin_natives()
  70. {
  71.     register_native("ze_give_infinity", "native_ze_give_infinity", 1)
  72. }
  73.  
  74. public native_ze_give_infinity(id)
  75. {
  76.     if (!is_user_connected(id))
  77.         return -1
  78.  
  79.     give_infinity(id)
  80.     return true
  81. }
  82.  
  83. public plugin_init()
  84. {  
  85.     register_plugin(PLUGIN, VERSION, AUTHOR)
  86.    
  87.     register_clcmd(weapon_list_txt, "Redirect")
  88.    
  89.     pcvar_item_name=register_cvar("dinfinity_item_name", "Dual Infinity")
  90.     pcvar_cost=register_cvar("dinfinity_cost", "15")
  91.     pcvar_bpammo=register_cvar("dinfinity_bpammo", "100")
  92.     pcvar_clipammo=register_cvar("dinfinity_clipammo", "40")
  93.     pcvar_time_fire_normal=register_cvar("dinfinity_fire_normal_period", "0.15")
  94.     pcvar_time_fire_fast=register_cvar("dinfinity_fire_fast_period", "0.02")
  95.    
  96.     pcvar_normal_damage_head=register_cvar("dinfinity_normal_damage_head", "130")
  97.     pcvar_normal_damage_chest=register_cvar("dinfinity_normal_damage_chest", "34")
  98.     pcvar_normal_damage_stomach=register_cvar("dinfinity_normal_damage_stomach", "34")
  99.     pcvar_normal_damage_arms=register_cvar("dinfinity_normal_damage_arms", "34")
  100.     pcvar_normal_damage_legs=register_cvar("dinfinity_normal_damage_legs", "34")
  101.    
  102.     pcvar_fast_damage_head=register_cvar("dinfinity_fast_damage_head", "115")
  103.     pcvar_fast_damage_chest=register_cvar("dinfinity_fast_damage_chest", "30")
  104.     pcvar_fast_damage_stomach=register_cvar("dinfinity_fast_damage_stomach", "30")
  105.     pcvar_fast_damage_arms=register_cvar("dinfinity_fast_damage_arms", "30")
  106.     pcvar_fast_damage_legs=register_cvar("dinfinity_fast_damage_legs", "30")   
  107.    
  108.     ReadSettings()
  109.    
  110.     RegisterHam(Ham_Item_AddToPlayer, g_weapon_entity, "fwAddToPlayer", 1)
  111.     RegisterHam(Ham_Item_Deploy, g_weapon_entity, "fwDeployPost", 1)
  112.     RegisterHam(Ham_Weapon_PrimaryAttack, g_weapon_entity, "fwPrimaryAttack")
  113.     RegisterHam(Ham_Weapon_Reload, g_weapon_entity, "fwReloadPre")
  114.     RegisterHam(Ham_Item_PostFrame, g_weapon_entity, "fwItemPostFrame")
  115.     RegisterHam(Ham_TakeDamage, "player", "fwDamagePre")
  116.     RegisterHam(Ham_RemovePlayerItem, "player", "fwRemoveItem")
  117.    
  118.     RegisterHam(Ham_TraceAttack, "player", "fwTraceAttackPost", 1)
  119.     RegisterHam(Ham_TraceAttack, "worldspawn", "fwTraceAttackPost", 1)
  120.     RegisterHam(Ham_TraceAttack, "func_breakable", "fwTraceAttackPost", 1)
  121.     RegisterHam(Ham_TraceAttack, "func_wall", "fwTraceAttackPost", 1)
  122.     RegisterHam(Ham_TraceAttack, "func_door", "fwTraceAttackPost", 1)
  123.     RegisterHam(Ham_TraceAttack, "func_door_rotating", "fwTraceAttackPost", 1)
  124.     RegisterHam(Ham_TraceAttack, "func_plat", "fwTraceAttackPost", 1)
  125.     RegisterHam(Ham_TraceAttack, "func_rotating", "fwTraceAttackPost", 1)  
  126.    
  127.     register_forward(FM_PlaybackEvent, "fwPlaybackEvent")  
  128.     register_forward(FM_UpdateClientData, "fwUpdateClientDataPost", 1)
  129.     register_forward(FM_CmdStart,  "fwCmdStart")
  130.     register_forward(FM_SetModel, "fwSetModel")
  131.    
  132.     new item_name[64]
  133.    
  134.     get_pcvar_string(pcvar_item_name, item_name, charsmax(item_name))
  135. }
  136.  
  137. public plugin_precache()
  138. {
  139.     precache_model(ViewModel)
  140.     precache_model(PlayerModel)
  141.     precache_model(WorldModel)
  142.    
  143.     for(new i; i<=charsmax(Sounds); i++)
  144.     {
  145.         precache_sound(Sounds[i])
  146.     }
  147.    
  148.     Blood[0] = precache_model("sprites/bloodspray.spr")
  149.     Blood[1] = precache_model("sprites/blood.spr") 
  150.    
  151.     new tmp[128]
  152.    
  153.     formatex(tmp, charsmax(tmp), "sprites/%s.txt", weapon_list_txt)
  154.    
  155.     precache_generic(tmp)
  156.    
  157.     for(new i; i<=charsmax(weapon_list_sprites); i++)
  158.     {
  159.         precache_generic(weapon_list_sprites[i])
  160.        
  161.     }
  162.    
  163.     register_forward(FM_PrecacheEvent, "fwPrecachePost", 1)
  164. }
  165.  
  166. public ReadSettings()
  167. {
  168.     new confdir[64], path[128]
  169.    
  170.     get_configsdir(confdir, charsmax(confdir))
  171.    
  172.     formatex(path, charsmax(path), "%s/%s", confdir, CONFIG_CFG_FILE)
  173.    
  174.     server_cmd("exec %s", path)
  175.     server_exec()
  176.    
  177.     cvar_time_fire_normal=get_pcvar_float(pcvar_time_fire_normal)/*ز ��鳼 諳*/
  178.     cvar_time_fire_fast=get_pcvar_float(pcvar_time_fire_fast)
  179.    
  180. }
  181.  
  182.  
  183. public Redirect(id)
  184. {  
  185.     client_cmd(id, g_weapon_entity)
  186. }
  187.  
  188. public client_disconnected(id)
  189. {
  190.     g_HasInfinity[id]=false
  191. }
  192.  
  193. public ze_user_infected(id, iInfector)
  194. {  
  195.     g_HasInfinity[id]=false
  196. }
  197.  
  198. public give_infinity(id)
  199. {
  200.     drop_weapons(id, 2)
  201.    
  202.     g_HasInfinity[id]=true
  203.    
  204.     new ent=fm_give_item(id, g_weapon_entity)
  205.    
  206.     cs_set_user_bpammo(id, CSW_INFINITY, get_pcvar_num(pcvar_bpammo))
  207.     cs_set_weapon_ammo(ent, get_pcvar_num(pcvar_clipammo))
  208.  
  209.    
  210.     InfinitySprite(id) 
  211. }
  212.  
  213. public fwPrecachePost(type, const name[])
  214. {
  215.     if (equal(g_weapon_event1, name) || equal(g_weapon_event2, name) )
  216.     {
  217.         g_orig_event_dinfinity=get_orig_retval()
  218.        
  219.         return FMRES_HANDLED
  220.     }
  221.    
  222.     return FMRES_IGNORED
  223. }
  224.  
  225. public fwPlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
  226. {
  227.     if ((eventid != g_orig_event_dinfinity))
  228.         return FMRES_IGNORED
  229.    
  230.     if (!is_valid_player(invoker))
  231.         return FMRES_IGNORED
  232.    
  233.     fm_playback_event(flags|FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
  234.    
  235.     return FMRES_SUPERCEDE
  236. }
  237.  
  238. public fwUpdateClientDataPost(id, SendWeapons, CD_Handle)
  239. {
  240.     if (!is_valid_player(id))
  241.         return FMRES_IGNORED
  242.    
  243.     if(get_user_weapon(id)!=CSW_INFINITY)
  244.         return FMRES_IGNORED
  245.    
  246.    
  247.     set_cd(CD_Handle, CD_flNextAttack, get_gametime() + 0.001)
  248.    
  249.     return FMRES_HANDLED
  250. }
  251.  
  252. public fwCmdStart(id, uc_handle, seed)
  253. {
  254.     if(!is_valid_player(id))
  255.         return
  256.    
  257.     if(get_user_weapon(id)!=CSW_INFINITY)
  258.         return
  259.        
  260.     static buttons; buttons=get_uc(uc_handle, UC_Buttons)
  261.    
  262.     if(!(buttons&IN_ATTACK2))
  263.     {
  264.         g_mode[id]=0
  265.        
  266.         return
  267.     }  
  268.    
  269.     static ent; ent=get_pdata_cbase(id, 373)   
  270.    
  271.     if((buttons&IN_ATTACK)) /*Fix*/
  272.     {
  273.         set_pdata_float(ent, m_flNextPrimaryAttack, cvar_time_fire_normal,  OFFSET_LINUX_WEAPONS)
  274.        
  275.         g_mode[id]=0
  276.            
  277.         return 
  278.     }  
  279.    
  280.     if(get_pdata_int(ent, m_fInReload, OFFSET_LINUX_WEAPONS)||get_pdata_float(ent, m_flNextPrimaryAttack,  OFFSET_LINUX_WEAPONS)>-0.1)
  281.         return     
  282.    
  283.     g_mode[id]=1
  284.            
  285.     if(cs_get_weapon_ammo(ent)!=0)
  286.         ExecuteHamB(Ham_Weapon_PrimaryAttack, ent)
  287. }
  288.  
  289. public fwSetModel(ent, model[])
  290. {
  291.     if(!pev_valid(ent))
  292.         return FMRES_IGNORED;
  293.  
  294.     if(!equal(model, g_weapon_weaponbox_model))
  295.         return FMRES_IGNORED;
  296.  
  297.     static classname[33]
  298.     pev(ent, pev_classname, classname, charsmax(classname))
  299.        
  300.     if(!equal(classname, "weaponbox"))
  301.         return FMRES_IGNORED
  302.  
  303.     static owner; owner=pev(ent, pev_owner)
  304.     static weap;weap=fm_find_ent_by_owner(-1, g_weapon_entity, ent)
  305.    
  306.     if(g_HasInfinity[owner]&&pev_valid(weap))
  307.     {
  308.         set_pev(weap, pev_weaponkey, weaponkey_value)
  309.        
  310.         g_HasInfinity[owner]=false
  311.        
  312.         fm_entity_set_model(ent, WorldModel)
  313.        
  314.         return FMRES_SUPERCEDE
  315.     }
  316.    
  317.     return FMRES_IGNORED
  318. }
  319.  
  320. public fwAddToPlayer(ent, id)
  321. {
  322.     if(pev_valid(ent))
  323.     {
  324.         if(pev(ent, pev_weaponkey)==weaponkey_value)
  325.         {
  326.             g_HasInfinity[id] = true
  327.        
  328.             set_pev(ent, pev_weaponkey, 0)
  329.        
  330.             InfinitySprite(id)
  331.        
  332.             return HAM_HANDLED
  333.            
  334.         }
  335.     }
  336.        
  337.     return HAM_IGNORED
  338. }
  339.  
  340. public fwDeployPost(ent)
  341. {
  342.     new id=fm_get_weapon_owner(ent)
  343.  
  344.     if (!is_valid_player(id))
  345.         return
  346.    
  347.     set_pev(id, pev_viewmodel2, ViewModel)
  348.     set_pev(id, pev_weaponmodel2, PlayerModel)
  349.  
  350.     playanim(id, 15)
  351.  
  352.     set_pdata_float(ent, m_flNextPrimaryAttack, 0.8,  OFFSET_LINUX_WEAPONS)
  353.  
  354.     g_anim_mode[id]=!g_anim_mode[id]
  355. }
  356.    
  357. public fwPrimaryAttack(ent)
  358. {
  359.     new id=fm_get_weapon_owner(ent)
  360.    
  361.     if (!is_valid_player(id))
  362.         return
  363.    
  364.     pev(id,pev_punchangle,cl_pushangle[id])
  365.    
  366.     g_player_weapon_ammo[id]=cs_get_weapon_ammo(ent)
  367. }
  368.  
  369. public fwTraceAttackPost(ent, attacker, Float:damage, Float:dir[3], ptr, damage_type)
  370. {
  371.     if(!is_valid_player(attacker))
  372.         return
  373.  
  374.     if(get_user_weapon(attacker)!=CSW_INFINITY)
  375.         return
  376.            
  377.     static Float:fEnd[3]
  378.    
  379.     get_tr2(ptr, TR_vecEndPos, fEnd)
  380.    
  381.     make_bullet_decals(attacker, fEnd)
  382.    
  383.     g_hitgroup[attacker]=get_tr2(ptr, TR_iHitgroup)
  384. }
  385.  
  386. public fwReloadPre(ent)
  387. {
  388.     new id=fm_get_weapon_owner(ent)
  389.    
  390.     if(!is_valid_player(id))
  391.         return HAM_IGNORED
  392.  
  393.     static bpammo; bpammo=cs_get_user_bpammo(id, CSW_INFINITY)
  394.    
  395.     static clip; clip=cs_get_weapon_ammo(ent)
  396.    
  397.     if(bpammo>0&&clip<get_pcvar_num(pcvar_clipammo))
  398.     {
  399.         set_pdata_int(ent, 55, 0, OFFSET_LINUX_WEAPONS)
  400.        
  401.         set_pdata_float(id, m_flNextAttack, 4.4, OFFSET_LINUX)
  402.         set_pdata_float(ent, m_flTimeWeaponIdle, 4.4, OFFSET_LINUX_WEAPONS)
  403.         set_pdata_float(ent, m_flNextPrimaryAttack, 4.4, OFFSET_LINUX_WEAPONS)
  404.         set_pdata_float(ent, 47, 4.4, OFFSET_LINUX_WEAPONS)
  405.        
  406.         set_pdata_int(ent, m_fInReload, 1, OFFSET_LINUX_WEAPONS)
  407.  
  408.         playanim(id, 14)
  409.     }
  410.    
  411.     return HAM_SUPERCEDE
  412. }
  413.  
  414. public fwItemPostFrame(ent)
  415. {
  416.     new id=fm_get_weapon_owner(ent)
  417.    
  418.     if(!is_valid_player(id))
  419.         return
  420.    
  421.     static bpammo; bpammo=cs_get_user_bpammo(id, CSW_INFINITY)
  422.     static clip; clip=cs_get_weapon_ammo(ent)
  423.    
  424.     if(clip<g_player_weapon_ammo[id])
  425.     {
  426.         g_player_weapon_ammo[id]=clip
  427.    
  428.         new Float:push[3]
  429.    
  430.         pev(id,pev_punchangle,push)
  431.        
  432.         xs_vec_sub(push,cl_pushangle[id],push)
  433.         xs_vec_mul_scalar(push,0.8,push)
  434.         xs_vec_add(push,cl_pushangle[id],push)
  435.    
  436.         if(g_mode[id]==0)
  437.         {
  438.             if(g_shoot_anim[id]==0)
  439.             {
  440.  
  441.                 playanim(id, 2)
  442.             }
  443.             else
  444.             {
  445.                 playanim(id, 12)   
  446.             }
  447.            
  448.             set_pdata_float(ent, m_flNextPrimaryAttack, cvar_time_fire_normal, OFFSET_LINUX_WEAPONS)
  449.         }
  450.         else
  451.         {
  452.             if(g_shoot_anim[id]==0)
  453.             {
  454.                 playanim(id, (g_anim_mode[id])?18:16)
  455.                
  456.                 push[0]+=1.0
  457.                 push[1]-=1.5
  458.             }
  459.             else
  460.             {
  461.                 playanim(id, (g_anim_mode[id])?19:17)
  462.                
  463.                 push[0]+=1.0
  464.                 push[1]+=1.5
  465.             }
  466.            
  467.             set_pdata_float(ent, m_flNextPrimaryAttack,cvar_time_fire_fast, OFFSET_LINUX_WEAPONS)
  468.         }
  469.        
  470.         g_shoot_anim[id]=!g_shoot_anim[id]     
  471.                
  472.         set_pev(id,pev_punchangle,push)
  473.        
  474.         emit_sound(id, CHAN_WEAPON, Sounds[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  475.     }
  476.    
  477.     if(get_pdata_int(ent, m_fInReload, OFFSET_LINUX_WEAPONS)&&get_pdata_float(id, m_flNextAttack, 5) <= 0.0 )
  478.     {
  479.        
  480.         set_pdata_int(ent, m_fInReload, 0, OFFSET_LINUX_WEAPONS)
  481.        
  482.         for(new i = clip; i<get_pcvar_num(pcvar_clipammo); i++)
  483.         {
  484.             if(bpammo==0)
  485.                 break
  486.             bpammo--
  487.             clip++
  488.         }  
  489.        
  490.         cs_set_weapon_ammo(ent, clip)
  491.         cs_set_user_bpammo(id, CSW_INFINITY, bpammo)
  492.        
  493.     }
  494. }
  495.  
  496. public fwDamagePre(id, weapon, attacker, Float:damage)
  497. {
  498.    
  499.     if(!is_valid_player(attacker))
  500.         return
  501.    
  502.     if(get_user_weapon(attacker)!=CSW_INFINITY)
  503.         return
  504.    
  505.     new Float:Damage
  506.    
  507.     switch(g_hitgroup[attacker])
  508.     {
  509.        
  510.         case HIT_HEAD: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_head:pcvar_normal_damage_head)
  511.        
  512.         case HIT_CHEST: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_chest:pcvar_normal_damage_chest)
  513.        
  514.         case HIT_STOMACH: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_stomach:pcvar_normal_damage_stomach)
  515.        
  516.         case HIT_LEFTARM: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_arms:pcvar_normal_damage_arms)
  517.         case HIT_RIGHTARM: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_arms:pcvar_normal_damage_arms)
  518.        
  519.         case HIT_LEFTLEG: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_legs:pcvar_normal_damage_legs)
  520.         case HIT_RIGHTLEG: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_legs:pcvar_normal_damage_legs)
  521.        
  522.     }
  523.    
  524.     SetHamParamFloat(4, Damage)
  525. }
  526.  
  527. public fwRemoveItem(id, ent)
  528. {
  529.     if(!is_valid_player(id))
  530.         return
  531.        
  532.     new classname[62]
  533.    
  534.     pev(ent, pev_classname, classname, 61)
  535.    
  536.     if(!equal(classname, g_weapon_entity))
  537.         return
  538.    
  539.     DefaultSprite(id)
  540.        
  541. }
  542.  
  543. public make_bullet_decals(id, Float:Origin[3])
  544. {
  545.     new target, body
  546.     get_user_aiming(id, target, body, 999999)
  547.    
  548.     if(is_user_alive(target))
  549.     {
  550.         if(ze_is_user_zombie(id))
  551.         {
  552.             new Float:fStart[3], Float:fEnd[3], Float:fRes[3], Float:fVel[3]
  553.             pev(id, pev_origin, fStart)
  554.            
  555.             velocity_by_aim(id, 64, fVel)
  556.            
  557.             fStart[0] = Origin[0]
  558.             fStart[1] = Origin[1]
  559.             fStart[2] = Origin[2]
  560.             fEnd[0] = fStart[0]+fVel[0]
  561.             fEnd[1] = fStart[1]+fVel[1]
  562.             fEnd[2] = fStart[2]+fVel[2]
  563.    
  564.             new res
  565.             engfunc(EngFunc_TraceLine, fStart, fEnd, 0, target, res)
  566.             get_tr2(res, TR_vecEndPos, fRes)
  567.            
  568.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  569.             write_byte(TE_BLOODSPRITE)
  570.             write_coord(floatround(fStart[0]))
  571.             write_coord(floatround(fStart[1]))
  572.             write_coord(floatround(fStart[2]))
  573.             write_short(Blood[0])
  574.             write_short(Blood[1])
  575.             write_byte(70)
  576.             write_byte(random_num(1,2))
  577.             message_end()
  578.         }
  579.     }
  580.        
  581.     else
  582.     {
  583.         new decal = 41
  584.  
  585.         if(target)
  586.         {
  587.            
  588.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  589.             write_byte(TE_DECAL)
  590.             write_coord(floatround(Origin[0]))
  591.             write_coord(floatround(Origin[1]))
  592.             write_coord(floatround(Origin[2]))
  593.             write_byte(decal)
  594.             write_short(target)
  595.             message_end()
  596.         }
  597.         else
  598.         {  
  599.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  600.             write_byte(TE_WORLDDECAL)
  601.             write_coord(floatround(Origin[0]))
  602.             write_coord(floatround(Origin[1]))
  603.             write_coord(floatround(Origin[2]))
  604.             write_byte(decal)
  605.             message_end()
  606.         }
  607.        
  608.        
  609.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  610.         write_byte(TE_GUNSHOTDECAL)
  611.         write_coord(floatround(Origin[0]))
  612.         write_coord(floatround(Origin[1]))
  613.         write_coord(floatround(Origin[2]))
  614.         write_short(id)
  615.         write_byte(decal)
  616.         message_end()
  617.     }
  618. }
  619.  
  620. public InfinitySprite(id)
  621. {
  622.     message_begin( MSG_ONE, get_user_msgid("WeaponList"), .player=id )
  623.     write_string(weapon_list_txt)
  624.     write_byte(10)
  625.     write_byte(120)
  626.     write_byte(-1)
  627.     write_byte(-1)
  628.     write_byte(1)
  629.     write_byte(1)
  630.     write_byte(CSW_INFINITY)
  631.     write_byte(0)
  632.     message_end()
  633. }
  634.  
  635. public DefaultSprite(id)
  636. {
  637.     message_begin( MSG_ONE, get_user_msgid("WeaponList"), .player=id )
  638.     write_string(g_weapon_entity)
  639.     write_byte(10)
  640.     write_byte(120)
  641.     write_byte(-1)
  642.     write_byte(-1)
  643.     write_byte(1)
  644.     write_byte(1)
  645.     write_byte(CSW_INFINITY)
  646.     write_byte(0)
  647.     message_end()
  648. }
  649.  
  650. public is_valid_player(id)
  651. {
  652.        
  653.     if(!is_user_alive(id))
  654.         return false
  655.        
  656.     if(!g_HasInfinity[id])
  657.         return false
  658.  
  659.     return true
  660. }
  661.  
  662. stock drop_weapons(id, dropwhat)
  663. {
  664.     static weapons[32], num, i, weaponid
  665.     num = 0
  666.     get_user_weapons(id, weapons, num)
  667.    
  668.     for (i = 0; i < num; i++)
  669.     {
  670.         weaponid = weapons[i]
  671.        
  672.         if (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))
  673.         {
  674.             static wname[32]
  675.             get_weaponname(weaponid, wname, sizeof wname - 1)
  676.            
  677.             engclient_cmd(id, "drop", wname)
  678.         }
  679.     }
  680.    
  681. }
  682.  
  683. stock playanim(player,anim)
  684. {
  685.     set_pev(player, pev_weaponanim, anim)
  686.    
  687.     message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, player)
  688.     write_byte(anim)
  689.     write_byte(pev(player, pev_body))
  690.     message_end()
  691. }
  692.  
  693. stock fm_get_weapon_owner(weapon)
  694. {  
  695.     return get_pdata_cbase(weapon, 41, 4)
  696.    
  697. }
  698. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  699. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang16393\\ f0\\ fs16 \n\\ par }
  700. */

Leap:
  1. #include <ze_vip>
  2.  
  3. #define PLUGIN "[ZE] Extra Item : Leap"
  4. #define VERSION "1.5.7"
  5. #define AUTHOR "Fry!"
  6. #define VIP_ACCESS ADMIN_LEVEL_H
  7.  
  8. /*================================================================================
  9.  [Plugin Customization]
  10. =================================================================================*/
  11.  
  12. new bool:g_hasLongJump[33]
  13. new Float:g_last_LongJump_time[33]
  14. new g_LongJump_cost, g_LongJump_force, g_LongJump_height, g_LongJump_cooldown , g_iLimit[33]  ,  cvar_limit
  15.  
  16. public plugin_natives()
  17. {
  18.     register_native("ze_give_leap", "native_ze_give_leap", 1)
  19. }
  20.  
  21. public native_ze_give_leap(id)
  22. {
  23.     if (!is_user_connected(id))
  24.         return -1
  25.  
  26.     buy_longjump(id)
  27.     return true
  28. }
  29.  
  30. public plugin_init()
  31. {
  32.     register_plugin(PLUGIN, VERSION, AUTHOR)
  33.    
  34.     register_cvar("zp_extra_leap",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
  35.    
  36.     g_LongJump_force = register_cvar("ze_longjump_force", "580")
  37.     g_LongJump_height = register_cvar("ze_longjump_height", "320")
  38.     g_LongJump_cooldown = register_cvar("ze_longjump_cooldown", "10.0")
  39.     g_LongJump_cost = register_cvar("ze_longjump_cost", "20")
  40.     cvar_limit = register_cvar("ze_longjump_limit", "2")
  41.    
  42.     register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
  43.    
  44.     register_event("DeathMsg", "death", "a")
  45.     register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  46. }
  47.  
  48. // Reset on disconnection
  49. public client_disconnected(id)
  50. {
  51.     g_hasLongJump[id] = false
  52. }
  53.  
  54. // Reset on death
  55. public death()
  56. {
  57.     g_hasLongJump[read_data(2)] = false
  58. }
  59.  
  60. // Reset if turned into human
  61. public ze_user_humanized(id)
  62. {
  63.     g_hasLongJump[id] = false
  64. }
  65.  
  66. // Reset at round start (for everyone)
  67. public event_round_start()
  68. {
  69.     for (new i = 1; i <= 32; i++)
  70.         g_hasLongJump[i] = false
  71. }
  72.  
  73. // Buy through command "say /blj"
  74. public  buy_longjump(id)
  75. {
  76.     if ( g_hasLongJump[id] )
  77.     {
  78.         client_print(id, print_chat, "[ZE] You have already purchased a jumppack.")
  79.         return PLUGIN_HANDLED
  80.     }
  81.    
  82.     if ( !is_user_alive(id) )
  83.     {
  84.         client_print(id, print_chat, "[ZE] You can't buy jumppack because You are dead.")
  85.         return PLUGIN_HANDLED
  86.     }
  87.    
  88.     new money = ze_get_escape_coins(id)
  89.     new cost = get_pcvar_num(g_LongJump_cost)
  90.    
  91.     if ( money < cost )
  92.     {
  93.         client_print(id, print_chat, "[ZE] You don't have enough ammo packs to buy a jumppack. (%i needed).", cost )
  94.         return PLUGIN_HANDLED
  95.     }
  96.    
  97.     g_hasLongJump[id] = true
  98.    
  99.     ze_set_escape_coins(id, money)
  100.    
  101.     client_print(id, print_chat, "[ZE] You have bought a Jump Pack. To use it, press duck and jump while moving forward.")
  102.    
  103.     return PLUGIN_HANDLED
  104. }
  105.  
  106.    
  107. public fw_PlayerPreThink(id)
  108. {
  109.     if (!is_user_alive(id))
  110.         return FMRES_IGNORED
  111.    
  112.     if (allow_LongJump(id))
  113.     {
  114.         static Float:velocity[3]
  115.         velocity_by_aim(id, get_pcvar_num(g_LongJump_force), velocity)
  116.        
  117.         velocity[2] = get_pcvar_float(g_LongJump_height)
  118.        
  119.         set_pev(id, pev_velocity, velocity)
  120.        
  121.         g_last_LongJump_time[id] = get_gametime()
  122.     }
  123.    
  124.     return FMRES_IGNORED
  125. }
  126.  
  127. // Check if the player can longjump
  128. allow_LongJump(id)
  129. {
  130.     if (!g_hasLongJump[id])
  131.         return false
  132.    
  133.     if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80)
  134.         return false
  135.    
  136.     static buttons
  137.     buttons = pev(id, pev_button)
  138.    
  139.     if (!is_user_bot(id) && (!(buttons & IN_JUMP) || !(buttons & IN_DUCK)))
  140.         return false
  141.    
  142.     if (get_gametime() - g_last_LongJump_time[id] < get_pcvar_float(g_LongJump_cooldown))
  143.         return false
  144.    
  145.     return true
  146. }
  147.  
  148. // Get entity's speed (from fakemeta_util)
  149. stock fm_get_speed(entity)
  150. {
  151.     static Float:velocity[3]
  152.     pev(entity, pev_velocity, velocity)
  153.    
  154.     return floatround(vector_length(velocity))
  155. }
  156. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  157. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
  158. */

Lycanthrope:
  1. #include <ze_vip>
  2. #include <fakemeta_util>
  3. #include <cstrike>
  4.  
  5.  
  6. #define CSW_WEAPON_BASE CSW_P90
  7. #define CSW_NEW_WEAPON  "weapon_lycanthrope"
  8. #define CSW_OLD_WEAPON  "weapon_p90"
  9. #define WEAPON_KEY  9299292
  10. #define OLD_WEAPON  "models/w_p90.mdl"
  11. #define is_user_valid(%1) (is_user_alive(%1) && !is_user_bot(%1) && !is_user_hltv(%1) && is_user_connected(%1))
  12.  
  13. new const Weapon_Models[][] = { "models/Premuim_ZE/v_lycanthrope.mdl", "models/Premuim_ZE/p_lycanthrope.mdl", "models/Premuim_ZE/w_lycanthrope.mdl" }
  14. new const Weapon_Sounds[][] = { "weapons/sg552-shot1.wav", "weapons/sg552-shot2.wav", "weapons/buffsg552_draw.wav", "weapons/buffsg552_idle.wav", "weapons/buffsg552_reload.wav", "weapons/buffsg552_reload_AF.wav" }
  15. new const Weapon_Sprites[][] = { "sprites/weapon_lycanthrope.txt", "sprites/640hud148.spr" }
  16. new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }
  17.  
  18. new bool:g_Hasscope[33], g_hasZoom[33]
  19. new Cvar_scope_Recoil, Cvar_scope_DMG, Cvar_scope_Clip, Cvar_scope_Ammo, Cvar_scope_Speed
  20. new Float:cl_pushangle[33][3], g_Eventscope, g_scope_TmpClip[33], g_IsInPrimaryAttack, g_Shock
  21.  
  22. public plugin_natives()
  23. {
  24.     register_native("ze_give_lycanthrope_vip", "native_ze_give_lycanthrope_vip", 1)
  25. }
  26.  
  27. public native_ze_give_lycanthrope_vip(id)
  28. {
  29.     if (!is_user_connected(id))
  30.         return -1
  31.  
  32.     Givescope(id)
  33.     return true
  34. }
  35.  
  36. public plugin_precache()
  37. {
  38.     for(new g = 0; g < sizeof(Weapon_Models); g++)
  39.         precache_model(Weapon_Models[g])
  40.     for(new h = 0; h < sizeof(Weapon_Sounds); h++)
  41.         precache_sound(Weapon_Sounds[h])
  42.     for(new t = 0; t < sizeof(Weapon_Sprites); t++)
  43.         precache_generic(Weapon_Sprites[t])
  44.        
  45.     g_Shock = precache_model("sprites/lycanthrope_hit.spr")
  46.        
  47.     register_clcmd(CSW_NEW_WEAPON, "hook")
  48.     register_forward(FM_PrecacheEvent, "Fw_Precache_Event", 1)
  49. }
  50.  
  51. public hook(id)
  52. {
  53.     engclient_cmd(id, CSW_OLD_WEAPON)
  54.     return PLUGIN_HANDLED
  55. }
  56.  
  57. public plugin_init()
  58. {
  59.     register_plugin("[ZE] Extra Item: Lycanthrope", "1.0", "Jack GamePlay")
  60.    
  61.     // Events & Messages
  62.     register_message(get_user_msgid("DeathMsg"), "DeathMsg")
  63.     register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
  64.     register_event("HLTV", "New_Round", "a", "1=0", "2=0")
  65.    
  66.     // Forwards
  67.     register_forward(FM_SetModel, "Fw_Set_Model", 1)
  68.     register_forward(FM_PlaybackEvent, "Fw_Playback_Event")
  69.     register_forward(FM_UpdateClientData, "Fw_Update_Clientdata", 1)
  70.     register_forward(FM_CmdStart, "Fw_CmdStart")
  71.    
  72.     // Hook Chains
  73.     RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG")
  74.     // Hams
  75.     RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack")
  76.     RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack_Post", 1)
  77.     RegisterHam(Ham_Item_AddToPlayer, CSW_OLD_WEAPON, "Fw_AddToPlayer")
  78.     RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload")
  79.     RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload_Post", 1)
  80.     RegisterHam(Ham_Spawn, "player", "Fw_Spawn", 1)
  81.     RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack", 1)
  82.     RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack", 1)
  83.     RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack", 1)
  84.     RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack", 1)
  85.     RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack", 1)
  86.     RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack", 1)
  87.     RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack", 1)
  88.     RegisterHam(Ham_Use, "func_tank", "Fw_UseStationary_Post", 1)
  89.     RegisterHam(Ham_Use, "func_tankmortar", "Fw_UseStationary_Post", 1)
  90.     RegisterHam(Ham_Use, "func_tankrocket", "Fw_UseStationary_Post", 1)
  91.     RegisterHam(Ham_Use, "func_tanklaser", "Fw_UseStationary_Post", 1)
  92.     RegisterHam(Ham_Item_Deploy, CSW_OLD_WEAPON, "Fw_Item_Deploy_Post", 1)
  93.    
  94.     // Cvars
  95.     Cvar_scope_Recoil = register_cvar("ze_scope_recoil", "1.0")
  96.     Cvar_scope_DMG = register_cvar("ze_scope_damage", "6")
  97.     Cvar_scope_Clip = register_cvar("ze_scope_clip", "30")
  98.     Cvar_scope_Ammo = register_cvar("ze_scope_ammo", "150")
  99.     Cvar_scope_Speed = register_cvar("ze_scope_speed", "4.5")
  100. }
  101.  
  102. public Fw_Item_Deploy_Post(weapon_ent)
  103. {
  104.     new id = get_pdata_cbase(weapon_ent, 41, 4)
  105.     g_hasZoom[id] = false
  106.     cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
  107.     CurrentWeapon(id)
  108. }
  109.  
  110. public Fw_UseStationary_Post(entity, caller, activator, use_type)
  111. {
  112.     if (use_type == 0 && is_user_valid(caller))
  113.     {
  114.         CurrentWeapon(caller)
  115.     }
  116. }
  117.  
  118. public Fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
  119. {
  120.     if(!is_user_valid(iAttacker))
  121.         return
  122.    
  123.     static Float:flEnd[3]
  124.     get_tr2(ptr, TR_vecEndPos, flEnd)
  125.    
  126.     if(get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
  127.     {
  128.         if(iEnt)
  129.         {
  130.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  131.             write_byte(TE_DECAL)
  132.             engfunc(EngFunc_WriteCoord, flEnd[0])
  133.             engfunc(EngFunc_WriteCoord, flEnd[1])
  134.             engfunc(EngFunc_WriteCoord, flEnd[2])
  135.             write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
  136.             write_short(iEnt)
  137.             message_end()
  138.         }
  139.         else
  140.         {
  141.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  142.             write_byte(TE_WORLDDECAL)
  143.             engfunc(EngFunc_WriteCoord, flEnd[0])
  144.             engfunc(EngFunc_WriteCoord, flEnd[1])
  145.             engfunc(EngFunc_WriteCoord, flEnd[2])
  146.             write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
  147.             message_end()
  148.         }
  149.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  150.         write_byte(TE_GUNSHOTDECAL)
  151.         engfunc(EngFunc_WriteCoord, flEnd[0])
  152.         engfunc(EngFunc_WriteCoord, flEnd[1])
  153.         engfunc(EngFunc_WriteCoord, flEnd[2])
  154.         write_short(iAttacker)
  155.         write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
  156.         message_end()
  157.        
  158.         engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flEnd, 0)
  159.         write_byte(TE_SPRITE)
  160.         engfunc(EngFunc_WriteCoord, flEnd[0])
  161.         engfunc(EngFunc_WriteCoord, flEnd[1])
  162.         engfunc(EngFunc_WriteCoord, flEnd[2])
  163.         write_short(g_Shock)
  164.         write_byte(5)
  165.         write_byte(150)
  166.         message_end()
  167.     }
  168. }
  169.  
  170. public Fw_Spawn(id)
  171. {
  172.     if(!is_user_valid(id))
  173.         return
  174.        
  175.     Remove_scope(id)
  176. }
  177.  
  178. public New_Round()
  179. {
  180.     for(new i = 0; i < get_member_game(m_nMaxPlayers); i++)
  181.     {
  182.         if(!is_user_valid(i) || !g_Hasscope[i])
  183.             continue
  184.            
  185.         Remove_scope(i)
  186.     }
  187. }
  188.  
  189. public Fw_Reload_Post(weapon_entity)
  190. {
  191.     new id = pev(weapon_entity, pev_owner)
  192.     if (!is_user_valid(id) || ze_is_user_zombie(id) || g_scope_TmpClip[id] == -1)
  193.         return HAM_IGNORED
  194.        
  195.     if(g_Hasscope[id])
  196.     {
  197.         g_hasZoom[id] = false
  198.         cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
  199.         set_pdata_int(weapon_entity, 51, g_scope_TmpClip[id], 4)
  200.         set_pdata_float(weapon_entity, 48, 3.0, 4)
  201.         set_pdata_float(id, 83, 3.0, 5)
  202.         set_pdata_int(weapon_entity, 54, 1, 4)
  203.         UTIL_weapon_anim(id, weapon_entity, 1)
  204.     }
  205.     return HAM_IGNORED
  206. }
  207.  
  208. public Fw_Reload(weapon_entity)
  209. {
  210.     new id = pev(weapon_entity, pev_owner)
  211.     if (!is_user_valid(id) || ze_is_user_zombie(id))
  212.         return HAM_IGNORED
  213.  
  214.     static iClipExtra
  215.     if(g_Hasscope[id])
  216.     {
  217.         iClipExtra = get_pcvar_num(Cvar_scope_Clip)
  218.     }
  219.  
  220.     g_scope_TmpClip[id] = -1
  221.    
  222.     new iBpAmmo = cs_get_user_bpammo(id, CSW_WEAPON_BASE)
  223.     new iClip = get_pdata_int(weapon_entity, 51, 4)
  224.  
  225.     if (iBpAmmo <= 0 || iClip >= iClipExtra)
  226.         return HAM_SUPERCEDE
  227.        
  228.     g_scope_TmpClip[id] = iClip
  229.  
  230.     return HAM_IGNORED
  231. }
  232.  
  233. public Fw_AddToPlayer(ent, id)
  234. {
  235.     if(!is_valid_ent(ent) || !is_user_valid(id) || ze_is_user_zombie(id))
  236.         return HAM_IGNORED
  237.    
  238.     if(entity_get_int(ent, EV_INT_impulse) == WEAPON_KEY)
  239.     {
  240.         g_Hasscope[id] = true
  241.         g_hasZoom[id] = false
  242.         cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
  243.         entity_set_int(ent, EV_INT_impulse, 0)
  244.        
  245.         message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
  246.         write_string(CSW_NEW_WEAPON)
  247.         write_byte(7)
  248.         write_byte(100)
  249.         write_byte(-1)
  250.         write_byte(-1)
  251.         write_byte(0)
  252.         write_byte(8)
  253.         write_byte(CSW_WEAPON_BASE)
  254.         write_byte(0)
  255.         message_end()
  256.         return HAM_HANDLED
  257.     }
  258.     else
  259.     {
  260.         message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
  261.         write_string(CSW_OLD_WEAPON)
  262.         write_byte(7)
  263.         write_byte(100)
  264.         write_byte(-1)
  265.         write_byte(-1)
  266.         write_byte(0)
  267.         write_byte(8)
  268.         write_byte(CSW_WEAPON_BASE)
  269.         write_byte(0)
  270.         message_end()
  271.     }
  272.     return HAM_IGNORED
  273. }
  274.  
  275. public Fw_Precache_Event(type, const name[])
  276. {
  277.     if(equal("events/p90.sc", name))
  278.     {
  279.         g_Eventscope = get_orig_retval()
  280.     }
  281. }
  282.  
  283. public Fw_Update_Clientdata(id, sendweapons, cd_handle)
  284. {
  285.     if(!is_user_valid(id))
  286.         return
  287.  
  288.     if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
  289.     {
  290.         set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
  291.     }
  292. }
  293.  
  294. public Fw_Playback_Event(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
  295. {
  296.     if(!is_user_valid(invoker) || !g_IsInPrimaryAttack)
  297.         return
  298.    
  299.     if(eventid == g_Eventscope && get_user_weapon(invoker) == CSW_WEAPON_BASE && g_Hasscope[invoker])
  300.     {
  301.         engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
  302.         UTIL_weapon_anim(invoker, eventid, random_num(3, 5))
  303.         emit_sound(invoker, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  304.     }
  305. }
  306.  
  307. public ze_user_humanized(id)
  308. {
  309.     if(!is_user_valid(id))
  310.         return
  311.        
  312.     Remove_scope(id)
  313. }
  314.  
  315. public ze_user_infected(id, infector)
  316. {
  317.     if(!is_user_valid(id))
  318.         return
  319.        
  320.     Remove_scope(id)
  321. }
  322.  
  323. public Fw_PrimaryAttack(Weapon)
  324. {
  325.     g_IsInPrimaryAttack = 0
  326.    
  327.     new szClip, szAmmo, id
  328.     id = get_pdata_cbase(Weapon, 41, 4)
  329.     get_user_weapon(id, szClip, szAmmo)
  330.     if(!is_user_valid(id) || ze_is_user_zombie(id))
  331.         return
  332.  
  333.     g_IsInPrimaryAttack = 1
  334.     if(g_Hasscope[id])
  335.     {
  336.         if (!cs_get_weapon_ammo(Weapon))
  337.             return
  338.  
  339.         new Float:push[3]
  340.         pev(id, pev_punchangle, push)
  341.         xs_vec_sub(push, cl_pushangle[id], push)
  342.         xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
  343.         xs_vec_add(push, cl_pushangle[id], push)
  344.         set_pev(id, pev_punchangle, push)
  345.         UTIL_weapon_anim(id, Weapon, random_num(3, 5))
  346.         emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  347.     }
  348. }
  349.  
  350. public Fw_CmdStart(id, handle)
  351. {
  352.     if(!is_user_valid(id) || ze_is_user_zombie(id))
  353.         return
  354.        
  355.     if((get_uc(handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
  356.     {
  357.         if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && !g_hasZoom[id])
  358.         {
  359.             g_hasZoom[id] = true
  360.             cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
  361.         }
  362.         else if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && g_hasZoom[id])
  363.         {
  364.             g_hasZoom[id] = false
  365.             cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
  366.         }
  367.     }
  368. }
  369.  
  370. public Fw_Take_DMG(Victim, Inflictor, Attacker, Float:Damage, DamageType)
  371. {
  372.     if(!is_user_valid(Victim) || !is_user_valid(Attacker) ||ze_is_user_zombie(Attacker))
  373.         return
  374.    
  375.     if(get_user_weapon(Attacker) == CSW_WEAPON_BASE && g_Hasscope[Attacker])
  376.     {
  377.         SetHamParamFloat(4, Damage * get_pcvar_float(Cvar_scope_DMG))
  378.     }
  379. }
  380.  
  381. public Fw_PrimaryAttack_Post(Weapon)
  382. {
  383.     g_IsInPrimaryAttack = 0
  384.     new szClip, szAmmo, id
  385.     id = get_pdata_cbase(Weapon, 41, 4)
  386.     get_user_weapon(id, szClip, szAmmo)
  387.    
  388.     if(!is_user_valid(id) || ze_is_user_zombie(id))
  389.         return
  390.  
  391.     if(g_Hasscope[id])
  392.     {
  393.         if (!cs_get_weapon_ammo(Weapon))
  394.             return
  395.  
  396.         new Float:push[3]
  397.         pev(id, pev_punchangle, push)
  398.         xs_vec_sub(push, cl_pushangle[id], push)
  399.         xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
  400.         xs_vec_add(push, cl_pushangle[id], push)
  401.         set_pev(id, pev_punchangle, push)
  402.         UTIL_weapon_anim(id, Weapon, random_num(3, 5))
  403.         emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  404.     }
  405. }
  406.  
  407. public Fw_Set_Model(entity, model[])
  408. {
  409.     if(!pev_valid(entity) || !equal(model, OLD_WEAPON))
  410.         return FMRES_IGNORED
  411.    
  412.     static szClassName[33], id
  413.     id = pev(entity, pev_owner)
  414.     pev(entity, pev_classname, szClassName, charsmax(szClassName))
  415.     if(!equal(szClassName, "weaponbox"))
  416.         return FMRES_IGNORED
  417.    
  418.     if(g_Hasscope[id] && pev_valid(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity)))
  419.     {
  420.         g_Hasscope[id] = false
  421.         g_hasZoom[id] = false
  422.         cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
  423.         set_pev(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity), pev_impulse, WEAPON_KEY)
  424.         engfunc(EngFunc_SetModel, entity, Weapon_Models[2])
  425.         return FMRES_SUPERCEDE
  426.     }
  427.     return FMRES_IGNORED
  428. }
  429.  
  430. public CurrentWeapon(id)
  431. {
  432.     if(!is_user_valid(id))
  433.         return
  434.        
  435.     if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
  436.     {
  437.         if(g_hasZoom[id])
  438.         {
  439.             cs_set_player_view_model(id, CSW_WEAPON_BASE, "")
  440.         }
  441.         else if(!g_hasZoom[id])
  442.         {
  443.             cs_set_player_view_model(id, CSW_WEAPON_BASE, Weapon_Models[0])
  444.         }
  445.         cs_set_player_weap_model(id, CSW_WEAPON_BASE, Weapon_Models[1])
  446.        
  447.         message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
  448.         write_string(CSW_NEW_WEAPON)
  449.         write_byte(7)
  450.         write_byte(100)
  451.         write_byte(-1)
  452.         write_byte(-1)
  453.         write_byte(0)
  454.         write_byte(8)
  455.         write_byte(CSW_WEAPON_BASE)
  456.         write_byte(0)
  457.         message_end()
  458.        
  459.         static Float:iSpeed; iSpeed = get_pcvar_float(Cvar_scope_Speed)
  460.         static Ent; Ent = find_ent_by_owner(-1, CSW_OLD_WEAPON, id)
  461.         if(Ent)
  462.         {
  463.             static Float:Delay; Delay = get_pdata_float( Ent, 46, 4) * iSpeed
  464.             if (Delay > 0.0)
  465.             {
  466.                 set_pdata_float(Ent, 46, Delay, 4)
  467.             }
  468.         }
  469.     }
  470. }
  471.  
  472. public DeathMsg(msg_id, msg_dest, id)
  473. {
  474.     static szTruncatedWeapon[33], iAttacker, iVictim
  475.     get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
  476.    
  477.     iAttacker = get_msg_arg_int(1)
  478.     iVictim = get_msg_arg_int(2)
  479.    
  480.     if(!is_user_valid(iAttacker) || iAttacker == iVictim)   return
  481.    
  482.     if(equal(szTruncatedWeapon, "p90") && get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
  483.     {
  484.         set_msg_arg_string(4, "lycanthrope")
  485.     }
  486. }
  487.  
  488. public Givescope(id)
  489. {
  490.     drop_weapons(id, 1)
  491.     new wep = rg_give_item(id, CSW_OLD_WEAPON)
  492.     if (wep > 0)
  493.     {
  494.         cs_set_weapon_ammo(wep, get_pcvar_num(Cvar_scope_Clip))
  495.         cs_set_user_bpammo(id, CSW_WEAPON_BASE, get_pcvar_num(Cvar_scope_Ammo))
  496.        
  497.         message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
  498.         write_string(CSW_NEW_WEAPON)
  499.         write_byte(7)
  500.         write_byte(100)
  501.         write_byte(-1)
  502.         write_byte(-1)
  503.         write_byte(0)
  504.         write_byte(8)
  505.         write_byte(CSW_WEAPON_BASE)
  506.         write_byte(0)
  507.         message_end()
  508.     }
  509.     g_Hasscope[id] = true
  510.     g_hasZoom[id] = false
  511.     cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
  512.     UTIL_weapon_anim(id, CSW_WEAPON_BASE, 2)
  513.     ze_colored_print(id, "!tYou bought Lycanthrope!y.")
  514. }
  515.  
  516. public Remove_scope(id)
  517. {
  518.     if(!is_user_valid(id))
  519.         return
  520.        
  521.     g_Hasscope[id] = false
  522.     g_hasZoom[id] = false
  523.     cs_set_user_zoom(id, CS_SET_NO_ZOOM, 0)
  524.     message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
  525.     write_string(CSW_OLD_WEAPON)
  526.     write_byte(7)
  527.     write_byte(100)
  528.     write_byte(-1)
  529.     write_byte(-1)
  530.     write_byte(0)
  531.     write_byte(8)
  532.     write_byte(CSW_WEAPON_BASE)
  533.     write_byte(0)
  534.     message_end()
  535.     cs_reset_player_view_model(id, CSW_WEAPON_BASE)
  536.     cs_reset_player_weap_model(id, CSW_WEAPON_BASE)
  537. }
  538.  
  539. UTIL_weapon_anim(index, entity, sequence = 0)
  540. {
  541.     set_pev(index, pev_weaponanim, sequence)
  542.  
  543.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, index)
  544.     write_byte(sequence)
  545.     write_byte(pev(entity, pev_body))
  546.     message_end()
  547. }
  548.  
  549. stock drop_weapons(id, dropwhat)
  550. {
  551.     static weapons[32], num, i, weaponid
  552.     num = 0
  553.     get_user_weapons(id, weapons, num)
  554.    
  555.     const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
  556.    
  557.     for (i = 0; i < num; i++)
  558.     {
  559.         weaponid = weapons[i]
  560.        
  561.         if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
  562.         {
  563.             static wname[32]
  564.             get_weaponname(weaponid, wname, charsmax(wname))
  565.             engclient_cmd(id, "drop", wname)
  566.         }
  567.     }
  568. }
  569. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  570. *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
  571. */

Glow menu:
  1. /* FireWalker877's Glow Menu
  2. *  This is a simple [AMXX] public glow plugin.
  3. *  beb0 says "glow", beb0 gets a menu!
  4. *  Colors are those of the rainbow and white (in that order)
  5. *  Send any requests or comments to cstrikememphis@yahoo.com
  6. *
  7. *  Commands:
  8. *  say "glow"
  9. *  amx_gmtoggle - Admin level H access Toggles Glow Menu On and Off
  10. *
  11. *  Cvars
  12. *  gm_toggle 1/0 - < if 1, Glow Menu is disabled. if 0 or undefined,
  13. *  all clients have access to the Glow Menu. Define in server.cfg or
  14. *  set in console by typing "amx_gmtoggle"
  15. */
  16.  
  17. #include <zombie_escape>
  18. #include <fun>
  19.  
  20. public plugin_natives()
  21. {
  22.     register_native("ze_open_glow_menu", "native_ze_open_glow_menu", 1)
  23. }
  24.  
  25. public native_ze_open_glow_menu(id)
  26. {
  27.     if (!is_user_connected(id))
  28.         return -1
  29.  
  30.     GlowMenuMenu(id)
  31.     return true
  32. }
  33.  
  34. public plugin_init()
  35. {
  36.    register_plugin("Glow Menu","v1.3","Spi")
  37.    register_menucmd(register_menuid("Glow Menu"),1023,"GlowMenuChoice")
  38.    //register_concmd("say !glow", "checkityo", 0, "- say glow and select an option")
  39.    register_concmd("amx_gmtoggle", "toggle", ADMIN_LEVEL_H, "- Toggle access to Glow Menu On and Off")
  40.    register_cvar("gm_toggle","0",FCVAR_SERVER)
  41.    set_cvar_string("gm_toggle","0")
  42. }
  43.  
  44.  
  45. public toggle(id)
  46. {
  47.     if(get_cvar_num("gm_toggle")==1)
  48.     {
  49.         set_cvar_string("gm_toggle","0")
  50.         client_print(0,print_chat,"Glow Menu has been enabled by the owner!")
  51.         server_print("Glow menu has been enabled!")
  52.     }
  53.  
  54.     else
  55.     {
  56.         set_cvar_string("gm_toggle","1")
  57.         client_print(0,print_chat,"Glow Menu has been disabled by the owner!")
  58.         server_print("Glow menu has been disabled!")
  59.         set_user_rendering(0,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
  60.     }
  61.     return PLUGIN_HANDLED
  62. }
  63.  
  64. /*public checkityo(id)
  65. {
  66.     if(get_cvar_num("gm_toggle")==1)
  67.     {
  68.         client_print(id,print_chat,"Glow Menu is currently disabled!")
  69.     }
  70.    
  71.     else
  72.     {
  73.        GlowMenuMenu(id)
  74.     }
  75.     return PLUGIN_HANDLED
  76. }*/
  77.  
  78. public amx_glowmenu(id)
  79. {
  80.     GlowMenuMenu(id)
  81.     return PLUGIN_HANDLED
  82. }
  83.  
  84. public GlowMenuMenu(id)
  85. {
  86.     if (!(get_user_flags(id) & ADMIN_LEVEL_H))
  87.         return
  88.    
  89.     if (is_user_alive(id) && !ze_is_user_zombie(id))
  90.     {
  91.         new menuBody[1024]
  92.         new key
  93.      
  94.         format(menuBody, 1023, "Glow Menu^n^n 1.  Red^n 2.  Orange^n 3.  Yellow^n 4.  Green^n 5.  Light Blue^n 6.  Blue^n 7.  Purple^n 8.  White^n^n 9.  Deactivate Glow^n^n 0.  Exit.")
  95.         key = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
  96.  
  97.         show_menu(id, key, menuBody)
  98.     }
  99. }
  100.  
  101. public GlowMenuChoice(id, key)
  102. {
  103.     new Client[21]
  104.     get_user_name(id,Client,20)    
  105.  
  106.     switch(key)
  107.     {
  108.         case 0:
  109.         {
  110.             set_hudmessage(255,0,0, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  111.             show_hudmessage(0, "%s is now glowing Red!",Client)
  112.             set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
  113.         }
  114.         case 1:
  115.         {
  116.             set_hudmessage(255,140,0, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  117.             show_hudmessage(0, "%s is now glowing Orange!",Client)
  118.             set_user_rendering(id,kRenderFxGlowShell,255,140,0,kRenderNormal,25)
  119.         }
  120.         case 2:
  121.         {
  122.             set_hudmessage(255,255,0, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  123.             show_hudmessage(0, "%s is now glowing Yellow!",Client)
  124.             set_user_rendering(id,kRenderFxGlowShell,255,255,0,kRenderNormal,25)
  125.         }
  126.         case 3:
  127.         {
  128.             set_hudmessage(0,255,0, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  129.             show_hudmessage(0, "%s is now glowing Green!",Client)
  130.             set_user_rendering(id,kRenderFxGlowShell,0,255,0,kRenderNormal,25)
  131.         }
  132.         case 4:
  133.         {
  134.             set_hudmessage(0,255,255, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  135.             show_hudmessage(0, "%s is now glowing Light Blue!",Client)
  136.             set_user_rendering(id,kRenderFxGlowShell,0,255,255,kRenderNormal,25)
  137.         }
  138.         case 5:
  139.         {
  140.             set_hudmessage(0,0,255, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  141.             show_hudmessage(0, "%s is now glowing Blue!",Client)
  142.             set_user_rendering(id,kRenderFxGlowShell,0,0,255,kRenderNormal,25)
  143.         }
  144.         case 6:
  145.         {
  146.             set_hudmessage(255,0,255, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  147.             show_hudmessage(0, "%s is now glowing Purple!",Client)
  148.             set_user_rendering(id,kRenderFxGlowShell,255,0,255,kRenderNormal,25)
  149.         }
  150.         case 7:
  151.         {
  152.             set_hudmessage(192,192,192, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  153.             show_hudmessage(0, "%s is now glowing White!",Client)
  154.             set_user_rendering(id,kRenderFxGlowShell,192,192,192,kRenderNormal,25)
  155.         }
  156.         case 8:
  157.         {
  158.             set_hudmessage(0,255,0, 0.02, 0.73, 0, 6.0, 8.0, 0.1, 0.2, 4)
  159.             show_hudmessage(0, "%s is no longer glowing!",Client)
  160.             set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
  161.         }
  162.         case 9:
  163.         {
  164.             return PLUGIN_CONTINUE
  165.         }
  166.     }
  167.     return PLUGIN_HANDLED
  168. }
  169. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  170. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
  171. */

No recoil:
  1. #include <zombie_escape>
  2. #include <ze_vip>
  3. #include <xs>
  4.  
  5. #define VIP_ACCESS ADMIN_LEVEL_H
  6. new g_norecoil[33]
  7. new Float: cl_pushangle[33][3]
  8. new g_maxplayers
  9.  
  10. const WEAPONS_BITSUM = (1<<CSW_KNIFE|1<<CSW_HEGRENADE|1<<CSW_FLASHBANG|1<<CSW_SMOKEGRENADE|1<<CSW_C4)
  11.  
  12. public plugin_natives()
  13. {
  14.     register_native("ze_give_norecoil", "native_ze_give_norecoil", 1)
  15. }
  16.  
  17. public native_ze_give_norecoil(id)
  18. {
  19.     if (!is_user_connected(id))
  20.         return -1
  21.  
  22.     Get_NoRecoil(id)
  23.     return true
  24. }
  25.  
  26. public plugin_init()
  27. {
  28.     register_plugin("[ZE] Extra Item: No Recoil", "1.0", "Spi")
  29.  
  30.     new weapon_name[24]
  31.     for (new i = 1; i <= 30; i++)
  32.     {
  33.         if (!(WEAPONS_BITSUM & 1 << i) && get_weaponname(i, weapon_name, 23))
  34.         {
  35.             RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Pre")
  36.             RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Post", 1)
  37.         }
  38.     }
  39.  
  40.     register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  41.  
  42.     g_maxplayers = get_maxplayers()
  43. }
  44.  
  45. public Get_NoRecoil(id)
  46. {
  47.     g_norecoil[id] = true
  48. }
  49.  
  50. public ze_user_humanized(id)
  51. {
  52.     g_norecoil[id] = false
  53. }
  54.  
  55. public ze_user_infected(iVictim)
  56. {
  57.     g_norecoil[iVictim] = false
  58. }
  59.  
  60.  
  61. public client_connect(id)
  62. {
  63.     g_norecoil[id] = false
  64. }
  65.  
  66. public event_round_start()
  67. {
  68.     for (new id = 1; id <= g_maxplayers; id++)
  69.         g_norecoil[id] = false
  70. }
  71.  
  72. public fw_Weapon_PrimaryAttack_Pre(entity)
  73. {
  74.     new id = pev(entity, pev_owner)
  75.  
  76.     if (g_norecoil[id])
  77.     {
  78.         pev(id, pev_punchangle, cl_pushangle[id])
  79.         return HAM_IGNORED;
  80.     }
  81.     return HAM_IGNORED;
  82. }
  83.  
  84. public fw_Weapon_PrimaryAttack_Post(entity)
  85. {
  86.     new id = pev(entity, pev_owner)
  87.  
  88.     if (g_norecoil[id])
  89.     {
  90.         new Float: push[3]
  91.         pev(id, pev_punchangle, push)
  92.         xs_vec_sub(push, cl_pushangle[id], push)
  93.         xs_vec_mul_scalar(push, 0.0, push)
  94.         xs_vec_add(push, cl_pushangle[id], push)
  95.         set_pev(id, pev_punchangle, push)
  96.         return HAM_IGNORED;
  97.     }
  98.     return HAM_IGNORED;
  99. }
  100.  
  101. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  102. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
  103. */

This all untested.
Want your own mod edition? PM me.
Accepting web projects.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#8

Post by Spir0x » 3 Months Ago

OK BRO, first i already told you the antidote and no recoil are only for [Human Owner] you just modified their flags to ADMIN_LEVEL_H that means it's for vips. i want them only for owner with flag "l" (ADMIN_RCON) can you add #define VIP_ACCESS ADMIN_RCON to ze_vip_menu so only owner can buy them.
Second there's a problem on:

Dual infinity:
Image

Leap:
Image

Lycanthrope:
Image
I trynna make money, not friends.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 202
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#9

Post by sPe3doN » 3 Months Ago

Spir0x wrote:
3 Months Ago
OK BRO, first i already told you the antidote and no recoil are only for [Human Owner] you just modified their flags to ADMIN_LEVEL_H that means it's for vips. i want them only for owner with flag "l" (ADMIN_RCON) can you add #define VIP_ACCESS ADMIN_RCON to ze_vip_menu so only owner can buy them.
Second there's a problem on:

Dual infinity:
Image

Leap:
Image

Lycanthrope:
Image
If you want to change your plugins flag to owner flag just change this

Code: Select all

#define VIP_ACCESS ADMIN_LEVEL_H
->

Code: Select all

#define VIP_ACCESS ADMIN_RECON

[ Post made via Android ]
These users thanked the author sPe3doN for the post:
Mohamed Alaa (3 Months Ago)

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#10

Post by Spir0x » 3 Months Ago

man it's ok, i need to fix the compiling problems now.
I trynna make money, not friends.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests