Simple Fuel Saving/Loading System [Help] - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Simple Fuel Saving/Loading System [Help] (
/showthread.php?tid=155324)
Simple Fuel Saving/Loading System [Help] -
zombie13333 - 17.06.2010
I have it to where when the server starts the first time, it creates all the vehicle files. (VEHICLEID.ini)
Then when I enter a vehicle, it loads the VehicleID File based by VehicleID.
Now I want it to load the text "Fuel = ##"
At The Top Of The GM:
Код:
Float:Fuel[MAX_VEHICLES]
So what I have for entering vehicle is:
Код:
new File_Fuel = dini_Int(VehicleFile, "Fuel");
Fuel[File_VehicleID] = File_Fuel;
Obviously, there is more code. But pretty self-explainitory.
So, Fuel is the Variable I use for my fuel system. (0-100)
Now I want it to load the Fuel Number from the dini file.
It compiled good. I went in-game and enter a vehicle. The Vehicle has no fuel
None of the vehicles have fuel now?
Код:
In My Vehicle File I Have This:
ID=0
Owner=None
ZVehicleID=439
Fuel=84
CarX=1834.857666
CarY=-1871.735351
CarZ=13.283900
Rotation=180.000000
CarColor1=25
CarColor2=78
Respawn_Delay=0
CarFaction=0
Price=560
What's wrong with the code?
Should It be somewhere else other than OnPlayerEnterStreamVehicle?
Re: Simple Fuel Saving/Loading System [Help] -
Antonio [G-RP] - 18.06.2010
You might have wrong control structures where you are freezing the player if there isn't a fuel.