|
Senior Member
|
05-22-2008
, 00:57
Re: Last Seen v0.1 (5/21)
|
#2
|
For plugin developers...
Natives- GetNameFromAuthString(const String:auth[], GetNameFromAuthStringCallback:callback, any:data=0)
- From a SteamID, lookup the most recently used name and return the data to the specified callback function. See seen.inc for more details. Here's an example plugin:
PHP Code:
#include <sourcemod>
#include <seen>
public Plugin:myinfo = {
name = "Name",
author = "Author",
description = "Description",
version = "0.0.0.0",
url = "Internet"
};
public OnPluginStart() {
RegConsoleCmd("sm_lookup_name", Cmd_Lookup);
}
public Action:Cmd_Lookup(client, args) {
decl String:arg[32];
if (!args) {
ReplyToCommand(client, "usage: sm_lookup_name <steamid>");
return Plugin_Handled;
}
GetCmdArgString(arg, sizeof(arg));
GetNameFromAuthString(arg, CB_GotNameFromAuthString);
return Plugin_Handled;
}
public CB_GotNameFromAuthString(bool:result, const String:steamid[], const String:name[]) {
if (result) {
PrintToServer("For steamid \"%s\", found name \"%s\"", steamid, name);
}
else {
PrintToServer("Could not find a name for steamid \"%s\"", steamid);
}
}
|
|
|
|