Raised This Month: $ Target: $400
 0% 

Knife Menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
snowyledge
BANNED
Join Date: Dec 2009
Old 08-06-2010 , 07:59   Knife Menu
Reply With Quote #1

Could anybody fix the code because when I type /knife nothing shows up.

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine> 
#include <fun>
#include <hamsandwich>
#include <colorchat>
#define PLUGIN "Knife Mod"
#define VERSION "1.0" 
#define AUTHOR "Toast"
#define SPAWNID 5321
new knife_model[33];
new g_Menu;
public plugin_init() { 
 
 register_plugin(PLUGIN, VERSION, AUTHOR) 
 
 register_event( "Damage", "event_damage", "be" )
 register_event("CurWeapon","CurWeapon","be","1=1") 
 
 RegisterHam(Ham_Killed, "player", "hamKilled", 0)
 
 g_Menu = register_menuid("Knife Mod")
 register_menucmd(g_Menu, 1023, "knifemenu")
 
 register_clcmd("say /knife", "display_knife")
 
 set_task(480.0, "kmodmsg", 0, _, _, "b")
}
public plugin_precache()
{ 
 precache_model("models/JukeGodz/v_butcher.mdl") 
 precache_model("models/JukeGodz/p_butcher.mdl") 
 precache_model("models/JukeGodz/v_machete.mdl")
 precache_model("models/JukeGodz/p_machete.mdl")
 precache_model("models/JukeGodz/v_bak.mdl")
 precache_model("models/JukeGodz/p_bak.mdl")
 precache_model("models/JukeGodz/v_pocket.mdl")
 precache_model("models/JukeGodz/p_pocket.mdl")
 precache_model("models/v_knife.mdl") 
 precache_model("models/p_knife.mdl")
} 
public display_knife(id)
{
 new menuBody[512]
 add(menuBody, 511, "\y[jG] \rKnife Mod\w^n^n")
 add(menuBody, 511, "\r1. \wMachete^n")
 add(menuBody, 511, "\r2. \wBak Knife^n")
 add(menuBody, 511, "\r3. \wPocket Knife^n")
 add(menuBody, 511, "\r4. \wButcher Knife^n")
 add(menuBody, 511, "\r5. \wNomal Knife^n")
 add(menuBody, 511, "\r0. \wExit^n")
 
 new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<9 )
 show_menu(id, keys, menuBody, -1, "Knife Mod")
}
public knifemenu(id, key)
{
 switch(key) 
 {
  case 0: SetKnife(id , 4)
  case 1: SetKnife(id , 2)
  case 2: SetKnife(id , 3)
  case 3: SetKnife(id , 1)
  case 4: SetKnife(id , 0)
  default: return PLUGIN_HANDLED
 }
 return PLUGIN_HANDLED
} 
public SetKnife(id , Knife)
{
 knife_model[id] = Knife
 
 new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
 
 if ( Weapon != CSW_KNIFE )
   return PLUGIN_HANDLED
 
 new vModel[56],pModel[56]
 
 switch(Knife)
 {
  case 0:
  {
   format(vModel,55,"models/v_knife.mdl")
   format(pModel,55,"models/p_knife.mdl")
  }
  case 1:
  {
   format(vModel,55,"models/knife-mod/v_butcher.mdl")
   format(pModel,55,"models/knife-mod/p_butcher.mdl")
  }
  case 2:
  {
   format(vModel,55,"models/knife-mod/v_bak.mdl")
   format(pModel,55,"models/knife-mod/p_bak.mdl")
  }
  case 3:
  {
   format(vModel,55,"models/knife-mod/v_pocket.mdl")
   format(pModel,55,"models/knife-mod/p_pocket.mdl")
  }
  case 4:
  {
   format(vModel,55,"models/knife-mod/v_machete.mdl")
   format(pModel,55,"models/knife-mod/p_machete.mdl")
  }
 } 
 
 entity_set_string(id, EV_SZ_viewmodel, vModel)
 entity_set_string(id, EV_SZ_weaponmodel, pModel)
 
 return PLUGIN_HANDLED;  
}   
public kmodmsg( )
{ 
 ColorChat( 0, GREY, "[jG]^x04 Type /knife to change your knife skin!" )
}  
public hamKilled( id )
{
 ExecuteHamB( Ham_CS_RoundRespawn, id )
 set_task( 3.0, "spawnagain", SPAWNID+id )
 ColorChat( id, GREY, "[jG]^x04 Please wait to be respawned." )
 strip_user_weapons( id )
 give_item( id, "weapon_knife" )
}
public spawnagain( id )
{
 ExecuteHamB( Ham_CS_RoundRespawn, id )
 strip_user_weapons( id )
 give_item( id, "weapon_knife" )
 
 return;
}
snowyledge is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode