Array size
#1

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.
pawn Код:
new TS_Goods[][32];
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.
pawn Код:
good = random(?);
A simple solution would be to store the SQL num rows into a variable to use it later on. But this solution feels wrong.
pawn Код:
good = random(SQL_num_rows);
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.
Reply


Messages In This Thread
Array size - by klimgorilla - 16.04.2014, 19:30

Forum Jump:


Users browsing this thread: 1 Guest(s)