Quote:
Originally Posted by Dores
Quote:
Originally Posted by hleV
Class name will return "weaponbox". You should check the model.
Code:
new szMdl[32];
pev(iEnt, pev_model, szMdl, 31);
if (equal(szMdl, "models/w_glock18.mdl"))
// Your stuff
|
If the weapon is being used, it will return the specific weapon's classname(weapon_*).
|
hlev is correct, weaponbox is the classname so use the model name in your touch event. This should return the actual type of weapon; I edited the WEAPONCONST array for you.
PHP Code:
new const WEAPONCONST[MAXLEVEL][] = {"models/w_glock18.mdl", "models/w_usp.mdl", "models/w_p228", "models/w_fiveseven.mdl", "models/w_deagle", "models/w_elite.mdl", "models/w_tmp.mdl",
"models/w_mac10.mdl", "models/w_ump45.mdl", "models/w_mp5navy.mdl", "models/w_p90.mdl", "models/w_scout.mdl", "models/w_awp.mdl", "models/w_famas.mdl", "models/w_galil.mdl", "models/w_m3.mdl", "models/w_xm1014.mdl",
"models/w_ak47.mdl", "models/w_m4a1.mdl", "models/w_aug.mdl", "models/w_sg552.mdl", "models/w_sg550.mdl", "models/w_g3sg1.mdl", "models/w_m249.mdl"
}; // Give Weapons
static szEntModel[32];
pev( iEnt , pev_model , szEntModel , 31 );
if ( equali( szEntModel , WEAPONCONST[PlayerLevel[id]] ) )
{
return FMRES_SUPERCEDE;
}
__________________