PDA

View Full Version : Save data by SteamID.



Angel
12-03-2016, 09:24 PM
how do you save some player's data, eg: a variable, by steamid?

nico
13-03-2016, 07:26 AM
string szSteamId = g_EngineFuncs.GetPlayerAuthId( pPlayer.edict() );

Then save to an array (http://www.angelcode.com/angelscript/sdk/docs/manual/doc_datatypes_arrays.html) or dictionary. (http://www.angelcode.com/angelscript/sdk/docs/manual/doc_datatypes_dictionary.html)

Angel
13-03-2016, 02:17 PM
Thanks!

w00tguy123
13-03-2016, 04:21 PM
Note that getPlayerAuthId() will always return "STEAM_ID_LAN" when you host a LAN server, so it's a good idea to use player.pev.netname as a fallback (the player's username).