i have been trying and trying to fix this port...its for custom mdls on server.... can ANYONE help ?
the v_ models is the only thing that works..
w_ mdls - and p_mdls - and knife sounds wont work.. only v_ mdls
heres the .sma ..
can snyone PLEASE look at this and fix it so it works....if not all then any help at all will be greatly appreciated........>>>>>>
Code:
/***************************************************************************************************
AMX Weapons Models
Version: 0.2
Author: KRoTaL
0.1 Release
0.2 Added possibility to replace knife sounds
This plugin allows you to replace the models (v_, p_ and w_) of all the weapons, and knife sounds.
Players will only have to download the models/sounds, their original models/sounds won't be modified.
vmodel is the model you see in your hands.
pmodel is the model you see in other players' hands.
wmodel is the model you see when the weapon is on the ground.
If you change a weapon cvar in game, it won't work until mapchange, because the model/sound hasn't been precached.
The names of the models/sounds must be different than the default ones, else players won't download them because
they already have them on their computer.
Cvars:
weapons_models "1" - 0: disables the plugin (but does not prevent the plugin from precaching files)
1: enables the plugin
See below.
Examples:
p228_vmodel "models/custom_weapons/v_p228.mdl"
knife_pmodel "models/p_axe.mdl"
bomb_wmodel "models/egg.mdl"
knife_hit_sound "sound/axe_hit.wav"
Setup (AMX 0.9.9):
Install the amx file.
Enable VexdUM (both in metamod's plugins.ini and amx's modules.ini)
Copy-paste all these cvars in your server.cfg (or listenserver.cfg or amx.cfg)
and fill the ones you want with the path to your custom model/sound.
p228_vmodel ""
p228_pmodel ""
p228_wmodel ""
scout_vmodel ""
scout_pmodel ""
scout_wmodel ""
hegrenade_vmodel "models/v_hegrenade.mdl"
hegrenade_pmodel "models/p_hegrenade.mdl"
hegrenade_wmodel "models/w_hegrenade.mdl"
xm1014_vmodel ""
xm1014_pmodel ""
xm1014_wmodel ""
c4_vmodel ""
c4_pmodel ""
c4_wmodel ""
mac10_vmodel ""
mac10_pmodel ""
mac10_wmodel ""
aug_vmodel ""
aug_pmodel ""
aug_wmodel ""
smokegrenade_vmodel "models/v_smokegrenade.mdl"
smokegrenade_pmodel "models/p_smokegrenade.mdl"
smokegrenade_wmodel "models/w_smokegrenade.mdl"
elite_vmodel ""
elite_pmodel ""
elite_wmodel ""
fiveseven_vmodel ""
fiveseven_pmodel ""
fiveseven_wmodel ""
ump45_vmodel ""
ump45_pmodel ""
ump45_wmodel ""
sg550_vmodel ""
sg550_pmodel ""
sg550_wmodel ""
galil_vmodel ""
galil_pmodel ""
galil_wmodel ""
famas_vmodel ""
famas_pmodel ""
famas_wmodel ""
usp_vmodel "models/USP/Silver/v_usp.mdl"
usp_pmodel "models/USP/Silver/p_usp.mdl"
usp_wmodel "models/USP/Silver/w_usp.mdl"
glock18_vmodel ""
glock18_pmodel ""
glock18_wmodel ""
awp_vmodel ""
awp_pmodel ""
awp_wmodel ""
mp5navy_vmodel ""
mp5navy_pmodel ""
mp5navy_wmodel ""
m249_vmodel ""
m249_pmodel ""
m249_wmodel ""
m3_vmodel ""
m3_pmodel ""
m3_wmodel ""
m4a1_vmodel ""
m4a1_pmodel ""
m4a1_wmodel ""
tmp_vmodel ""
tmp_pmodel ""
tmp_wmodel ""
g3sg1_vmodel ""
g3sg1_pmodel ""
g3sg1_wmodel ""
flashbang_vmodel "models/v_flashbang.mdl"
flashbang_pmodel "models/p_flashbang.mdl"
flashbang_wmodel "models/w_flashbang.mdl"
deagle_vmodel ""
deagle_pmodel ""
deagle_wmodel ""
sg552_vmodel ""
sg552_pmodel ""
sg552_wmodel ""
ak47_vmodel ""
ak47_pmodel ""
ak47_wmodel ""
knife_vmodel ""
knife_pmodel ""
p90_vmodel ""
p90_pmodel ""
p90_wmodel ""
bomb_wmodel ""
knife_deploy_sound ""
knife_slash_sound ""
knife_stab_sound ""
knife_hit_sound ""
knife_hitwall_sound ""
Credits:
Code to replace knife sounds from ChickenMod Rebirth by T(+)rget
***************************************************************************************************/
#pragma dynamic 131072
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define SIZE 64
new p228_vmodel[SIZE]
new p228_pmodel[SIZE]
new p228_wmodel[SIZE]
new scout_vmodel[SIZE]
new scout_pmodel[SIZE]
new scout_wmodel[SIZE]
new hegrenade_vmodel[SIZE]
new hegrenade_pmodel[SIZE]
new hegrenade_wmodel[SIZE]
new xm1014_vmodel[SIZE]
new xm1014_pmodel[SIZE]
new xm1014_wmodel[SIZE]
new c4_vmodel[SIZE]
new c4_pmodel[SIZE]
new c4_wmodel[SIZE]
new mac10_vmodel[SIZE]
new mac10_pmodel[SIZE]
new mac10_wmodel[SIZE]
new aug_vmodel[SIZE]
new aug_pmodel[SIZE]
new aug_wmodel[SIZE]
new smokegrenade_vmodel[SIZE]
new smokegrenade_pmodel[SIZE]
new smokegrenade_wmodel[SIZE]
new elite_vmodel[SIZE]
new elite_pmodel[SIZE]
new elite_wmodel[SIZE]
new fiveseven_vmodel[SIZE]
new fiveseven_pmodel[SIZE]
new fiveseven_wmodel[SIZE]
new ump45_vmodel[SIZE]
new ump45_pmodel[SIZE]
new ump45_wmodel[SIZE]
new sg550_vmodel[SIZE]
new sg550_pmodel[SIZE]
new sg550_wmodel[SIZE]
new galil_vmodel[SIZE]
new galil_pmodel[SIZE]
new galil_wmodel[SIZE]
new famas_vmodel[SIZE]
new famas_pmodel[SIZE]
new famas_wmodel[SIZE]
new usp_vmodel[SIZE]
new usp_pmodel[SIZE]
new usp_wmodel[SIZE]
new glock18_vmodel[SIZE]
new glock18_pmodel[SIZE]
new glock18_wmodel[SIZE]
new awp_vmodel[SIZE]
new awp_pmodel[SIZE]
new awp_wmodel[SIZE]
new mp5navy_vmodel[SIZE]
new mp5navy_pmodel[SIZE]
new mp5navy_wmodel[SIZE]
new m249_vmodel[SIZE]
new m249_pmodel[SIZE]
new m249_wmodel[SIZE]
new m3_vmodel[SIZE]
new m3_pmodel[SIZE]
new m3_wmodel[SIZE]
new m4a1_vmodel[SIZE]
new m4a1_pmodel[SIZE]
new m4a1_wmodel[SIZE]
new tmp_vmodel[SIZE]
new tmp_pmodel[SIZE]
new tmp_wmodel[SIZE]
new g3sg1_vmodel[SIZE]
new g3sg1_pmodel[SIZE]
new g3sg1_wmodel[SIZE]
new flashbang_vmodel[SIZE]
new flashbang_pmodel[SIZE]
new flashbang_wmodel[SIZE]
new deagle_vmodel[SIZE]
new deagle_pmodel[SIZE]
new deagle_wmodel[SIZE]
new sg552_vmodel[SIZE]
new sg552_pmodel[SIZE]
new sg552_wmodel[SIZE]
new ak47_vmodel[SIZE]
new ak47_pmodel[SIZE]
new ak47_wmodel[SIZE]
new knife_vmodel[SIZE]
new knife_pmodel[SIZE]
new p90_vmodel[SIZE]
new p90_pmodel[SIZE]
new p90_wmodel[SIZE]
new bomb_wmodel[SIZE]
new knife_deploy_soundfile[SIZE]
new knife_slash_soundfile[SIZE]
new knife_stab_soundfile[SIZE]
new knife_hit_soundfile[SIZE]
new knife_hitwall_soundfile[SIZE]
new knife_deploy_sound[SIZE]
new knife_slash_sound[SIZE]
new knife_stab_sound[SIZE]
new knife_hit_sound[SIZE]
new knife_hitwall_sound[SIZE]
stock custom_file_exists(const file[])
{
return (!equal(file, "") && file_exists(file))
}
public plugin_init()
{
register_plugin("Weapons Models", "0.1", "KRoTaL")
register_cvar("weapons_models", "1")
register_cvar("p228_vmodel", "")
register_cvar("p228_pmodel", "")
register_cvar("p228_wmodel", "")
register_cvar("scout_vmodel", "")
register_cvar("scout_pmodel", "")
register_cvar("scout_wmodel", "")
register_cvar("hegrenade_vmodel", "")
register_cvar("hegrenade_pmodel", "")
register_cvar("hegrenade_wmodel", "")
register_cvar("xm1014_vmodel", "")
register_cvar("xm1014_pmodel", "")
register_cvar("xm1014_wmodel", "")
register_cvar("c4_vmodel", "")
register_cvar("c4_pmodel", "")
register_cvar("c4_wmodel", "")
register_cvar("mac10_vmodel", "")
register_cvar("mac10_pmodel", "")
register_cvar("mac10_wmodel", "")
register_cvar("aug_vmodel", "")
register_cvar("aug_pmodel", "")
register_cvar("aug_wmodel", "")
register_cvar("smokegrenade_vmodel", "")
register_cvar("smokegrenade_pmodel", "")
register_cvar("smokegrenade_wmodel", "")
register_cvar("elite_vmodel", "")
register_cvar("elite_pmodel", "")
register_cvar("elite_wmodel", "")
register_cvar("fiveseven_vmodel", "")
register_cvar("fiveseven_pmodel", "")
register_cvar("fiveseven_wmodel", "")
register_cvar("ump45_vmodel", "")
register_cvar("ump45_pmodel", "")
register_cvar("ump45_wmodel", "")
register_cvar("sg550_vmodel", "")
register_cvar("sg550_pmodel", "")
register_cvar("sg550_wmodel", "")
register_cvar("galil_vmodel", "")
register_cvar("galil_pmodel", "")
register_cvar("galil_wmodel", "")
register_cvar("famas_vmodel", "")
register_cvar("famas_pmodel", "")
register_cvar("famas_wmodel", "")
register_cvar("usp_vmodel", "")
register_cvar("usp_pmodel", "")
register_cvar("usp_wmodel", "")
register_cvar("glock18_vmodel", "")
register_cvar("glock18_pmodel", "")
register_cvar("glock18_wmodel", "")
register_cvar("awp_vmodel", "")
register_cvar("awp_pmodel", "")
register_cvar("awp_wmodel", "")
register_cvar("mp5navy_vmodel", "")
register_cvar("mp5navy_pmodel", "")
register_cvar("mp5navy_wmodel", "")
register_cvar("m249_vmodel", "")
register_cvar("m249_pmodel", "")
register_cvar("m249_wmodel", "")
register_cvar("m3_vmodel", "")
register_cvar("m3_pmodel", "")
register_cvar("m3_wmodel", "")
register_cvar("m4a1_vmodel", "")
register_cvar("m4a1_pmodel", "")
register_cvar("m4a1_wmodel", "")
register_cvar("tmp_vmodel", "")
register_cvar("tmp_pmodel", "")
register_cvar("tmp_wmodel", "")
register_cvar("g3sg1_vmodel", "")
register_cvar("g3sg1_pmodel", "")
register_cvar("g3sg1_wmodel", "")
register_cvar("flashbang_vmodel", "")
register_cvar("flashbang_pmodel", "")
register_cvar("flashbang_wmodel", "")
register_cvar("deagle_vmodel", "")
register_cvar("deagle_pmodel", "")
register_cvar("deagle_wmodel", "")
register_cvar("sg552_vmodel", "")
register_cvar("sg552_pmodel", "")
register_cvar("sg552_wmodel", "")
register_cvar("ak47_vmodel", "")
register_cvar("ak47_pmodel", "")
register_cvar("ak47_wmodel", "")
register_cvar("knife_vmodel", "")
register_cvar("knife_pmodel", "")
register_cvar("p90_vmodel", "")
register_cvar("p90_pmodel", "")
register_cvar("p90_wmodel", "")
register_cvar("bomb_wmodel", "")
register_cvar("knife_deploy_sound", "")
register_cvar("knife_slash_sound", "")
register_cvar("knife_stab_sound", "")
register_cvar("knife_hit_sound", "")
register_cvar("knife_hitwall_sound", "")
register_event("CurWeapon", "check_model", "be", "1=1")
}
public plugin_precache()
{
get_cvar_string("p228_vmodel", p228_vmodel, SIZE-1)
if(custom_file_exists(p228_vmodel))
precache_model(p228_vmodel)
get_cvar_string("p228_pmodel", p228_pmodel, SIZE-1)
if(custom_file_exists(p228_pmodel))
precache_model(p228_pmodel)
get_cvar_string("p228_wmodel", p228_wmodel, SIZE-1)
if(custom_file_exists(p228_wmodel))
precache_model(p228_wmodel)
get_cvar_string("scout_vmodel", scout_vmodel, SIZE-1)
if(custom_file_exists(scout_vmodel))
precache_model(scout_vmodel)
get_cvar_string("scout_pmodel", scout_pmodel, SIZE-1)
if(custom_file_exists(scout_pmodel))
precache_model(scout_pmodel)
get_cvar_string("scout_wmodel", scout_wmodel, SIZE-1)
if(custom_file_exists(scout_wmodel))
precache_model(scout_wmodel)
get_cvar_string("hegrenade_vmodel", hegrenade_vmodel, SIZE-1)
if(custom_file_exists(hegrenade_vmodel))
precache_model(hegrenade_vmodel)
get_cvar_string("hegrenade_pmodel", hegrenade_pmodel, SIZE-1)
if(custom_file_exists(hegrenade_pmodel))
precache_model(hegrenade_pmodel)
get_cvar_string("hegrenade_wmodel", hegrenade_wmodel, SIZE-1)
if(custom_file_exists(hegrenade_wmodel))
precache_model(hegrenade_wmodel)
get_cvar_string("xm1014_vmodel", xm1014_vmodel, SIZE-1)
if(custom_file_exists(xm1014_vmodel))
precache_model(xm1014_vmodel)
get_cvar_string("xm1014_pmodel", xm1014_pmodel, SIZE-1)
if(custom_file_exists(xm1014_pmodel))
precache_model(xm1014_pmodel)
get_cvar_string("xm1014_wmodel", xm1014_wmodel, SIZE-1)
if(custom_file_exists(xm1014_wmodel))
precache_model(xm1014_wmodel)
get_cvar_string("c4_vmodel", c4_vmodel, SIZE-1)
if(custom_file_exists(c4_vmodel))
precache_model(c4_vmodel)
get_cvar_string("c4_pmodel", c4_pmodel, SIZE-1)
if(custom_file_exists(c4_pmodel))
precache_model(c4_pmodel)
get_cvar_string("c4_wmodel", c4_wmodel, SIZE-1)
if(custom_file_exists(c4_wmodel))
precache_model(c4_wmodel)
get_cvar_string("mac10_vmodel", mac10_vmodel, SIZE-1)
if(custom_file_exists(mac10_vmodel))
precache_model(mac10_vmodel)
get_cvar_string("mac10_pmodel", mac10_pmodel, SIZE-1)
if(custom_file_exists(mac10_pmodel))
precache_model(mac10_pmodel)
get_cvar_string("mac10_wmodel", mac10_wmodel, SIZE-1)
if(custom_file_exists(mac10_wmodel))
precache_model(mac10_wmodel)
get_cvar_string("aug_vmodel", aug_vmodel, SIZE-1)
if(custom_file_exists(aug_vmodel))
precache_model(aug_vmodel)
get_cvar_string("aug_pmodel", aug_pmodel, SIZE-1)
if(custom_file_exists(aug_pmodel))
precache_model(aug_pmodel)
get_cvar_string("aug_wmodel", aug_wmodel, SIZE-1)
if(custom_file_exists(aug_wmodel))
precache_model(aug_wmodel)
get_cvar_string("smokegrenade_vmodel", smokegrenade_vmodel, SIZE-1)
if(custom_file_exists(smokegrenade_vmodel))
precache_model(smokegrenade_vmodel)
get_cvar_string("smokegrenade_pmodel", smokegrenade_pmodel, SIZE-1)
if(custom_file_exists(smokegrenade_pmodel))
precache_model(smokegrenade_pmodel)
get_cvar_string("smokegrenade_wmodel", smokegrenade_wmodel, SIZE-1)
if(custom_file_exists(smokegrenade_wmodel))
precache_model(smokegrenade_wmodel)
get_cvar_string("elite_vmodel", elite_vmodel, SIZE-1)
if(custom_file_exists(elite_vmodel))
precache_model(elite_vmodel)
get_cvar_string("elite_pmodel", elite_pmodel, SIZE-1)
if(custom_file_exists(elite_pmodel))
precache_model(elite_pmodel)
get_cvar_string("elite_wmodel", elite_wmodel, SIZE-1)
if(custom_file_exists(elite_wmodel))
precache_model(elite_wmodel)
get_cvar_string("fiveseven_vmodel", fiveseven_vmodel, SIZE-1)
if(custom_file_exists(fiveseven_vmodel))
precache_model(fiveseven_vmodel)
get_cvar_string("fiveseven_pmodel", fiveseven_pmodel, SIZE-1)
if(custom_file_exists(fiveseven_pmodel))
precache_model(fiveseven_pmodel)
get_cvar_string("fiveseven_wmodel", fiveseven_wmodel, SIZE-1)
if(custom_file_exists(fiveseven_wmodel))
precache_model(fiveseven_wmodel)
get_cvar_string("ump45_vmodel", ump45_vmodel, SIZE-1)
if(custom_file_exists(ump45_vmodel))
precache_model(ump45_vmodel)
get_cvar_string("ump45_pmodel", ump45_pmodel, SIZE-1)
if(custom_file_exists(ump45_pmodel))
precache_model(ump45_pmodel)
get_cvar_string("ump45_wmodel", ump45_wmodel, SIZE-1)
if(custom_file_exists(ump45_wmodel))
precache_model(ump45_wmodel)
get_cvar_string("sg550_vmodel", sg550_vmodel, SIZE-1)
if(custom_file_exists(sg550_vmodel))
precache_model(sg550_vmodel)
get_cvar_string("sg550_pmodel", sg550_pmodel, SIZE-1)
if(custom_file_exists(sg550_pmodel))
precache_model(sg550_pmodel)
get_cvar_string("sg550_wmodel", sg550_wmodel, SIZE-1)
if(custom_file_exists(sg550_wmodel))
precache_model(sg550_wmodel)
get_cvar_string("galil_vmodel", galil_vmodel, SIZE-1)
if(custom_file_exists(galil_vmodel))
precache_model(galil_vmodel)
get_cvar_string("galil_pmodel", galil_pmodel, SIZE-1)
if(custom_file_exists(galil_pmodel))
precache_model(galil_pmodel)
get_cvar_string("galil_wmodel", galil_wmodel, SIZE-1)
if(custom_file_exists(galil_wmodel))
precache_model(galil_wmodel)
get_cvar_string("famas_vmodel", famas_vmodel, SIZE-1)
if(custom_file_exists(famas_vmodel))
precache_model(famas_vmodel)
get_cvar_string("famas_pmodel", famas_pmodel, SIZE-1)
if(custom_file_exists(famas_pmodel))
precache_model(famas_pmodel)
get_cvar_string("famas_wmodel", famas_wmodel, SIZE-1)
if(custom_file_exists(famas_wmodel))
precache_model(famas_wmodel)
get_cvar_string("usp_vmodel", usp_vmodel, SIZE-1)
if(custom_file_exists(usp_vmodel))
precache_model(usp_vmodel)
get_cvar_string("usp_pmodel", usp_pmodel, SIZE-1)
if(custom_file_exists(usp_pmodel))
precache_model(usp_pmodel)
get_cvar_string("usp_wmodel", usp_wmodel, SIZE-1)
if(custom_file_exists(usp_wmodel))
precache_model(usp_wmodel)
get_cvar_string("glock18_vmodel", glock18_vmodel, SIZE-1)
if(custom_file_exists(glock18_vmodel))
precache_model(glock18_vmodel)
get_cvar_string("glock18_pmodel", glock18_pmodel, SIZE-1)
if(custom_file_exists(glock18_pmodel))
precache_model(glock18_pmodel)
get_cvar_string("glock18_wmodel", glock18_wmodel, SIZE-1)
if(custom_file_exists(glock18_wmodel))
precache_model(glock18_wmodel)
get_cvar_string("awp_vmodel", awp_vmodel, SIZE-1)
if(custom_file_exists(awp_vmodel))
precache_model(awp_vmodel)
get_cvar_string("awp_pmodel", awp_pmodel, SIZE-1)
if(custom_file_exists(awp_pmodel))
precache_model(awp_pmodel)
get_cvar_string("awp_wmodel", awp_wmodel, SIZE-1)
if(custom_file_exists(awp_wmodel))
precache_model(awp_wmodel)
get_cvar_string("mp5navy_vmodel", mp5navy_vmodel, SIZE-1)
if(custom_file_exists(mp5navy_vmodel))
precache_model(mp5navy_vmodel)
get_cvar_string("mp5navy_pmodel", mp5navy_pmodel, SIZE-1)
if(custom_file_exists(mp5navy_pmodel))
precache_model(mp5navy_pmodel)
get_cvar_string("mp5navy_wmodel", mp5navy_wmodel, SIZE-1)
if(custom_file_exists(mp5navy_wmodel))
precache_model(mp5navy_wmodel)
get_cvar_string("m249_vmodel", m249_vmodel, SIZE-1)
if(custom_file_exists(m249_vmodel))
precache_model(m249_vmodel)
get_cvar_string("m249_pmodel", m249_pmodel, SIZE-1)
if(custom_file_exists(m249_pmodel))
precache_model(m249_pmodel)
get_cvar_string("m249_wmodel", m249_wmodel, SIZE-1)
if(custom_file_exists(m249_wmodel))
precache_model(m249_wmodel)
get_cvar_string("m3_vmodel", m3_vmodel, SIZE-1)
if(custom_file_exists(m3_vmodel))
precache_model(m3_vmodel)
get_cvar_string("m3_pmodel", m3_pmodel, SIZE-1)
if(custom_file_exists(m3_pmodel))
precache_model(m3_pmodel)
get_cvar_string("m3_wmodel", m3_wmodel, SIZE-1)
if(custom_file_exists(m3_wmodel))
precache_model(m3_wmodel)
get_cvar_string("m4a1_vmodel", m4a1_vmodel, SIZE-1)
if(custom_file_exists(m4a1_vmodel))
precache_model(m4a1_vmodel)
get_cvar_string("m4a1_pmodel", m4a1_pmodel, SIZE-1)
if(custom_file_exists(m4a1_pmodel))
precache_model(m4a1_pmodel)
get_cvar_string("m4a1_wmodel", m4a1_wmodel, SIZE-1)
if(custom_file_exists(m4a1_wmodel))
precache_model(m4a1_wmodel)
get_cvar_string("tmp_vmodel", tmp_vmodel, SIZE-1)
if(custom_file_exists(tmp_vmodel))
precache_model(tmp_vmodel)
get_cvar_string("tmp_pmodel", tmp_pmodel, SIZE-1)
if(custom_file_exists(tmp_pmodel))
precache_model(tmp_pmodel)
get_cvar_string("tmp_wmodel", tmp_wmodel, SIZE-1)
if(custom_file_exists(tmp_wmodel))
precache_model(tmp_wmodel)
get_cvar_string("g3sg1_vmodel", g3sg1_vmodel, SIZE-1)
if(custom_file_exists(g3sg1_vmodel))
precache_model(g3sg1_vmodel)
get_cvar_string("g3sg1_pmodel", g3sg1_pmodel, SIZE-1)
if(custom_file_exists(g3sg1_pmodel))
precache_model(g3sg1_pmodel)
get_cvar_string("g3sg1_wmodel", g3sg1_wmodel, SIZE-1)
if(custom_file_exists(g3sg1_wmodel))
precache_model(g3sg1_wmodel)
get_cvar_string("flashbang_vmodel", flashbang_vmodel, SIZE-1)
if(custom_file_exists(flashbang_vmodel))
precache_model(flashbang_vmodel)
get_cvar_string("flashbang_pmodel", flashbang_pmodel, SIZE-1)
if(custom_file_exists(flashbang_pmodel))
precache_model(flashbang_pmodel)
get_cvar_string("flashbang_wmodel", flashbang_wmodel, SIZE-1)
if(custom_file_exists(flashbang_wmodel))
precache_model(flashbang_wmodel)
get_cvar_string("deagle_vmodel", deagle_vmodel, SIZE-1)
if(custom_file_exists(deagle_vmodel))
precache_model(deagle_vmodel)
get_cvar_string("deagle_pmodel", deagle_pmodel, SIZE-1)
if(custom_file_exists(deagle_pmodel))
precache_model(deagle_pmodel)
get_cvar_string("deagle_wmodel", deagle_wmodel, SIZE-1)
if(custom_file_exists(deagle_wmodel))
precache_model(deagle_wmodel)
get_cvar_string("sg552_vmodel", sg552_vmodel, SIZE-1)
if(custom_file_exists(sg552_vmodel))
precache_model(sg552_vmodel)
get_cvar_string("sg552_pmodel", sg552_pmodel, SIZE-1)
if(custom_file_exists(sg552_pmodel))
precache_model(sg552_pmodel)
get_cvar_string("sg552_wmodel", sg552_wmodel, SIZE-1)
if(custom_file_exists(sg552_wmodel))
precache_model(sg552_wmodel)
get_cvar_string("ak47_vmodel", ak47_vmodel, SIZE-1)
if(custom_file_exists(ak47_vmodel))
precache_model(ak47_vmodel)
get_cvar_string("ak47_pmodel", ak47_pmodel, SIZE-1)
if(custom_file_exists(ak47_pmodel))
precache_model(ak47_pmodel)
get_cvar_string("ak47_wmodel", ak47_wmodel, SIZE-1)
if(custom_file_exists(ak47_wmodel))
precache_model(ak47_wmodel)
get_cvar_string("knife_vmodel", knife_vmodel, SIZE-1)
if(custom_file_exists(knife_vmodel))
precache_model(knife_vmodel)
get_cvar_string("knife_pmodel", knife_pmodel, SIZE-1)
if(custom_file_exists(knife_pmodel))
precache_model(knife_pmodel)
get_cvar_string("p90_vmodel", p90_vmodel, SIZE-1)
if(custom_file_exists(p90_vmodel))
precache_model(p90_vmodel)
get_cvar_string("p90_pmodel", p90_pmodel, SIZE-1)
if(custom_file_exists(p90_pmodel))
precache_model(p90_pmodel)
get_cvar_string("p90_wmodel", p90_wmodel, SIZE-1)
if(custom_file_exists(p90_wmodel))
precache_model(p90_wmodel)
get_cvar_string("bomb_wmodel", bomb_wmodel, SIZE-1)
if(custom_file_exists(bomb_wmodel))
precache_model(bomb_wmodel)
get_cvar_string("knife_deploy_sound", knife_deploy_soundfile, SIZE-1)
if(custom_file_exists(knife_deploy_soundfile))
{
copy(knife_deploy_sound, SIZE-1, knife_deploy_soundfile)
replace(knife_deploy_sound, SIZE-1, "sound/", "")
precache_sound(knife_deploy_sound)
}
get_cvar_string("knife_slash_sound", knife_slash_soundfile, SIZE-1)
if(custom_file_exists(knife_slash_soundfile))
{
copy(knife_slash_sound, SIZE-1, knife_slash_soundfile)
replace(knife_slash_sound, SIZE-1, "sound/", "")
precache_sound(knife_slash_sound)
}
get_cvar_string("knife_stab_sound", knife_stab_soundfile, SIZE-1)
if(custom_file_exists(knife_stab_soundfile))
{
copy(knife_stab_sound, SIZE-1, knife_stab_soundfile)
replace(knife_stab_sound, SIZE-1, "sound/", "")
precache_sound(knife_stab_sound)
}
get_cvar_string("knife_hit_sound", knife_hit_soundfile, SIZE-1)
if(custom_file_exists(knife_hit_soundfile))
{
copy(knife_hit_sound, SIZE-1, knife_hit_soundfile)
replace(knife_hit_sound, SIZE-1, "sound/", "")
precache_sound(knife_hit_sound)
}
get_cvar_string("knife_hitwall_sound", knife_hitwall_soundfile, SIZE-1)
if(custom_file_exists(knife_hitwall_soundfile))
{
copy(knife_hitwall_sound, SIZE-1, knife_hitwall_soundfile)
replace(knife_hitwall_sound, SIZE-1, "sound/", "")
precache_sound(knife_hitwall_sound)
}
}
public check_model(id)
{
if(get_cvar_num("weapons_models") == 0)
{
return PLUGIN_CONTINUE
}
if(!is_user_alive(id))
{
return PLUGIN_CONTINUE
}
switch(read_data(2))
{
case 1:
{
if(custom_file_exists(p228_vmodel))
entity_set_string(id, EV_SZ_viewmodel, p228_vmodel)
if(custom_file_exists(p228_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, p228_pmodel)
}
case 3:
{
if(custom_file_exists(scout_vmodel))
entity_set_string(id, EV_SZ_viewmodel, scout_vmodel)
if(custom_file_exists(scout_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, scout_pmodel)
}
case 4:
{
if(custom_file_exists(hegrenade_vmodel))
entity_set_string(id, EV_SZ_viewmodel, hegrenade_vmodel)
if(custom_file_exists(hegrenade_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, hegrenade_pmodel)
}
case 5:
{
if(custom_file_exists(xm1014_vmodel))
entity_set_string(id, EV_SZ_viewmodel, xm1014_vmodel)
if(custom_file_exists(xm1014_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, xm1014_pmodel)
}
case 6:
{
if(custom_file_exists(c4_vmodel))
entity_set_string(id, EV_SZ_viewmodel, c4_vmodel)
if(custom_file_exists(c4_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, c4_pmodel)
}
case 7:
{
if(custom_file_exists(mac10_vmodel))
entity_set_string(id, EV_SZ_viewmodel, mac10_vmodel)
if(custom_file_exists(mac10_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, mac10_pmodel)
}
case 8:
{
if(custom_file_exists(aug_vmodel))
entity_set_string(id, EV_SZ_viewmodel, aug_vmodel)
if(custom_file_exists(aug_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, aug_pmodel)
}
case 9:
{
if(custom_file_exists(smokegrenade_vmodel))
entity_set_string(id, EV_SZ_viewmodel, smokegrenade_vmodel)
if(custom_file_exists(smokegrenade_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, smokegrenade_pmodel)
}
case 10:
{
if(custom_file_exists(elite_vmodel))
entity_set_string(id, EV_SZ_viewmodel, elite_vmodel)
if(custom_file_exists(elite_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, elite_pmodel)
}
case 11:
{
if(custom_file_exists(fiveseven_vmodel))
entity_set_string(id, EV_SZ_viewmodel, fiveseven_vmodel)
if(custom_file_exists(fiveseven_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, fiveseven_pmodel)
}
case 12:
{
if(custom_file_exists(ump45_vmodel))
entity_set_string(id, EV_SZ_viewmodel, ump45_vmodel)
if(custom_file_exists(ump45_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, ump45_pmodel)
}
case 13:
{
if(custom_file_exists(sg550_vmodel))
entity_set_string(id, EV_SZ_viewmodel, sg550_vmodel)
if(custom_file_exists(sg550_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, sg550_pmodel)
}
case 14:
{
if(custom_file_exists(galil_vmodel))
entity_set_string(id, EV_SZ_viewmodel, galil_vmodel)
if(custom_file_exists(galil_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, galil_pmodel)
}
case 15:
{
if(custom_file_exists(famas_vmodel))
entity_set_string(id, EV_SZ_viewmodel, famas_vmodel)
if(custom_file_exists(famas_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, famas_pmodel)
}
case 16:
{
if(custom_file_exists(usp_vmodel))
entity_set_string(id, EV_SZ_viewmodel, usp_vmodel)
if(custom_file_exists(usp_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, usp_pmodel)
}
case 17:
{
if(custom_file_exists(glock18_vmodel))
entity_set_string(id, EV_SZ_viewmodel, glock18_vmodel)
if(custom_file_exists(glock18_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, glock18_pmodel)
}
case 18:
{
if(custom_file_exists(awp_vmodel))
entity_set_string(id, EV_SZ_viewmodel, awp_vmodel)
if(custom_file_exists(awp_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, awp_pmodel)
}
case 19:
{
if(custom_file_exists(mp5navy_vmodel))
entity_set_string(id, EV_SZ_viewmodel, mp5navy_vmodel)
if(custom_file_exists(mp5navy_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, mp5navy_pmodel)
}
case 20:
{
if(custom_file_exists(m249_vmodel))
entity_set_string(id, EV_SZ_viewmodel, m249_vmodel)
if(custom_file_exists(m249_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, m249_pmodel)
}
case 21:
{
if(custom_file_exists(m3_vmodel))
entity_set_string(id, EV_SZ_viewmodel, m3_vmodel)
if(custom_file_exists(m3_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, m3_pmodel)
}
case 22:
{
if(custom_file_exists(m4a1_vmodel))
entity_set_string(id, EV_SZ_viewmodel, m4a1_vmodel)
if(custom_file_exists(m4a1_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, m4a1_pmodel)
}
case 23:
{
if(custom_file_exists(tmp_vmodel))
entity_set_string(id, EV_SZ_viewmodel, tmp_vmodel)
if(custom_file_exists(tmp_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, tmp_pmodel)
}
case 24:
{
if(custom_file_exists(g3sg1_vmodel))
entity_set_string(id, EV_SZ_viewmodel, g3sg1_vmodel)
if(custom_file_exists(g3sg1_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, g3sg1_pmodel)
}
case 25:
{
if(custom_file_exists(flashbang_vmodel))
entity_set_string(id, EV_SZ_viewmodel, flashbang_vmodel)
if(custom_file_exists(flashbang_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, flashbang_pmodel)
}
case 26:
{
if(custom_file_exists(deagle_vmodel))
entity_set_string(id, EV_SZ_viewmodel, deagle_vmodel)
if(custom_file_exists(deagle_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, deagle_pmodel)
}
case 27:
{
if(custom_file_exists(sg552_vmodel))
entity_set_string(id, EV_SZ_viewmodel, sg552_vmodel)
if(custom_file_exists(sg552_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, sg552_pmodel)
}
case 28:
{
if(custom_file_exists(ak47_vmodel))
entity_set_string(id, EV_SZ_viewmodel, ak47_vmodel)
if(custom_file_exists(ak47_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, ak47_pmodel)
}
case 29:
{
if(custom_file_exists(knife_vmodel))
entity_set_string(id, EV_SZ_viewmodel, knife_vmodel)
if(custom_file_exists(knife_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, knife_pmodel)
}
case 30:
{
if(custom_file_exists(p90_vmodel))
entity_set_string(id, EV_SZ_viewmodel, p90_vmodel)
if(custom_file_exists(p90_pmodel))
entity_set_string(id, EV_SZ_weaponmodel, p90_pmodel)
}
}
return PLUGIN_CONTINUE
}
public set_model(entity, const model[])
{
if(get_cvar_num("weapons_models") == 0)
{
return PLUGIN_CONTINUE
}
if(equal(model, "models/w_p228.mdl"))
{
if(custom_file_exists(p228_wmodel))
{
entity_set_model(entity, p228_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_scout.mdl"))
{
if(custom_file_exists(scout_wmodel))
{
entity_set_model(entity, scout_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_hegrenade.mdl"))
{
if(custom_file_exists(hegrenade_wmodel))
{
entity_set_model(entity, hegrenade_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_xm1014.mdl"))
{
if(custom_file_exists(xm1014_wmodel))
{
entity_set_model(entity, xm1014_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_backpack.mdl"))
{
if(custom_file_exists(c4_wmodel))
{
entity_set_model(entity, c4_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_mac10.mdl"))
{
if(custom_file_exists(mac10_wmodel))
{
entity_set_model(entity, mac10_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_aug.mdl"))
{
if(custom_file_exists(aug_wmodel))
{
entity_set_model(entity, aug_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_smokegrenade.mdl"))
{
if(custom_file_exists(smokegrenade_wmodel))
{
entity_set_model(entity, smokegrenade_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_elite.mdl"))
{
if(custom_file_exists(elite_wmodel))
{
entity_set_model(entity, elite_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_fiveseven.mdl"))
{
if(custom_file_exists(fiveseven_wmodel))
{
entity_set_model(entity, fiveseven_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_ump45.mdl"))
{
if(custom_file_exists(ump45_wmodel))
{
entity_set_model(entity, ump45_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_sg550.mdl"))
{
if(custom_file_exists(sg550_wmodel))
{
entity_set_model(entity, sg550_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_galil.mdl"))
{
if(custom_file_exists(galil_wmodel))
{
entity_set_model(entity, galil_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_famas.mdl"))
{
if(custom_file_exists(famas_wmodel))
{
entity_set_model(entity, famas_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_usp.mdl"))
{
if(custom_file_exists(usp_wmodel))
{
entity_set_model(entity, usp_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_glock18.mdl"))
{
if(custom_file_exists(glock18_wmodel))
{
entity_set_model(entity, glock18_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_awp.mdl"))
{
if(custom_file_exists(awp_wmodel))
{
entity_set_model(entity, awp_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_mp5.mdl"))
{
if(custom_file_exists(mp5navy_wmodel))
{
entity_set_model(entity, mp5navy_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_m249.mdl"))
{
if(custom_file_exists(m249_wmodel))
{
entity_set_model(entity, m249_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_m3.mdl"))
{
if(custom_file_exists(m3_wmodel))
{
entity_set_model(entity, m3_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_m4a1.mdl"))
{
if(custom_file_exists(m4a1_wmodel))
{
entity_set_model(entity, m4a1_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_tmp.mdl"))
{
if(custom_file_exists(tmp_wmodel))
{
entity_set_model(entity, tmp_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_g3sg1.mdl"))
{
if(custom_file_exists(g3sg1_wmodel))
{
entity_set_model(entity, g3sg1_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_flashbang.mdl"))
{
if(custom_file_exists(flashbang_wmodel))
{
entity_set_model(entity, flashbang_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_deagle.mdl"))
{
if(custom_file_exists(deagle_wmodel))
{
entity_set_model(entity, deagle_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_sg552.mdl"))
{
if(custom_file_exists(sg552_wmodel))
{
entity_set_model(entity, sg552_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_ak47.mdl"))
{
if(custom_file_exists(ak47_wmodel))
{
entity_set_model(entity, ak47_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_p90.mdl"))
{
if(custom_file_exists(p90_wmodel))
{
entity_set_model(entity, p90_wmodel)
return PLUGIN_HANDLED
}
}
if(equal(model, "models/w_c4.mdl"))
{
if(custom_file_exists(bomb_wmodel))
{
entity_set_model(entity, bomb_wmodel)
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
public emitsound(entity, const sample[])
{
if(get_cvar_num("weapons_models") == 0)
{
return PLUGIN_CONTINUE
}
if(equal(sample, "common/wpn_denyselect.wav"))
{
return PLUGIN_HANDLED
}
if(sample[0] == 'w' && sample[1] == 'e' && sample[8] == 'k' && sample[9] == 'n') //weapon_knife
{
if(sample[14] == 'd') //deploy
{
if(custom_file_exists(knife_deploy_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_deploy_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
switch(sample[15])
{
case 'l': //slash
{
if(custom_file_exists(knife_slash_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_slash_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
case 't': //stab
{
if(custom_file_exists(knife_stab_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_stab_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
}
switch(sample[17])
{
case '1': //hit1
{
if(custom_file_exists(knife_hit_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_hit_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
case '2': //hit2
{
if(custom_file_exists(knife_hit_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_hit_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
case '3': //hit3
{
if(custom_file_exists(knife_hit_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_hit_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
case '4': //hit4
{
if(custom_file_exists(knife_hit_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_hit_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
case 'w': //hitwall
{
if(custom_file_exists(knife_hitwall_soundfile))
{
emit_sound(entity, CHAN_WEAPON, knife_hitwall_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
}
}
return PLUGIN_CONTINUE
}
Its so weird. i have tried and tried and cant get it to work