Is this even possible? - 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: Is this even possible? (
/showthread.php?tid=408312)
Is this even possible? -
Roel - 17.01.2013
Hello, I just find out why something was not working and it's wierd.
Here it is:
pawn Код:
printf("%d",slot); //returns 0
printf("%d cars selected",rows); //returns 5
for(new id = 0; id < rows; id++)
{
printf("%d",slot); //returns 0
cache_get_field_content(id, "ID", data[0]);
cache_get_field_content(id, "MAP", data[1]);
cache_get_field_content(id, "TYPE", data[2]);
cache_get_field_content(id, "OWNER_ID", data[3]);
cache_get_field_content(id, "MODEL", data[4]);
cache_get_field_content(id, "PERMISSION", data[5]);
cache_get_field_content(id, "COMPONENTS", data[6]);
cache_get_field_content(id, "COLOR_ONE", data[7]);
cache_get_field_content(id, "COLOR_TWO", data[8]);
cache_get_field_content(id, "POSITION", data[9]);
cache_get_field_content(id, "RESPAWN", data[10]);
cache_get_field_content(id, "LABEL", data[11]);
cache_get_field_content(id, "INFO", data[12]);
printf("%d",slot); //returns 44 scary?
This is just a small part of a function
The thing is, after the forloop line it becomes 44...
But it should stay on 0.
This is just no logical reason that this changes, somebody can help me?
Re: Is this even possible? -
azzerking - 17.01.2013
It depends what data is equaling to?
try giving a little more info on it
-- EDIT --
As far as i understand im guessing this is getting data from a mysql db and i'm thinking that its looping around all of the rows in the database and somehow its adding the total amount of rows or the data within a specific row
Re: Is this even possible? -
Roel - 17.01.2013
Well but what does the mysql function has to do with the slot variable (shit english)
Re: Is this even possible? -
azzerking - 17.01.2013
Are you using mysql?
if yes then im guessing there data in your table and its getting picked up by it
else
You need to give more information about your situation. Like where the data is comming from and how you are recieving it
Re: Is this even possible? -
Roel - 17.01.2013
Resloved, seems that the output of cache_get_field_content was to big sized.