SA-MP Forums Archive
Help Code - 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: Help Code (/showthread.php?tid=656729)



Help Code - tobi736 - 22.07.2018

Hi.
I code my own system and i want to ask!.
How to create an array?
example
variable a contains XXX
pls help me


Re: Help Code - grymtn - 22.07.2018

Код:
new myarrayname[50];
which contians 50 slots in the array which is also you use for creating strings as every letter will count as an usage of array slot.

İf you want sometthing more complicated, almost all user(i think all of them but not sure) variable holding systems use two arrays in single array variable like:

Код:
userinfo[max number of players][numbers of varibles you would like to save]
even saving names:

Код:
userinfo[max number of players][numbers of varibles you would like to save][string array for name]
ofcourse to avoid the numbers in variables that we like to save we choose to use enums. which will make like 0=name 1=dbid 2=money so you use:

Код:
userinfo[playerid][money]



Re: Help Code - tobi736 - 23.07.2018

oke thanks your