Raised This Month: $51 Target: $400
 12% 

TF2 Get CP Name by Index


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The JCS
AlliedModders Donor
Join Date: Jan 2007
Location: Brazil
Old 08-24-2008 , 18:26   TF2 Get CP Name by Index
Reply With Quote #1

Is there any way to get the name of the using its Index?
I think I can use a loop to check every CP if it's the index is equal to the index that i want, but i don't have any idea how to get the entity index. =/
The JCS is offline
Send a message via MSN to The JCS
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-25-2008 , 08:22   Re: TF2 Get CP Name by Index
Reply With Quote #2

FindEntityByClassname(-1, "team_control_point");
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
The JCS
AlliedModders Donor
Join Date: Jan 2007
Location: Brazil
Old 08-25-2008 , 18:13   Re: TF2 Get CP Name by Index
Reply With Quote #3

This will return the entity, but I want a property of that entity.
The JCS is offline
Send a message via MSN to The JCS
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-25-2008 , 21:03   Re: TF2 Get CP Name by Index
Reply With Quote #4

What property do you want? You can get the values through datamaps or netprops.
bl4nk is offline
The JCS
AlliedModders Donor
Join Date: Jan 2007
Location: Brazil
Old 08-25-2008 , 21:06   Re: TF2 Get CP Name by Index
Reply With Quote #5

I want the Index and the Name that appears on HUD when a player capture a CP. Can you tell me the way to get them? I'm really lost.
The JCS is offline
Send a message via MSN to The JCS
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-25-2008 , 21:13   Re: TF2 Get CP Name by Index
Reply With Quote #6

Well, you said you didn't know how to get the entity index, so I posted how to get that.

You can use something like GetEntPropString(caller, Prop_Data, "m_ModelName", modelname, 256); to get its name, but I'm not sure what to use instead of m_ModelName. I don't think it's m_Name. It might be m_target as LDuke said here.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
The JCS
AlliedModders Donor
Join Date: Jan 2007
Location: Brazil
Old 08-25-2008 , 21:26   Re: TF2 Get CP Name by Index
Reply With Quote #7

"Index" is the name of the CPEntity property
The JCS is offline
Send a message via MSN to The JCS
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 11:06.


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