Setting default cookie value
Is there a way to set the default cookie value for a player who is joining for the first time/is joining for the first time since this cookie was added? I'd like my cookie value to default to "1" and I don't see how to do that. Thanks.
|
Re: Setting default cookie value
I'm wondering this as well. What I've done is just store a default value to my variable that's supposed to hold the player's cookie value if they're joining for the first time.
You can do this by setting the default value in the "player_connect" event since that always fires before "OnClientCookiesCached". Then inside "OnClientCookiesCached" you can check whether the stored cookie value of the client is empty to determine if you should overwrite the default value that the client was assigned when they initially connected to the server. PHP Code:
|
Re: Setting default cookie value
Thank you for this, looks like an elegant solution.
|
Re: Setting default cookie value
You can just check if cookie value is empty and then set your default.
Code:
public void OnClientCookiesCached(int client) { |
All times are GMT -4. The time now is 12:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.