Author
|
Message
|
SourceMod Developer
|
02-19-2009
, 13:22
[EXTENSION] CSteamID - SteamIDs as 64bit integers
|
#1
|
CSteamID
v1.0.1
Description:
Provides some native functions for converting to and from SteamIDs stored as 64-bit integers.
Natives:
PHP Code:
/** * Gives the 64-bit int SteamID for a client * * @param client Client index of the player. * @param buffer Destination string buffer. * @param maxlength Maximum length of output string buffer. * @return True on success, false on invalid client index or failure to find edict index. */ native bool:GetClientCSteamID(client, String:buffer[], maxlength);
/** * Given a 64-bit int SteamID, gives the SteamID associated with it * * @param input 64-bit integer stored in a string * @param buffer Destination string buffer for the SteamID. * @param maxlength Maximum length of the output string buffer. * @return True on success, false on invalid input string. */ native bool:CSteamIDToSteamID(String:input[], String:buffer[], maxlength);
/** * Given a SteamID, gives the 64-bit int SteamID associated with it * * @param input SteamID stored in a string * @param buffer Destination string buffer for the 64-bit int SteamID. * @param maxlength Maximum length of the output string buffer. * @return True on success, false on invalid SteamID. */ native bool:SteamIDToCSteamID(String:input[], String:buffer[], maxlength);
Notes:
- I call the 64bit int representation of a SteamID a CSteamID. Anywhere you see CSteamID, you can know that it's the 64bit int version.
- A 64bit int SteamID is the same as a Steam Community friend ID.
- As long as Valve keeps the functions used in this extension in their code, the 64bit int SteamIDs will outlast any changes done to normal SteamIDs (for example how they just changed from STEAM_0 to STEAM_1 and then back again).
- GetClientCSteamID can be called before a player authorizes to the server. This means that during OnClientConnect you can grab their CSTeamID, and then convert that to their SteamID, and essentially get it before you normally could without this extension.
- This extension will only work for OB mods. I tested on TF2, but it should work fine on DOD:S and any other OB mod.
Thanks to:
- voogru - He's the inspiration behind this extension, and helped a ton during the process. Thanks for putting up with my bullshit the whole time. :]
- Nephyrin - Some small help with casting types and such.
- Valve - For screwing us over too many times to count.
Changelog:
- 1.0.1
- Added a check to see if steamID is NULL.
Download:
http://forums.alliedmods.net/showthr...52#post1800652
Last edited by bl4nk; 09-16-2012 at 21:30.
|
|
|
|