GetVehicleDamageStatus
#1

Will it work? it will right panels doors lights and tires damage values? or i need to use integers %d %i bla bla bla?
if i do help me modify that code becasue i have no how to use it in loop on INI file.


Код:
for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
				{
					new panels, doors, lights, tires;
					GetVehicleDamageStatus(PlayerVehicleInfo[playerid][v][pvId], panels, doors, lights, tires);
					format(var, 32, "pv%dDamageStatus", v);
					INI_WriteString(File, var, PlayerVehicleInfo[playerid][v][pvDamageStatus]);
Reply
#2

I'm not sure if what I understood is what you meant, but you can use those variables (panels, doors, lights, tires) as arguments (3rd) in the INI_WriteInt function. You need to use format only for the key's name since you use the vehicleid in it.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I'm not sure if what I understood is what you meant, but you can use those variables (panels, doors, lights, tires) as arguments (3rd) in the INI_WriteInt function. You need to use format only for the key's name since you use the vehicleid in it.
What do you mean? can you give an little example?
Reply
#4

Let's say you save the lights for each vehicle:
pawn Код:
format(var, 32, "pv%dlights", v);
INI_WriteInt(File, var, lights);
unless you meant something else.
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Let's say you save the lights for each vehicle:
pawn Код:
format(var, 32, "pv%dlights", v);
INI_WriteInt(File, var, lights);
unless you meant something else.
Yes i meant that.
But there is any other way to do it like:
Код:
format(var, 32, "pv%d panels=%d doors=%d lights=%d tires=%d", v, panels, doors, lights, tires);
INI_WriteInt(File, var); or WriteString
Will it work? what to choose integer or string?
Reply
#6

I wouldn't recommend to use it as string because after loading, you would need to split it up and assign the values on the variables. Doing it like the example I showed you is simplier and easier method.
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I wouldn't recommend to use it as string because after loading, you would need to split it up and assign the values on the variables. Doing it like the example I showed you is simplier and easier method.
Dude, INI file for each player is 8 KB, i really need the shortest lines...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)