Raised This Month: $ Target: $400
 0% 

Get the index of model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NTST
Junior Member
Join Date: Oct 2007
Old 11-06-2007 , 08:46   Get the index of model
Reply With Quote #1

I want to get the index of weapon model(knife, pistol, smg ...). Anyone help me? Thank!
NTST is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-06-2007 , 13:18   Re: Get the index of model
Reply With Quote #2

Decals/Models Lister v0.2 - just review plugin's source code...
VEN is offline
NTST
Junior Member
Join Date: Oct 2007
Old 11-06-2007 , 22:56   Re: Get the index of model
Reply With Quote #3

Thank you. But I want to get the index like function "find_ent_by_class".
NTST is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 11-07-2007 , 00:37   Re: Get the index of model
Reply With Quote #4

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
__________________
M249-M4A1 is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-07-2007 , 14:17   Re: Get the index of model
Reply With Quote #5

index = id
[ --<-@ ] Black Rose is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-07-2007 , 17:58   Re: Get the index of model
Reply With Quote #6

Erm. Finding index by model. Using a function "like find_ent_by_class"...

...how about find_ent_by_model
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
NTST
Junior Member
Join Date: Oct 2007
Old 11-07-2007 , 21:25   Re: Get the index of model
Reply With Quote #7

find_ent_by_class ( StartEntity, Classname[] )
find_ent_by_model ( StartEntity, Classname[], Model[] )
What is Classname[] and Model[]?
Please show me a tutorial. Thanks!
NTST is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-07-2007 , 22:52   Re: Get the index of model
Reply With Quote #8

We can't help you with anything unless you tell us how you are going to use it.
[ --<-@ ] Black Rose is offline
NTST
Junior Member
Join Date: Oct 2007
Old 11-08-2007 , 02:46   Re: Get the index of model
Reply With Quote #9

Please view this image(attachment).
Attached Thumbnails
Click image for larger version

Name:	ex.JPG
Views:	182
Size:	49.1 KB
ID:	21347  
NTST is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-08-2007 , 09:21   Re: Get the index of model
Reply With Quote #10

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; }
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Reply



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 01:24.


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