21.08.2012, 11:54
Well, i use that system of increasing 1 number in a file, so when i create a vehicle, it will up 1 ID. I am trying to load this file.
Like, when i create a vehicle in-game, CarIDInfo[CID] will up 1 number. To get this value, i wanted to load it from the file, so it wont bug if server crashes or something.
So my idea is to load ids.ini which saves the CID variable as CARID="TheID", set CarIDInfo[CID] to that value, so than when i create the vehicle file, it will be CarIDInfo[CID]+1, creating a file named 1 number up than the one before.
I made /setini to "suposly" load the file for the tests, til i get it to work, just so i don't have to edit the vehicle creating cmd all the time..
So now, there is a file named ids.ini, with CARID=0 inside.
When i create a car, it will set CarIDInfo[CID]++.
I than use /checkini(Just a random cmd name.. Nothing to do with its purposes) that will tell me what CarIDInfo[CID] is set to.
Than i have /setini, that suposely load the file, making CarIDInfo[CID] 0, as in the file it's writen 0, but it still same value.
Basicaly, it's just to understand how to load info from the file, so i can continue with my systems...
All i need to know is how to set CarIDInfo[CID] to the value wrote in ids.ini file.
Like, when i create a vehicle in-game, CarIDInfo[CID] will up 1 number. To get this value, i wanted to load it from the file, so it wont bug if server crashes or something.
So my idea is to load ids.ini which saves the CID variable as CARID="TheID", set CarIDInfo[CID] to that value, so than when i create the vehicle file, it will be CarIDInfo[CID]+1, creating a file named 1 number up than the one before.
I made /setini to "suposly" load the file for the tests, til i get it to work, just so i don't have to edit the vehicle creating cmd all the time..
So now, there is a file named ids.ini, with CARID=0 inside.
When i create a car, it will set CarIDInfo[CID]++.
I than use /checkini(Just a random cmd name.. Nothing to do with its purposes) that will tell me what CarIDInfo[CID] is set to.
Than i have /setini, that suposely load the file, making CarIDInfo[CID] 0, as in the file it's writen 0, but it still same value.
Basicaly, it's just to understand how to load info from the file, so i can continue with my systems...
All i need to know is how to set CarIDInfo[CID] to the value wrote in ids.ini file.