Raised This Month: $ Target: $400
 0% 

c4 model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vincentwind
Junior Member
Join Date: Apr 2006
Old 04-28-2006 , 11:51   c4 model
Reply With Quote #1

#include <amxmodx>
#include <fakemeta>

static const MODEL_C4[] = "models/blah/w_c4.mdl"; // edit this

public plugin_init()
{
register_plugin("test" , "0.1" , "v3x");
register_forward(FM_SetModel , "forward_setmodel");
}

public plugin_precache()
precache_model(MODEL_C4);

public forward_setmodel(entid)
{
if(!pev_valid(entid))
return FMRES_IGNORED;

new model[64];
pev(entid , pev_model , model , 63);

if(equal(model , "models/w_c4.mdl"))
{
engfunc(EngFunc_SetModel , entid , MODEL_C4);
return FMRES_SUPERCEDE;
}

return FMRES_IGNORED;
}

I can't see other design..........
And I want to change w_backpack.mdl
How to change ??
vincentwind is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-10-2006 , 09:43  
Reply With Quote #2

could you please post all of the inside of [ small ] (no spaces) so that it is easier to read?
SubStream is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 05-10-2006 , 12:39  
Reply With Quote #3

Quote:
Originally Posted by SubStream
could you please post all of the inside of [ small ] (no spaces) so that it is easier to read?
Code:
#include <amxmodx> #include <fakemeta> static const MODEL_C4[] = "models/blah/w_c4.mdl"; // edit this public plugin_init() { register_plugin("test" , "0.1" , "v3x"); register_forward(FM_SetModel , "forward_setmodel"); } public plugin_precache() precache_model(MODEL_C4); public forward_setmodel(entid) { if(!pev_valid(entid)) return FMRES_IGNORED; new model[64]; pev(entid , pev_model , model , 63); if(equal(model , "models/w_c4.mdl")) { engfunc(EngFunc_SetModel , entid , MODEL_C4); return FMRES_SUPERCEDE; } return FMRES_IGNORED; }
__________________
- Bye bye!
nightscreem is offline
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-10-2006 , 12:41  
Reply With Quote #4

Code:
public plugin_precache() precache_model(MODEL_C4);
musn't it be
Code:
public plugin_precache() { precache_model(MODEL_C4); }
wouter is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-10-2006 , 14:22  
Reply With Quote #5

Yes it should but I don't even want to respond till the person who posts it fixes there post to even be presentable... put in a [small] tag and use indentation so its at least readable to an extent.
SubStream is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-10-2006 , 14:50  
Reply With Quote #6

Quote:
Originally Posted by wouter
Code:
public plugin_precache() precache_model(MODEL_C4);
musn't it be
Code:
public plugin_precache() { precache_model(MODEL_C4); }
actually, it doesn't.

But in here
Code:
if(equal(model , "models/w_c4.mdl")) { engfunc(EngFunc_SetModel , entid , MODEL_C4); return FMRES_SUPERCEDE; }
I think you need to use the alloc string function. Don't remember the syntax off the top of my head.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-10-2006 , 15:43  
Reply With Quote #7

Example of how to use allowcstring
Code:
g_model = engfunc ( EngFunc_AllocString, "models/w_c4.mdl" )
SubStream is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-10-2006 , 15:53  
Reply With Quote #8

then it should be like
Code:
if(equal(model , "models/w_c4.mdl")) { engfunc(EngFunc_SetModel , entid , engfunc ( EngFunc_AllocString,  MODEL_C4 ) ); return FMRES_SUPERCEDE; }
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-10-2006 , 15:58  
Reply With Quote #9

yup suicide is right on the money
SubStream is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-11-2006 , 03:46  
Reply With Quote #10

No, you shouldn't convert it to integer because SetModel requires a string. :|
VEN is offline
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 05:10.


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