AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get the index of model (https://forums.alliedmods.net/showthread.php?t=62869)

NTST 11-06-2007 08:46

Get the index of model
 
I want to get the index of weapon model(knife, pistol, smg ...). Anyone help me? Thank!

VEN 11-06-2007 13:18

Re: Get the index of model
 
Decals/Models Lister v0.2 - just review plugin's source code...

NTST 11-06-2007 22:56

Re: Get the index of model
 
Thank you. But I want to get the index like function "find_ent_by_class".

M249-M4A1 11-07-2007 00:37

Re: Get the index of model
 
Then you are looking for an entity ID, not a model

Refer to this plugin for clues
http://forums.alliedmods.net/showthread.php?p=459754

Usage:
http://www.amxmodx.org/funcwiki.php?...lass&go=search

[ --<-@ ] Black Rose 11-07-2007 14:17

Re: Get the index of model
 
index = id

Wilson [29th ID] 11-07-2007 17:58

Re: Get the index of model
 
Erm. Finding index by model. Using a function "like find_ent_by_class"...

...how about find_ent_by_model

NTST 11-07-2007 21:25

Re: Get the index of model
 
find_ent_by_class ( StartEntity, Classname[] )
find_ent_by_model ( StartEntity, Classname[], Model[] )
What is Classname[] and Model[]?
Please show me a tutorial. Thanks!

[ --<-@ ] Black Rose 11-07-2007 22:52

Re: Get the index of model
 
We can't help you with anything unless you tell us how you are going to use it.

NTST 11-08-2007 02:46

Re: Get the index of model
 
1 Attachment(s)
Please view this image(attachment).

Wilson [29th ID] 11-08-2007 09:21

Re: Get the index of model
 
Code:
stock detect_weapon_id( id ) {     new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];         // Get User Weapon and WpnName     new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);     get_weaponname( m_iWpn, m_szWpn, 31 );     // Get User Origin     new Float:m_flOrigin[3];     pev( id, pev_origin, m_flOrigin );         // Find Weapon     while( ( m_iCurEnt = engfunc( EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0 ) ) != 0 ) {         new m_szClassname[32];         pev( m_iCurEnt, pev_classname, m_szClassname, 31 );             if( equal( m_szClassname, m_szWpn ) )             m_iWpnEnt = m_iCurEnt;     }     return m_iWpnEnt; }


All times are GMT -4. The time now is 01:24.

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