SA-MP Forums Archive
Best way to save many values(0,1) [MySQL] - 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: Best way to save many values(0,1) [MySQL] (/showthread.php?tid=654421)



Best way to save many values(0,1) [MySQL] - GospodinX - 28.05.2018

Hi

I have an question about saving values with 0,1..For example i have for licences few variables.I use just 0 and 1(1-Player have license | 0-Player don't have license)

And now i have new variable for all license
Quote:

ShipLicense
DrivingLicense
MotorLicense
AircraftLicense
WeaponLicense

Etc,etc..
Is it good?Or there have better way?For example i'm think about this:
Make an string,text and then use something like this
Код:
0,1,0,1,1
For example it means that player don't have ShipLicense and MotorLicense..But i don't know is better to have more int variables,or an string variable(text in mysql) and then use sscanf maybe?

Thanks in advance


Re: Best way to save many values(0,1) [MySQL] - Mugala - 28.05.2018

which is comfortable for u? do as u wish.
but I suggest several tables.


Re: Best way to save many values(0,1) [MySQL] - GospodinX - 28.05.2018

Okey,now I understand what i need to do in MySQL.Now I just have question about what to do on samp server.

1.
Made 5 variables license(for every license) and load it when player login on server

2. Just Select it from database every time when i need to use it in my mode.