Raised This Month: $ Target: $400
 0% 

[help]custom weapon models with shield


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FL@ME
New Member
Join Date: Apr 2006
Old 04-13-2006 , 10:02   [help]custom weapon models with shield
Reply With Quote #1

i'm making a custom weapon models plugin
the problem is that when i buy,pick or drop a shield
the weapon returns to it's original model
and when i shoot or swich the weapon and then swich back
it returns to it's custom one

the script :
============================================= =========================
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>

#define PLUGIN "Custom Weapon Models"
#define VERSION "1.0"
#define AUTHOR "FL@ME"

#define OLD_MODEL_DEAGLE_V "models/v_deagle.mdl"
#define NEW_MODEL_DEAGLE_V "models/custom_weapons/v_deagle.mdl"
#define OLD_MODEL_DEAGLE_P "models/p_deagle.mdl"
#define NEW_MODEL_DEAGLE_P "models/custom_weapons/p_deagle.mdl"
#define OLD_MODEL_DEAGLE_W "models/w_deagle.mdl"
#define NEW_MODEL_DEAGLE_W "models/custom_weapons/w_deagle.mdl"
#define OLD_MODEL_DEAGLE_VSH "models/shield/v_shield_deagle.mdl"
#define NEW_MODEL_DEAGLE_VSH "models/custom_weapons/shield/v_shield_deagle.mdl"
#define OLD_MODEL_DEAGLE_PSH "models/shield/p_shield_deagle.mdl"
#define NEW_MODEL_DEAGLE_PSH "models/custom_weapons/shield/p_shield_deagle.mdl"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("CurWeapon","SetCWM","be")
}
public plugin_precache() {
precache_model("models/custom_weapons/v_deagle.mdl")
precache_model("models/custom_weapons/p_deagle.mdl")
precache_model("models/custom_weapons/w_deagle.mdl")
precache_model("models/custom_weapons/shield/v_shield_deagle.mdl")
precache_model("models/custom_weapons/shield/p_shield_deagle.mdl")
register_forward(FM_SetModel,"SetCWMW")
}
public SetCWMW(edict, const model[]) {
if (!is_valid_ent(edict))
return FMRES_IGNORED
if(equal(model, OLD_MODEL_DEAGLE_W))
{
entity_set_model(edict, NEW_MODEL_DEAGLE_W)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
public SetCWM(id) {
new vmodel[32],pmodel[32]
entity_get_string(id,EV_SZ_viewmodel,vmodel,1 00)
if (equal(vmodel,OLD_MODEL_DEAGLE_V)) {
entity_set_string(id,EV_SZ_viewmodel,NEW_MODE L_DEAGLE_V)
}
else if (equal(vmodel,OLD_MODEL_DEAGLE_VSH)) {
entity_set_string(id,EV_SZ_viewmodel,NEW_MODE L_DEAGLE_VSH)
}
entity_get_string(id,EV_SZ_weaponmodel,pmodel ,100)
if (equal(pmodel,OLD_MODEL_DEAGLE_P)) {
entity_set_string(id,EV_SZ_weaponmodel,NEW_MO DEL_DEAGLE_P)
}
else if (equal(pmodel,OLD_MODEL_DEAGLE_PSH)) {
entity_set_string(id,EV_SZ_weaponmodel,NEW_MO DEL_DEAGLE_PSH)
}
}
============================================= =========================
FL@ME is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-13-2006 , 14:23  
Reply With Quote #2

http://ghw-amxx.com/viewtopic.php?t=18
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-13-2006 , 14:42  
Reply With Quote #3

please use the [small] tag next time you post script.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-13-2006 , 14:44  
Reply With Quote #4

Hm ... You might want to use the cs_get_user_shield native as well. That is, if you're only using it for shield models.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
FL@ME
New Member
Join Date: Apr 2006
Old 04-16-2006 , 11:15  
Reply With Quote #5

Quote:
Originally Posted by v3x
Hm ... You might want to use the cs_get_user_shield native as well. That is, if you're only using it for shield models.
this command is not in the help doc
that's why i didn't know that it's exist
thanks...
FL@ME is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2006 , 12:04  
Reply With Quote #6

Quote:
Originally Posted by v3x
http://ghw-amxx.com/viewtopic.php?t=18
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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:15.


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