MAX_PLAYERS or pInfo
#1

Im trying to make a variable so a player can`t use /work if they`re already working
is it better to have new IsWorking[MAX_PLAYERS] or should i make it at enum pData like this
PHP код:
enum pData
{
    
ID,
    
Name[MAX_PLAYER_NAME],
    
Password[129],
    
Level,
    
Cash,
    
IsWorking
?
Reply
#2

Depends, if you want to use pData only for database related player information, then make a seperate variable. But you can add it to the enum if you think that works well.
Reply
#3

i only need the IsWorking variable when he types /work and /stopwork.
i dont want to load it or to save it to a mysql table.

so what should i use then?
Reply
#4

Just a normal player variable would do fine then.
Reply
#5

you can use both, but separate variable will be better for this, or just PVars is good too.
Reply
#6

You can for simplicity's sake put everything in your pInfo enum and keep the variables a bit separated.
By this I mean you can put your database-variables at the top of your enum, and the rest which is only used by the script but don't get saved at the bottom of your enum, perhaps split it up using comments to make it visual which variables will be saved and which aren't saved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)