PDA

View Full Version : Probrem with GetEntDataString and GetEntPropString


Cuban_Dota
04-08-2015, 13:50
Hi i am using GetEntDataString and GetEntPropString for retrieving the m_iszPlayerNames property from the CDOTA_PlayerResource. The code is:


new pr = GetPlayerResourceEntity();
new String: name[32];
new name_offset = FindSendPropInfo("CDOTA_PlayerResource", "m_iszPlayerNames");
GetEntDataString(pr, name_offset, name, sizeof(name));
the problem is the string is empty and it shouldnt be.

In the case of GetEntPropString:

GetEntPropString(pr, Prop_Send, "m_iszPlayerNames", name, sizeof(name), 0);

it gives an error that says that m_iszPlayerNames is not a string and it is a string.

Any ideas??

Kailo
04-08-2015, 16:50
Invoke sm_dump_netprops <file> on server. In dump find your prop and see type. It'll set after prop name.

Powerlord
04-08-2015, 17:16
If you're trying to fetch the client's name, why wouldn't you just use GetClientName?

Cuban_Dota
04-09-2015, 12:27
If you're trying to fetch the client's name, why wouldn't you just use GetClientName?
Cause GetClientName only works when a client is connected and i need to get this info no matter what. This netprop is written when a player enters the game and its never erased no matter if the client disconnects

Miu
04-09-2015, 12:56
try FindSendPropInfo("CDOTA_PlayerResource", "m_iszPlayerNames.0000");

Cuban_Dota
04-09-2015, 12:58
try FindSendPropInfo("CDOTA_PlayerResource", "m_iszPlayerNames.0000");
going to try it,hope it works,thx