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

Gettings an entities targetname


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MockingBird
Member
Join Date: Mar 2005
Old 10-07-2008 , 13:41   Gettings an entities targetname
Reply With Quote #1

Hi.

For my script I need to get an entities target name.

This is my current code, but im getting a runtime error saying that the prop. doesnt exist

Code:
decl String:entName[64]
    
    GetEntPropString(entIndex, Prop_Data, "targetname", entName, sizeof(entName))
Im pretty sure this was possible in 1.6. Has it changed, and you can no-longer get the targetname in source?

Thanks in advanced.
MockingBird is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 10-07-2008 , 14:21   Re: Gettings an entities targetname
Reply With Quote #2

http://forums.alliedmods.net/showthr...ght=TARGETNAME
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
MockingBird
Member
Join Date: Mar 2005
Old 10-07-2008 , 14:23   Re: Gettings an entities targetname
Reply With Quote #3

Thank you very much. Is there a list of all the variables stored for stuff like that, or do i need to open the source?
MockingBird is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 10-07-2008 , 16:50   Re: Gettings an entities targetname
Reply With Quote #4

There are ways to get it programmatically. pRED has a routine to do that and the csdatamaps and tfdatamaps are on his site: http://users.alliedmods.net/~pred/
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 10-07-2008 , 17:01   Re: Gettings an entities targetname
Reply With Quote #5

sm_dump_netprops
sm_dump_datamaps
bl4nk is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 10-07-2008 , 17:13   Re: Gettings an entities targetname
Reply With Quote #6

...or that

__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
MockingBird
Member
Join Date: Mar 2005
Old 10-08-2008 , 02:35   Re: Gettings an entities targetname
Reply With Quote #7

Thank you very much guys, big help

EDIT:
Im having a problem. As far as I can make out, this *should* set the players speed:
{code}SetEntPropFloat(Client, Prop_Data, "m_flSpeed", Speed);{code}

Do I need to flush something in order to tell the client that their speed has changed?

Last edited by MockingBird; 10-08-2008 at 02:48.
MockingBird is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 10-08-2008 , 03:07   Re: Gettings an entities targetname
Reply With Quote #8

Code:
SetEntDataFloat(client, FindSendPropInfo("CTFPlayer", "m_flMaxspeed"), 400.0, true);
__________________
CrimsonGT is offline
MockingBird
Member
Join Date: Mar 2005
Old 10-08-2008 , 03:46   Re: Gettings an entities targetname
Reply With Quote #9

Thanks
MockingBird is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 10-08-2008 , 12:53   Re: Gettings an entities targetname
Reply With Quote #10

Or you could just modify your code to have Prop_Send instead of Prop_Data.
bl4nk 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 04:55.


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