plugins/testsuite/clientprefstest.sp
changeset 2009 1a1236dfdbb1
child 2048 2454ff4d6afb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/plugins/testsuite/clientprefstest.sp	Thu Apr 17 04:58:09 2008 +0000
     1.3 @@ -0,0 +1,26 @@
     1.4 +#include <sourcemod>
     1.5 +#include "../include/clientprefs.inc"
     1.6 +
     1.7 +new Handle:g_Cookie;
     1.8 +
     1.9 +public OnPluginStart()
    1.10 +{
    1.11 +		g_Cookie = RegClientPrefCookie("test-cookie", "A basic testing cookie");
    1.12 +}
    1.13 +
    1.14 +public  bool:OnClientConnect(client, String:rejectmsg[], maxlen)
    1.15 +{
    1.16 +	LogMessage("Connect Cookie state: %s", AreClientCookiesCached(client) ? "YES" : "NO");
    1.17 +}
    1.18 +
    1.19 +public OnClientCookiesLoaded(client)
    1.20 +{
    1.21 +	LogMessage("Loaded Cookie state: %s", AreClientCookiesCached(client) ? "YES" : "NO");
    1.22 +	
    1.23 +	new String:hi[100];
    1.24 +	GetClientPrefCookie(client, g_Cookie, hi, sizeof(hi));
    1.25 +	LogMessage("Test: %s",hi);
    1.26 +	SetClientPrefCookie(client, g_Cookie, "somethingsomething");
    1.27 +	GetClientPrefCookie(client, g_Cookie, hi, sizeof(hi));
    1.28 +	LogMessage("Test: %s",hi);	
    1.29 +}
    1.30 \ No newline at end of file