SA-MP Forums Archive
MAX_PLAYERS or pInfo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MAX_PLAYERS or pInfo (/showthread.php?tid=649448)



MAX_PLAYERS or pInfo - PepsiCola23 - 09.02.2018

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
?


Re: MAX_PLAYERS or pInfo - Gforcez - 09.02.2018

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.


Re: MAX_PLAYERS or pInfo - PepsiCola23 - 09.02.2018

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?


Re: MAX_PLAYERS or pInfo - Stev - 09.02.2018

Just a normal player variable would do fine then.


Re: MAX_PLAYERS or pInfo - Mugala - 09.02.2018

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


Re: MAX_PLAYERS or pInfo - AmigaBlizzard - 09.02.2018

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.