Raised This Month: $ Target: $400
 0% 

Getting weapon classname.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-06-2009 , 21:47   Re: Classname.
Reply With Quote #14

Quote:
Originally Posted by Dores View Post
Quote:
Originally Posted by hleV View Post
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];
peviEnt pev_model szEntModel 31 );

if ( 
equaliszEntModel WEAPONCONST[PlayerLevel[id]] ) )
{
    return 
FMRES_SUPERCEDE;

__________________

Last edited by Bugsy; 04-06-2009 at 22:03.
Bugsy is offline
 



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 02:25.


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