Available Knife Models By Level

Unpaid Requests, Public Plugins
User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#21

Post by Luxurious » 5 years ago

Compaild ... But not Work At server !!
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

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

#22

Post by Raheem » 5 years ago

Try this code for only 2 knifes: viewtopic.php?p=8059#p8059

Also make sure to place the plugin name at the end of plugins-zombie_escape.ini (It's important)
He who fails to plan is planning to fail

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#23

Post by Luxurious » 5 years ago

but i need a lot of 2 knifes ... like 6 or 8
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#24

Post by Night Fury » 5 years ago

Luxurious wrote: 5 years ago but i need a lot of 2 knifes ... like 6 or 8
Test the code first. Then we will add how many you need.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#25

Post by Luxurious » 5 years ago

worked ....
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#26

Post by Night Fury » 5 years ago

Luxurious wrote: 5 years agoworked ....
Edit this then as you want, i have added for you 6 knives with their sounds.
  1. #include <zombie_escape>
  2. #include <ze_levels>
  3.  
  4. // Models
  5. new const g_szKnife1[][] =
  6. {
  7.     "models/v_knife1.mdl",
  8.     "models/p_knife1.mdl"
  9. }
  10.  
  11. new const g_szKnife2[][] =
  12. {
  13.     "models/v_knife2.mdl",
  14.     "models/p_knife2.mdl"
  15. }
  16.  
  17. new const g_szKnife3[][] =
  18. {
  19.     "models/v_knife2.mdl",
  20.     "models/p_knife2.mdl"
  21. }
  22.  
  23. new const g_szKnife4[][] =
  24. {
  25.     "models/v_knife2.mdl",
  26.     "models/p_knife2.mdl"
  27. }
  28.  
  29. new const g_szKnife5[][] =
  30. {
  31.     "models/v_knife2.mdl",
  32.     "models/p_knife2.mdl"
  33. }
  34.  
  35. new const g_szKnife6[][] =
  36. {
  37.     "models/v_knife2.mdl",
  38.     "models/p_knife2.mdl"
  39. }
  40.  
  41. // Sounds
  42. new const g_szKnife1Sounds[][] =
  43. {
  44.     "weapons/knife1_deploy1.wav",
  45.     "weapons/knife1_hit1.wav",
  46.     "weapons/knife1_hit2.wav",
  47.     "weapons/knife1_hit3.wav",
  48.     "weapons/knife1_hit4.wav",
  49.     "weapons/knife1_hitwall1.wav",
  50.     "weapons/knife1_slash1.wav",
  51.     "weapons/knife1_slash2.wav",
  52.     "weapons/knife1_stab.wav"
  53. }
  54.  
  55. new const g_szKnife2Sounds[][] =
  56. {
  57.     "weapons/knife2_deploy1.wav",
  58.     "weapons/knife2_hit1.wav",
  59.     "weapons/knife2_hit2.wav",
  60.     "weapons/knife2_hit3.wav",
  61.     "weapons/knife2_hit4.wav",
  62.     "weapons/knife2_hitwall1.wav",
  63.     "weapons/knife2_slash1.wav",
  64.     "weapons/knife2_slash2.wav",
  65.     "weapons/knife2_stab.wav"
  66. }
  67.  
  68. new const g_szKnife3Sounds[][] =
  69. {
  70.     "weapons/knife2_deploy1.wav",
  71.     "weapons/knife2_hit1.wav",
  72.     "weapons/knife2_hit2.wav",
  73.     "weapons/knife2_hit3.wav",
  74.     "weapons/knife2_hit4.wav",
  75.     "weapons/knife2_hitwall1.wav",
  76.     "weapons/knife2_slash1.wav",
  77.     "weapons/knife2_slash2.wav",
  78.     "weapons/knife2_stab.wav"
  79. }
  80.  
  81. new const g_szKnife4Sounds[][] =
  82. {
  83.     "weapons/knife2_deploy1.wav",
  84.     "weapons/knife2_hit1.wav",
  85.     "weapons/knife2_hit2.wav",
  86.     "weapons/knife2_hit3.wav",
  87.     "weapons/knife2_hit4.wav",
  88.     "weapons/knife2_hitwall1.wav",
  89.     "weapons/knife2_slash1.wav",
  90.     "weapons/knife2_slash2.wav",
  91.     "weapons/knife2_stab.wav"
  92. }
  93.  
  94. new const g_szKnife5Sounds[][] =
  95. {
  96.     "weapons/knife2_deploy1.wav",
  97.     "weapons/knife2_hit1.wav",
  98.     "weapons/knife2_hit2.wav",
  99.     "weapons/knife2_hit3.wav",
  100.     "weapons/knife2_hit4.wav",
  101.     "weapons/knife2_hitwall1.wav",
  102.     "weapons/knife2_slash1.wav",
  103.     "weapons/knife2_slash2.wav",
  104.     "weapons/knife2_stab.wav"
  105. }
  106.  
  107. new const g_szKnife6Sounds[][] =
  108. {
  109.     "weapons/knife2_deploy1.wav",
  110.     "weapons/knife2_hit1.wav",
  111.     "weapons/knife2_hit2.wav",
  112.     "weapons/knife2_hit3.wav",
  113.     "weapons/knife2_hit4.wav",
  114.     "weapons/knife2_hitwall1.wav",
  115.     "weapons/knife2_slash1.wav",
  116.     "weapons/knife2_slash2.wav",
  117.     "weapons/knife2_stab.wav"
  118. }
  119.  
  120. new const g_szDefaultSounds[][] =
  121. {
  122.     "weapons/knife_deploy1.wav",
  123.     "weapons/knife_hit1.wav",
  124.     "weapons/knife_hit2.wav",
  125.     "weapons/knife_hit3.wav",
  126.     "weapons/knife_hit4.wav",
  127.     "weapons/knife_hitwall1.wav",
  128.     "weapons/knife_slash1.wav",
  129.     "weapons/knife_slash2.wav",
  130.     "weapons/knife_stab.wav"
  131. }
  132.  
  133. // Models indexes
  134. enum
  135. {
  136.     V_Model = 0,
  137.     P_Model
  138. }
  139.  
  140. public plugin_init()
  141. {
  142.     register_plugin("Knife Levels", "1.0", "Raheem")
  143.    
  144.     // Fakemeta
  145.     register_forward(FM_EmitSound, "Fw_EmitSound")
  146. }
  147.  
  148. public plugin_precache()
  149. {
  150.     new iIndex;
  151.    
  152.     // Prechace models
  153.     for(iIndex = 0; iIndex <= charsmax(g_szKnife1); iIndex++)
  154.         precache_model(g_szKnife1[iIndex])
  155.    
  156.     for(iIndex = 0; iIndex <= charsmax(g_szKnife2); iIndex++)
  157.         precache_model(g_szKnife2[iIndex])
  158.    
  159.     for(iIndex = 0; iIndex <= charsmax(g_szKnife3); iIndex++)
  160.         precache_model(g_szKnife3[iIndex])
  161.    
  162.     for(iIndex = 0; iIndex <= charsmax(g_szKnife4); iIndex++)
  163.         precache_model(g_szKnife4[iIndex])
  164.    
  165.     for(iIndex = 0; iIndex <= charsmax(g_szKnife5); iIndex++)
  166.         precache_model(g_szKnife5[iIndex])
  167.    
  168.     for(iIndex = 0; iIndex <= charsmax(g_szKnife6); iIndex++)
  169.         precache_model(g_szKnife6[iIndex])
  170.    
  171.     // Prechace sounds
  172.     for(iIndex = 0; iIndex <= charsmax(g_szKnife1Sounds); iIndex++)
  173.         precache_sound(g_szKnife1Sounds[iIndex])
  174.  
  175.     for(iIndex = 0; iIndex <= charsmax(g_szKnife2Sounds); iIndex++)
  176.         precache_sound(g_szKnife2Sounds[iIndex])
  177.  
  178.     for(iIndex = 0; iIndex <= charsmax(g_szKnife3Sounds); iIndex++)
  179.         precache_sound(g_szKnife3Sounds[iIndex])
  180.  
  181.     for(iIndex = 0; iIndex <= charsmax(g_szKnife4Sounds); iIndex++)
  182.         precache_sound(g_szKnife4Sounds[iIndex])
  183.  
  184.     for(iIndex = 0; iIndex <= charsmax(g_szKnife5Sounds); iIndex++)
  185.         precache_sound(g_szKnife5Sounds[iIndex])
  186.  
  187.     for(iIndex = 0; iIndex <= charsmax(g_szKnife6Sounds); iIndex++)
  188.         precache_sound(g_szKnife6Sounds[iIndex])
  189. }
  190.  
  191. public ze_user_humanized(id)
  192. {
  193.     // Knife 1
  194.     if (ze_get_user_level(id) >= 2 && ze_get_user_level(id) < 5)
  195.     {
  196.         // Player level from 2 to 5 set him this knife
  197.         cs_set_player_view_model(id, CSW_KNIFE, g_szKnife1[V_Model])
  198.         cs_set_player_weap_model(id, CSW_KNIFE, g_szKnife1[P_Model])
  199.        
  200.         ResetKnife(id)
  201.     }
  202.     // Knife 2
  203.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  204.     {
  205.         // Player level from 5 to 8 set him this knife
  206.         cs_set_player_view_model(id, CSW_KNIFE, g_szKnife2[V_Model])
  207.         cs_set_player_weap_model(id, CSW_KNIFE, g_szKnife2[P_Model])
  208.        
  209.         ResetKnife(id)
  210.     }
  211.     // Knife 3
  212.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  213.     {
  214.         // Player level from 5 to 8 set him this knife
  215.         cs_set_player_view_model(id, CSW_KNIFE, g_szKnife3[V_Model])
  216.         cs_set_player_weap_model(id, CSW_KNIFE, g_szKnife3[P_Model])
  217.        
  218.         ResetKnife(id)
  219.     }
  220.     // Knife 4
  221.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  222.     {
  223.         // Player level from 5 to 8 set him this knife
  224.         cs_set_player_view_model(id, CSW_KNIFE, g_szKnife4[V_Model])
  225.         cs_set_player_weap_model(id, CSW_KNIFE, g_szKnife4[P_Model])
  226.        
  227.         ResetKnife(id)
  228.     }
  229.     // Knife 5
  230.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  231.     {
  232.         // Player level from 5 to 8 set him this knife
  233.         cs_set_player_view_model(id, CSW_KNIFE, g_szKnife5[V_Model])
  234.         cs_set_player_weap_model(id, CSW_KNIFE, g_szKnife5[P_Model])
  235.        
  236.         ResetKnife(id)
  237.     }
  238.     // Knife 6
  239.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  240.     {
  241.         // Player level from 5 to 8 set him this knife
  242.         cs_set_player_view_model(id, CSW_KNIFE, g_szKnife6[V_Model])
  243.         cs_set_player_weap_model(id, CSW_KNIFE, g_szKnife6[P_Model])
  244.        
  245.         ResetKnife(id)
  246.     }
  247. }
  248.  
  249. public ResetKnife(id)
  250. {
  251.     rg_remove_item(id, "weapon_knife")
  252.     rg_give_item(id, "weapon_knife", GT_APPEND)
  253.     engclient_cmd(id, "weapon_knife")
  254.     emit_sound(id, CHAN_BODY, "items/gunpickup2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  255. }
  256.  
  257. public Fw_EmitSound(id, iChannel, const szSound[])
  258. {
  259.     if(!is_user_alive(id) || ze_is_user_zombie(id))
  260.         return FMRES_IGNORED
  261.    
  262.     // Knife 1
  263.     if (ze_get_user_level(id) >= 2 && ze_get_user_level(id) < 5)
  264.     {
  265.         for(new iIndex = 0; iIndex <= charsmax(g_szDefaultSounds); iIndex++)
  266.         {
  267.             if (equal(g_szDefaultSounds[iIndex], szSound))
  268.             {
  269.                 emit_sound(id, iChannel, g_szKnife1Sounds[iIndex], 1.0, ATTN_NORM, 0, PITCH_NORM)
  270.                 return FMRES_SUPERCEDE
  271.             }
  272.         }
  273.     }
  274.     // Knife 2
  275.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  276.     {
  277.         for(new iIndex = 0; iIndex <= charsmax(g_szDefaultSounds); iIndex++)
  278.         {
  279.             if (equal(g_szDefaultSounds[iIndex], szSound))
  280.             {
  281.                 emit_sound(id, iChannel, g_szKnife2Sounds[iIndex], 1.0, ATTN_NORM, 0, PITCH_NORM)
  282.                 return FMRES_SUPERCEDE
  283.             }
  284.         }
  285.     }
  286.     // Knife 3
  287.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  288.     {
  289.         for(new iIndex = 0; iIndex <= charsmax(g_szDefaultSounds); iIndex++)
  290.         {
  291.             if (equal(g_szDefaultSounds[iIndex], szSound))
  292.             {
  293.                 emit_sound(id, iChannel, g_szKnife3Sounds[iIndex], 1.0, ATTN_NORM, 0, PITCH_NORM)
  294.                 return FMRES_SUPERCEDE
  295.             }
  296.         }
  297.     }
  298.     // Knife 4
  299.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  300.     {
  301.         for(new iIndex = 0; iIndex <= charsmax(g_szDefaultSounds); iIndex++)
  302.         {
  303.             if (equal(g_szDefaultSounds[iIndex], szSound))
  304.             {
  305.                 emit_sound(id, iChannel, g_szKnife4Sounds[iIndex], 1.0, ATTN_NORM, 0, PITCH_NORM)
  306.                 return FMRES_SUPERCEDE
  307.             }
  308.         }
  309.     }
  310.     // Knife 5
  311.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  312.     {
  313.         for(new iIndex = 0; iIndex <= charsmax(g_szDefaultSounds); iIndex++)
  314.         {
  315.             if (equal(g_szDefaultSounds[iIndex], szSound))
  316.             {
  317.                 emit_sound(id, iChannel, g_szKnife5Sounds[iIndex], 1.0, ATTN_NORM, 0, PITCH_NORM)
  318.                 return FMRES_SUPERCEDE
  319.             }
  320.         }
  321.     }
  322.     // Knife 6
  323.     else if (ze_get_user_level(id) >= 5 && ze_get_user_level(id) < 8)
  324.     {
  325.         for(new iIndex = 0; iIndex <= charsmax(g_szDefaultSounds); iIndex++)
  326.         {
  327.             if (equal(g_szDefaultSounds[iIndex], szSound))
  328.             {
  329.                 emit_sound(id, iChannel, g_szKnife6Sounds[iIndex], 1.0, ATTN_NORM, 0, PITCH_NORM)
  330.                 return FMRES_SUPERCEDE
  331.             }
  332.         }
  333.     }
  334.    
  335.     return FMRES_IGNORED
  336. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#27

Post by Luxurious » 5 years ago

oh thx <3
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

Post Reply

Create an account or sign in to join the discussion

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

Create an account

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

Register

Sign in

Who is online

Users browsing this forum: Bing [Bot] and 0 guests