View Single Post
FLOOR_MASTER
Senior Member
Join Date: Mar 2008
Old 05-22-2008 , 00:57   Re: Last Seen v0.1 (5/21)
Reply With Quote #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(clientargs) {
          
      decl String:arg[32];

          if (!
      args) {
              
      ReplyToCommand(client"usage: sm_lookup_name <steamid>");
              return 
      Plugin_Handled;
          }

          
      GetCmdArgString(argsizeof(arg));
          
      GetNameFromAuthString(argCB_GotNameFromAuthString);

          return 
      Plugin_Handled;
      }
          
      public 
      CB_GotNameFromAuthString(bool:result, const String:steamid[], const String:name[]) {
          if (
      result) {
              
      PrintToServer("For steamid \"%s\", found name \"%s\""steamidname);
          }
          else {
              
      PrintToServer("Could not find a name for steamid \"%s\""steamid);
          }

FLOOR_MASTER is offline