Raised This Month: $ Target: $400
 0% 

Knife Model Script Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oreo824
Junior Member
Join Date: Jul 2006
Location: California
Old 07-24-2007 , 17:55   Knife Model Script Help
Reply With Quote #1

Hey guys, Havent been on these forms in a while! now im back into cs and scripting.

I need help, i want to precache a knife model (v_knife2.mdl) and have every player in the server have that model as their knife. This is a very simple script exept every time i try someones script or edit theirs it just doesent work.

Thanks,

oreo824

Edit:

Code:
#include <amxmodx>
#include <engine>

public plugin_init()    
 {   
 register_plugin( "eGKnife" ,"1.0", "incRo")
 register_event("CurWeapon","event_curweapon","b")
}
 
public plugin_precache()   
 {    
 precache_model("models/custom/egknife.mdl")
}
public event_curweapon(id) 
 { 
 new ammo, clip
 if(get_user_weapon(id,ammo,clip) == CSW_KNIFE)
  { 
  entity_set_string(id,EV_SZ_viewmodel,"models/custom/egknife.mdl")  
 }   

}
can someone verify this? i compiled and checked and everything worked fine except the model didnt show up
__________________
Yeah that plugin..

Last edited by oreo824; 07-24-2007 at 19:00.
oreo824 is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-24-2007 , 20:03   Re: Knife Model Script Help
Reply With Quote #2

try this:
Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {       register_plugin( "eGKnife" ,"1.0", "incRo");         register_event("CurWeapon","event_curweapon","b"); }   public plugin_precache() {         precache_model("models/custom/egknife.mdl") } public event_curweapon(id) {     new wpnid = read_data(2);         if(wpnid == CSW_KNIFE) {         set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, "models/custom/egknife.mdl"));     }   }
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
oreo824
Junior Member
Join Date: Jul 2006
Location: California
Old 07-25-2007 , 00:37   Re: Knife Model Script Help
Reply With Quote #3

It doesent work
__________________
Yeah that plugin..
oreo824 is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-25-2007 , 00:57   Re: Knife Model Script Help
Reply With Quote #4

I tested this with the c4 model and it worked, so I hope it will do the job for you too:

Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {       register_plugin( "eGKnife" ,"1.0", "incRo")         register_event("CurWeapon","event_curweapon","b","1=1","2=29") //CSW_KNIFE = 29 } public plugin_precache() {         precache_model("models/custom/egknife.mdl") } public event_curweapon(id) {     set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, "models/custom/egknife.mdl")) }
stupok is offline
oreo824
Junior Member
Join Date: Jul 2006
Location: California
Old 07-25-2007 , 14:18   Re: Knife Model Script Help
Reply With Quote #5

It wont load correctly, it loads as "unknown" and when i restart the server the server doesent come up anymore unless i take it off.

Heres what i got:

Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{   
    register_plugin( "eGKnife" ,"1.0", "incRo")
    
    register_event("CurWeapon","event_curweapon","b","1=1","2=29") //CSW_KNIFE = 29
}

public plugin_precache()
{    
    precache_model("models/custom/v_knife.mdl")
}

public event_curweapon(id)
{
    set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, "models/custom/v_knife.mdl"))
}
__________________
Yeah that plugin..
oreo824 is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-25-2007 , 14:38   Re: Knife Model Script Help
Reply With Quote #6

Copy and paste the code you have into an .sma file

Move the .sma file to amxmodx/scripting

Move the .sma file onto compile.exe

Go to amxmodx/scripting/compiled

Move the .amxx file to amxmodx/plugins

Open amxmodx/configs/plugins.ini and add the name of the amxx file
stupok is offline
owned
Member
Join Date: Jul 2007
Old 07-26-2007 , 15:40   Re: Knife Model Script Help
Reply With Quote #7

Do you have the module fakemeta enabled?
__________________
MARREC/OWNED = me.
owned is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-26-2007 , 16:13   Re: Knife Model Script Help
Reply With Quote #8

Type "amx_plugins" and "meta list" in your server console and paste the output here.
stupok is offline
oreo824
Junior Member
Join Date: Jul 2006
Location: California
Old 07-26-2007 , 16:24   Re: Knife Model Script Help
Reply With Quote #9

Quote:
Originally Posted by owned View Post
Do you have the module fakemeta enabled?
thank you so much, i completely forgot about this.

thanks stupok69 by the way for the help with the code
__________________
Yeah that plugin..
oreo824 is offline
P-Town
Junior Member
Join Date: Jul 2007
Old 07-28-2007 , 05:43   Re: Knife Model Script Help
Reply With Quote #10

Thx 4 the script it works perfect i love you =)
P-Town is offline
Reply


Thread Tools
Display Modes

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 21:25.


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