if(self.tag_entity)
{
// the best part is: IT EXISTS
- if(substring(self.model, 0, 17) == "models/weapons/v_")
+ if(substring(self.model, 0, 14) == "models/weapons")
{
- if(substring(self.tag_entity.model, 0, 17) == "models/weapons/h_")
+ if(substring(self.tag_entity.model, 0, 14) == "models/weapons")
{
self.tag_index = gettagindex(self.tag_entity, "weapon");
if(!self.tag_index)
}
}
- if(substring(self.tag_entity.model, 0, 17) == "models/weapons/v_")
+ if(substring(self.tag_entity.model, 0, 14) == "models/weapons")
{
self.tag_index = gettagindex(self.tag_entity, "shot");
if(!self.tag_index)
this.bot_pickupbasevalue = pickupbasevalue;
this.wpcolor = clr;
this.mdl = modelname;
+ #ifdef SVQC
+ this.model = strzone(W_Model(strcat("g_", modelname, ".md3")));
+ #elif defined(CSQC)
this.model = strzone(strcat("models/weapons/g_", modelname, ".md3"));
+ #endif
this.w_simplemdl = strzone(simplemdl); // simpleitems weapon model/image
this.w_crosshair = strzone(car(crosshair));
string s = cdr(crosshair);
}
else if(req == WR_INIT)
{
- precache_model("models/weapons/g_porto.md3");
- precache_model("models/weapons/v_porto.md3");
- precache_model("models/weapons/h_porto.iqm");
+ precache_model(W_Model("g_porto.md3"));
+ precache_model(W_Model("v_porto.md3"));
+ precache_model(W_Model("h_porto.iqm"));
precache_model("models/elaser.mdl");
precache_sound("nexball/shoot1.wav");
precache_sound("nexball/shoot2.wav");
offset = '0 0 0';
setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
- //setmodel(_nade, "models/weapons/v_ok_grenade.md3");
+ //setmodel(_nade, W_Model("v_ok_grenade.md3"));
//setattachment(_nade, world, "");
PROJECTILE_MAKETRIGGER(_nade);
setsize(_nade, '-16 -16 -16', '16 16 16');
n.nade_type = bound(1, n.nade_type, NADES_COUNT);
- setmodel(n, "models/weapons/v_ok_grenade.md3");
+ setmodel(n, W_Model("v_ok_grenade.md3"));
//setattachment(n, self, "bip01 l hand");
n.exteriormodeltoclient = self;
n.customizeentityforclient = nade_customize;
n.nextthink = max(n.wait - 3, time);
n.projectiledeathtype = DEATH_NADE;
- setmodel(fn, "models/weapons/h_ok_grenade.iqm");
+ setmodel(fn, W_Model("h_ok_grenade.iqm"));
setattachment(fn, self.weaponentity, "");
fn.realowner = fn.owner = self;
fn.colormod = NADES[n.nade_type].m_color;
addstat(STAT_HEALING_ORB_ALPHA, AS_FLOAT, stat_healing_orb_alpha);
precache_model("models/ok_nade_counter/ok_nade_counter.md3");
- precache_model("models/weapons/h_ok_grenade.iqm");
- precache_model("models/weapons/v_ok_grenade.md3");
+ precache_model(W_Model("h_ok_grenade.iqm"));
+ precache_model(W_Model("v_ok_grenade.md3"));
precache_model("models/ctf/shield.md3");
precache_sound(W_Sound("rocket_impact"));
{
entity wep = spawn();
setorigin(wep, self.origin);
- setmodel(wep, "models/weapons/g_ok_hmg.md3");
+ setmodel(wep, W_Model("g_ok_hmg.md3"));
wep.classname = "weapon_hmg";
wep.ok_item = true;
wep.noalign = self.noalign;
{
entity wep = spawn();
setorigin(wep, self.origin);
- setmodel(wep, "models/weapons/g_ok_rl.md3");
+ setmodel(wep, W_Model("g_ok_rl.md3"));
wep.classname = "weapon_rpc";
wep.ok_item = true;
wep.noalign = self.noalign;
precache_all_playermodels("models/ok_player/*.dpm");
- precache_model("models/weapons/h_ok_mg.iqm");
- precache_model("models/weapons/v_ok_mg.md3");
- precache_model("models/weapons/g_ok_mg.md3");
+ precache_model(W_Model("h_ok_mg.iqm"));
+ precache_model(W_Model("v_ok_mg.md3"));
+ precache_model(W_Model("g_ok_mg.md3"));
- precache_model("models/weapons/h_ok_shotgun.iqm");
- precache_model("models/weapons/v_ok_shotgun.md3");
- precache_model("models/weapons/g_ok_shotgun.md3");
+ precache_model(W_Model("h_ok_shotgun.iqm"));
+ precache_model(W_Model("v_ok_shotgun.md3"));
+ precache_model(W_Model("g_ok_shotgun.md3"));
- precache_model("models/weapons/h_ok_sniper.iqm");
- precache_model("models/weapons/v_ok_sniper.md3");
- precache_model("models/weapons/g_ok_sniper.md3");
+ precache_model(W_Model("h_ok_sniper.iqm"));
+ precache_model(W_Model("v_ok_sniper.md3"));
+ precache_model(W_Model("g_ok_sniper.md3"));
precache_sound(W_Sound("dryfire"));
// if there is a child entity, hide it until we're sure we use it
if (self.weaponentity)
self.weaponentity.model = "";
- setmodel(self, strcat("models/weapons/v_", name, ".md3")); // precision set below
+ setmodel(self, W_Model(strcat("v_", name, ".md3")));
v_shot_idx = gettagindex(self, "shot"); // used later
if(!v_shot_idx)
v_shot_idx = gettagindex(self, "tag_shot");
- setmodel(self, strcat("models/weapons/h_", name, ".iqm")); // precision set below
+ setmodel(self, W_Model(strcat("h_", name, ".iqm")));
// preset some defaults that work great for renamed zym files (which don't need an animinfo)
self.anim_fire1 = animfixfps(self, '0 1 0.01', '0 0 0');
self.anim_fire2 = animfixfps(self, '1 1 0.01', '0 0 0');
{
if (!self.weaponentity)
self.weaponentity = spawn();
- setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
+ setmodel(self.weaponentity, W_Model(strcat("v_", name, ".md3")));
setattachment(self.weaponentity, self, "weapon");
}
else if(gettagindex(self, "tag_weapon"))
{
if (!self.weaponentity)
self.weaponentity = spawn();
- setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
+ setmodel(self.weaponentity, W_Model(strcat("v_", name, ".md3")));
setattachment(self.weaponentity, self, "tag_weapon");
}
else
self.dmg = self.owner.modelindex;
self.deadflag = self.owner.deadflag;
if (self.owner.weaponname != "")
- setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3")); // precision set below
+ setmodel(self, W_Model(strcat("v_", self.owner.weaponname, ".md3")));
else
self.model = "";