Pretty much, yes.
To fill small details, give data types to callback variables. example:
Code:
public void OnClientConnected(int client)
{
...
And it always good to try test with output messages, how code would work.
For example, when player connect to server:
Code:
Not Valve ds: Direct-connect is allowed
Client "Bacardi" connected (192.168.1.20:27006).
OnClientConnected 1
Sending server info signon packet for 192.168.1.20:27006: 289800 / 524284 buffer
"Bacardi<3><STEAM_1:1:14163588><>" STEAM USERID validated
OnClientCookiesCached 1
PutClientInServer: no info_player_start on level
Sending full update to Client Bacardi (Bacardi can't find frame from tick -1)
...
OnClientConnected works first than
OnClientCookiesCached
You could merge these together.
PHP Code:
public void OnClientCookiesCached(int client)
{
PrintToServer("OnClientCookiesCached %i", client);
char CookieValue[8];
GetClientCookie(client, TestCookie, CookieValue, sizeof(CookieValue));
AnnounceEnabled[client] = (CookieValue[0] != '\0' && StringToInt(CookieValue));
if(AnnounceEnabled[client])
{
CreateTimer(10.0, TestTimer);
}
}
*edit
If you want use sourcemod Client Preference "!settings" menu. It's old Pawn code, tough. (2013)
[Tutorial] ClientPrefs
https://forums.alliedmods.net/showthread.php?t=228244
__________________