14.02.2013, 06:01
Hello!
I'm currently working on a Drug system for a CnR server, and i am wondering how could i make a limit of 5 plants write to 5 slots ONLY?
Okay, i am using dini to save information about the plants, and it is difficult to save the plants when you leave to only 5 slots, because i don't know how i could do it.
(example) I have 5 plants planted, which is growing. 1 of the plants is finished growing, and i use a command to harvest it. But, then i want to plant another plant because 1 slot is empty, and the plant which was finished was placed at slot 1, and slot,2,3,4,5 is taken by other plants.
So, how can i "find" the empty slot in the .ini file, and automatically write to that slot? And how can i find out if all the slots are taken in the file and then tell the player that he reached his limit of plants? (because this should be loaded on the OnPlayerConnect, thats why i am wondering)
Any explanation, even just a little example would help alot, because i am stuck now
Thanks a lot
~Airplanesimen
I'm currently working on a Drug system for a CnR server, and i am wondering how could i make a limit of 5 plants write to 5 slots ONLY?
Okay, i am using dini to save information about the plants, and it is difficult to save the plants when you leave to only 5 slots, because i don't know how i could do it.
(example) I have 5 plants planted, which is growing. 1 of the plants is finished growing, and i use a command to harvest it. But, then i want to plant another plant because 1 slot is empty, and the plant which was finished was placed at slot 1, and slot,2,3,4,5 is taken by other plants.
So, how can i "find" the empty slot in the .ini file, and automatically write to that slot? And how can i find out if all the slots are taken in the file and then tell the player that he reached his limit of plants? (because this should be loaded on the OnPlayerConnect, thats why i am wondering)
Any explanation, even just a little example would help alot, because i am stuck now
Thanks a lot
~Airplanesimen