3 * =============================================================================
4 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 * =============================================================================
7 * This file is part of the SourceMod/SourcePawn SDK.
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, version 3.0, as published by the
11 * Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
21 * As a special exception, AlliedModders LLC gives you permission to link the
22 * code of this program (as well as its derivative works) to "Half-Life 2," the
23 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 * by the Valve Corporation. You must obey the GNU General Public License in
25 * all respects for all other code used. Additionally, AlliedModders LLC grants
26 * this exception to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 * or <http://www.sourcemod.net/license.php>.
33 #if defined _clientprefs_included
36 #define _clientprefs_included
39 * Creates a new Client preference cookie.
41 * @param name Name of the new preference cookie.
42 * @param description Optional description of the preference cookie.
43 * @return A handle to the newly created cookie. If the cookie already exists, a handle to it will still be returned.
44 * @error Cookie name is blank.
46 native Handle:RegClientPrefCookie(const String:name[], const String:description[]);
49 * Searches for a Client preference cookie.
51 * @param name Name of cookie to find.
52 * @return A handle to the cookie if it is found. INVALID_HANDLE otherwise.
54 native Handle:FindClientPrefCookie(const String:name[]);
57 * Set the value of a Client preference cookie.
59 * @param client Client index.
60 * @param cookie Client preference cookie handle.
61 * @param value String value to set.
63 * @error Invalid cookie handle or invalid client index.
65 native SetClientPrefCookie(client, Handle:cookie, const String:value[]);
68 * Retrieve the value of a Client preference cookie.
70 * @param client Client index.
71 * @param cookie Client preference cookie handle.
72 * @param buffer Copyback buffer for value.
73 * @param maxlen Maximum length of the buffer.
74 * @error Invalid cookie handle or invalid client index.
76 native GetClientPrefCookie(client, Handle:cookie, String:buffer[], maxlen);
79 * Checks if a clients cookies have been loaded from the database.
81 * @param client Client index.
82 * @return True if loaded, false otherwise.
83 * @error Invalid client index.
85 native bool:AreClientCookiesCached(client);
88 * Called once a client's saved cookies have been loaded from the database.
90 * @param client Client index.
92 forward OnClientCookiesLoaded(client);
96 * Do not edit below this line!
98 public Extension:__ext_clientprefs =
100 name = "Client Preferences",
101 file = "clientprefs.ext",
103 #if defined REQUIRE_EXTENSIONS