Raised This Month: $32 Target: $400
 8% 

Problem in Dota 2 scripting


Post New Thread Reply   
 
Thread Tools Display Modes
Equiment
AlliedModders Donor
Join Date: Feb 2014
Old 10-31-2014 , 07:52   Re: Problem in Dota 2 scripting
Reply With Quote #11

Psychonic, k, how can I pick player from entindex.killed?
Equiment is offline
psychonic

BAFFLED
Join Date: May 2008
Old 10-31-2014 , 08:58   Re: Problem in Dota 2 scripting
Reply With Quote #12

That field is the entity index / client index of the player, the same value used for GetClientName, GetClientAuthId, etc.

If you need the user id from it, you can use GetClientUserId.
psychonic is offline
Equiment
AlliedModders Donor
Join Date: Feb 2014
Old 10-31-2014 , 09:33   Re: Problem in Dota 2 scripting
Reply With Quote #13

GetClientOfUserId return 0 in this func
Equiment is offline
psychonic

BAFFLED
Join Date: May 2008
Old 10-31-2014 , 09:36   Re: Problem in Dota 2 scripting
Reply With Quote #14

Quote:
Originally Posted by Equiment View Post
GetClientOfUserId return 0 in this func
GetClientOfUserId isn't applicable since the value is an entity index, not a userid.

Additionally, not all entities killed will be clients. Creeps, neutrals, towers, Roshan, etc. are all entities.
psychonic is offline
Equiment
AlliedModders Donor
Join Date: Feb 2014
Old 10-31-2014 , 10:51   Re: Problem in Dota 2 scripting
Reply With Quote #15

[SM] Native "GetClientUserId" reported: Client index 92 is invalid
Equiment is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-31-2014 , 11:04   Re: Problem in Dota 2 scripting
Reply With Quote #16

Quote:
Originally Posted by psychonic View Post
Additionally, not all entities killed will be clients. Creeps, neutrals, towers, Roshan, etc. are all entities.
__________________
asherkin is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-31-2014 , 11:19   Re: Problem in Dota 2 scripting
Reply With Quote #17

...which means you have to make sure if (0 < entindex_killed <= MaxClients). Assuming that DOTA2 supports MaxClients.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Equiment
AlliedModders Donor
Join Date: Feb 2014
Old 10-31-2014 , 11:21   Re: Problem in Dota 2 scripting
Reply With Quote #18

92 - my id (id of my hero)
Equiment is offline
Equiment
AlliedModders Donor
Join Date: Feb 2014
Old 10-31-2014 , 11:28   Re: Problem in Dota 2 scripting
Reply With Quote #19

Powerlord, do this, now its nothing printed.
Equiment is offline
psychonic

BAFFLED
Join Date: May 2008
Old 10-31-2014 , 12:47   Re: Problem in Dota 2 scripting
Reply With Quote #20

If it's giving the hero index, you can loop through all players on the server and see which one has control of that hero. It's stored in a sendprop on the player, m_hHeroEntity or something similarly named. GetEntPropEnt can read it to compare to the index.
psychonic 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 23:44.


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