[Solved] How to save a player choice?
Just like the topic , How do I save a player's Menu Selection choice ? If the player choose option 1 , Then the next round , The thing happening in Option 1 will not keep repeating and will remember the choice.
|
Re: How to save a player choice?
Use a global array, g_myarray[33]. Then you need to reset it on client_connect().
Set it using g_myarray[id] = <integer representing players selection here> |
Re: How to save a player choice?
Like > ?
PHP Code:
PHP Code:
PHP Code:
|
Re: How to save a player choice?
Yeah, but, in client_connect I would set it to 0 to show that the player has not a made a selection yet unless you want 1 to be the default for everybody and they can change it with the menu.
|
Re: How to save a player choice?
Menu items start at 0, so it's probably better to initialize the choice to -1 or increment the menu items before storing them.
Also, notice there's a consistency in your code: PHP Code:
PHP Code:
PHP Code:
|
Re: How to save a player choice?
Quote:
|
Re: How to save a player choice?
Orh .. But I typed like how I did in the code above but doesn't work :(
|
Re: How to save a player choice?
Quote:
|
Re: How to save a player choice?
PHP Code:
|
Re: How to save a player choice?
1. FwdPlayerSpawn() is never executed. You need to register the spawn with ham.
2. Don't use a set_task for showing the menu. Just call the function. 3. You don't need client_disconnect since you reset the values in client_connect(). |
All times are GMT -4. The time now is 18:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.