param 4 has invalid type, expected string

Started by Kewun, Jul 26, 2016, 07:44 PM

Previous topic - Next topic

Kewun

function SaveCars()
{
for(local a = 0; a < GetVehicleCount(); a ++)
{
local vee = FindVehicle(a);
if(vee) {
WriteIniString("Stats.ini","Vehicle", "ID", vee.ID.tointeger() ) // the error appears here.
}
}
}

So i want to write all vehicle ids, in the ini and im getting this gay error as escribed in the topic title
how fix?

Mötley

#1
Have you tried using WriteIniNumber just for the heck of it?

As I mean I think it's possible.

Of course I will be honest I have been drinking

Of course there is no real documentation what WriteIniNumber is used for. I know positions work, But I do not this it's only for float values

Kewun

ill try it next day, im sleeping.



and playing on android at same time[size]

DizzasTeR


Kewun


Kewun

now


[vehicle]
id                             = 179.000000



in the .ini

:/ i want to save for every veh, veh1,veh2,veh3,veh4, etc ..

KAKAN

Use this:
function SaveCars()
{
 for(local a = 0; a < GetVehicleCount(); a ++)
 {
  local vee = FindVehicle(a);
  if(vee) {
   WriteIniString("Stats.ini","Vehicle" + i, "ID", vee.ID.tostring() );
  }
 }
}
oh no