Simple problem please 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)
+--- Thread: Simple problem please help (
/showthread.php?tid=524353)
Re: Simple problem please help -
friezakinght - 07.07.2014
Please somebody, I will +rep
Respuesta: Simple problem please help -
Siralos - 07.07.2014
Quote:
Originally Posted by friezakinght
Hi, I tried making a variable that reads a car value from the file
pawn Код:
new vv = format(file, sizeof(file), VEH_FILE, VehicleInfo[v][vValue]);
The problem is it gives 1 instead of 2000000, please help.
|
Upload the INI file and show it to us.
Re: Simple problem please help -
friezakinght - 07.07.2014
Every vehicle has it's own file, the define:
pawn Код:
#define VEH_FILE "FRICNR/Vehicles/%d.ini"
The .ini vehicle file
Код:
Model = 411
Color1 = 1
Color2 = 0
Price = 2000000
Owner = [AOD]Bogdi
PosX = 1729.681030
PosY = 1856.973999
PosZ = 10.651900
PosA = 1.703299
Plate = FriCNR
PaintJob = 0
Locked = 0
Neons = -1
Fuel = 100
Health = 1000.000000
Mod1 = 0
Mod2 = 0
Mod3 = 0
Mod4 = 0
Mod5 = 0
Mod6 = 0
Mod7 = 0
Mod8 = 0
Mod9 = 0
Mod10 = 0
Mod11 = 0
Mod12 = 0
Value = 2000000
EDIT: I tried using another code but still the value and the price is 0 even though the value and the price is set to 2.000.000 on the vehicle ini file
pawn Код:
new v = GetPlayerVehicleID(playerid);
new vfile[40];
format(vfile, sizeof(vfile), VEH_FILE, v);
INI_Load(vfile, true, playerid);
new smsg[100];
format(smsg, sizeof(smsg), "Vehicle value: %d | Vehicle Price: %d", VehicleInfo[v][vValue], VehicleInfo[v][vPrice]);
SendClientMessage(playerid, WHITE, smsg);
Re: Simple problem please help -
friezakinght - 07.07.2014
Pls help me, I really have to fix this.
Re: Simple problem please help -
friezakinght - 07.07.2014
Someone? I will +rep
Respuesta: Simple problem please help -
Siralos - 07.07.2014
For making this you have to understand how YSI_ini works.
Basically, you have to Load the INI file and create a function that 'reads' this file.
Re: Simple problem please help -
friezakinght - 07.07.2014
How can I create that function?
Re: Simple problem please help -
friezakinght - 07.07.2014
Please help...
Re: Simple problem please help -
BroZeus - 07.07.2014
learn basic pawn first