PDA

View Full Version : [HELP] Pickups.


HY
12/01/2015, 05:43 PM
Hello. So, I started again my project about Dynamic Pickups.
But, the problem it's, I wanted to save all pickups like:

0.ini
1.ini
2.ini
etc.ini

But, all pickups are saved in a single file..
All pickups are saved in this file. P.S: I don't know how the hell appeared here and why.

http://www.upload.ee/image/4460138/bandicam_2015-01-12_20-18-49-179.jpg

I wanted to save them like:

http://www.upload.ee/image/4460142/bandicam_2015-01-12_20-22-25-236.jpg

Anyway, I hope you understanded my issue.

Code: www.pastebin.com (http://www.pastebin.com/RwzdaQiv)

dominik523
12/01/2015, 05:47 PM
Shouldn't this be like this?
stock PickPath(pickid)
{
new string[4];
format(string, sizeof(string), "/Pickups/%d.ini", pickid);
return string;
}

So each time you are saving, pickup's path will be different from other pickups.
EDIT: That string's size won't be enough to store the path so you should set it larger.

HY
12/01/2015, 05:50 PM
Thanks @dominik.

I have tried your variante, but gives me error.
I have a global variable for pickid, I can't define it as a global variable and use it in a stock.
It gives error.

Thanks anyway.
Anybody else?

dominik523
12/01/2015, 05:54 PM
You didn't use anywhere pickid except in declaring it and in format.
What about this?
if(sscanf(params, "ii", pickid , Tip))
new INI:File = INI_Open(PickPath(pickid ));
...
////////////////////////
stock PickPath(pickupid)
{
new string[4];
format(string, sizeof(string), "/Pickups/%d.ini", pickupid);
return string;
}

HY
12/01/2015, 06:00 PM
Anyway, tried your code. Doesn't work.
I made this very much times... but now, I don't know why doesn't work.
Can be because Y_ini it's outdated? I don't know.

Anybody else..?