Raised This Month: $ Target: $400
 0% 

Knife Menu


Post New Thread Reply   
 
Thread Tools Display Modes
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
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 08-06-2010 , 09:31   Re: Knife Menu
Reply With Quote #2

Quote:
Originally Posted by snowyledge View Post
Could anybody fix the code because when I type /knife nothing shows up.

Code:
#define AUTHOR "Toast"
That's why
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
snowyledge
BANNED
Join Date: Dec 2009
Old 08-06-2010 , 15:33   Re: Knife Menu
Reply With Quote #3

Quote:
Originally Posted by DruGzOG View Post
That's why
Could anybody help me tho.
snowyledge is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-06-2010 , 23:18   Re: Knife Menu
Reply With Quote #4

You have a runtime-error because there is no function called CurWeapon.
You registered it, so use it. or remove it but that will make the plugin not work like it should.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
snowyledge
BANNED
Join Date: Dec 2009
Old 08-06-2010 , 23:34   Re: Knife Menu
Reply With Quote #5

I dont get that
snowyledge is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-07-2010 , 03:08   Re: Knife Menu
Reply With Quote #6

you never use this event
Code:
register_event("CurWeapon","CurWeapon","be","1=1")
So change public SetKnife(id) to public CurWeapon

You would have known that is you checked your error-logs
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
kaiboy
Junior Member
Join Date: Jul 2010
Old 10-16-2010 , 01:22   Re: Knife Menu
Reply With Quote #7

Sorry, I not good at English..
This amxx is what?
is not say /kinfe can chage you knife mdl?
kaiboy is offline
StarMazter
Junior Member
Join Date: Jun 2012
Location: Sweden
Old 06-28-2012 , 08:21   Re: Knife Menu
Reply With Quote #8

I think the author (Toastt) has disable the mysql for this plugin.
__________________
StarMazter is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 06-28-2012 , 16:50   Re: Knife Menu
Reply With Quote #9

Quote:
Originally Posted by StarMazter View Post
I think the author (Toastt) has disable the mysql for this plugin.
Why do you bump an old thread?
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Reply



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