Raised This Month: $ Target: $400
 0% 

Entity edict = index?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xenogenetics
Member
Join Date: Jul 2007
Old 06-06-2008 , 15:38   Entity edict = index?
Reply With Quote #1

Right now I am using GetClientAimTarget and then GetEdictClassName to find out what type of entity is being looked at but I don't think it is working.

How can I get an entities edict from its index?
Xenogenetics is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 06-06-2008 , 16:49   Re: Entity edict = index?
Reply With Quote #2

You shouldn't need an edict in a SourceMod plugin. SM currently references entities by their edict index. Only entities with edicts can be used in SM, but anything your getting with GetClientAimTarget falls into that category.

What's not working for you?
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
kirewv
Senior Member
Join Date: Oct 2007
Old 06-09-2008 , 19:48   Re: Entity edict = index?
Reply With Quote #3

This works fine:
PHP Code:
public Action:Cmd_Getinfo(clientargs)
{
 new 
target GetClientAimTarget(clientfalse);
 
decl String:entity_name[20];
 
GetEdictClassname(targetentity_namesizeof(entity_name));
 
PrintToChat(client"You are aiming at a %s with an index of %d "entity_nametarget);

kirewv is offline
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 21:51.


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