16.04.2014, 19:30
(
Последний раз редактировалось klimgorilla; 16.04.2014 в 20:14.
)
Hey guys,
I'm trying to connect my sa-mp project with my PHP management system but i've some problems with array sizes.
This is how I create my array to store goods for a truck mission.
Then I fill the array with data from the database. So far so good but I'll never get the size of the array since I didn't define it.
A simple solution would be to store the SQL num rows into a variable to use it later on. But this solution feels wrong.
Do you guys have any other ideas?
EDIT:
So I've used the simple solution and it works quite well. Adding these variables might use more memory but it doesn't leave any empty slots in the arrays.
I'm trying to connect my sa-mp project with my PHP management system but i've some problems with array sizes.
This is how I create my array to store goods for a truck mission.
pawn Код:
new TS_Goods[][32];
pawn Код:
good = random(?);
pawn Код:
good = random(SQL_num_rows);
EDIT:
So I've used the simple solution and it works quite well. Adding these variables might use more memory but it doesn't leave any empty slots in the arrays.