sourcemod/plugins/include/helpers.inc
Scott Ehlert 6cff249b5c Fixed tabs, hopefully...
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40481
2007-02-12 09:00:55 +00:00

47 lines
1.3 KiB
SourcePawn

/**
* vim: set ts=4 :
* ===============================================================
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
* ===============================================================
*
* This file is part of the SourceMod/SourcePawn SDK. This file may only be used
* or modified under the Terms and Conditions of its License Agreement, which is found
* in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
* may change at any time. To view the latest information, see:
* http://www.sourcemod.net/license.php
*
* Version: $Id$
*/
#if defined _helpers_included
#endinput
#endif
#define _helpers_included
/**
* Formats a user's info as log text.
*
* @param client Client index.
* @param buffer Buffer for text.
* @param maxlength Maximum length of text.
*/
stock FormatUserLogText(client, String:buffer[], maxlength)
{
decl String:auth[32];
decl String:name[40];
new userid = GetClientUserId(client);
if (!GetClientAuthString(client, auth, sizeof(auth)))
{
StrCopy(auth, sizeof(auth), "UNKNOWN");
}
if (!GetClientName(client, name, sizeof(name)))
{
StrCopy(name, sizeof(name), "UNKNOWN");
}
/** Currently, no team stuff ... */
Format(buffer, maxlength, "\"%s<%d><%s><>\"", name, userid, auth);
}