Initial import of amb734 - Client preferences extension.
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402072
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include <sourcemod>
|
||||
#include "../include/clientprefs.inc"
|
||||
|
||||
new Handle:g_Cookie;
|
||||
|
||||
public OnPluginStart()
|
||||
{
|
||||
g_Cookie = RegClientPrefCookie("test-cookie", "A basic testing cookie");
|
||||
}
|
||||
|
||||
public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
|
||||
{
|
||||
LogMessage("Connect Cookie state: %s", AreClientCookiesCached(client) ? "YES" : "NO");
|
||||
}
|
||||
|
||||
public OnClientCookiesLoaded(client)
|
||||
{
|
||||
LogMessage("Loaded Cookie state: %s", AreClientCookiesCached(client) ? "YES" : "NO");
|
||||
|
||||
new String:hi[100];
|
||||
GetClientPrefCookie(client, g_Cookie, hi, sizeof(hi));
|
||||
LogMessage("Test: %s",hi);
|
||||
SetClientPrefCookie(client, g_Cookie, "somethingsomething");
|
||||
GetClientPrefCookie(client, g_Cookie, hi, sizeof(hi));
|
||||
LogMessage("Test: %s",hi);
|
||||
}
|
||||
Reference in New Issue
Block a user