Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kewun on Jul 26, 2016, 07:44 PM

Title: param 4 has invalid type, expected string
Post by: Kewun on Jul 26, 2016, 07:44 PM
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?
Title: Re: param 4 has invalid type, expected string
Post by: Mötley on Jul 26, 2016, 08:27 PM
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
Title: Re: param 4 has invalid type, expected string
Post by: Kewun on Jul 26, 2016, 09:06 PM
ill try it next day, im sleeping.



and playing on android at same time[size]
Title: Re: param 4 has invalid type, expected string
Post by: DizzasTeR on Jul 27, 2016, 07:21 AM
Try vee.ID.tostring()
Title: Re: param 4 has invalid type, expected string
Post by: Kewun on Jul 27, 2016, 07:21 AM
k, testing right now.
Title: Re: param 4 has invalid type, expected string
Post by: Kewun on Jul 27, 2016, 07:34 AM
now


[vehicle]
id                             = 179.000000



in the .ini

:/ i want to save for every veh, veh1,veh2,veh3,veh4, etc ..
Title: Re: param 4 has invalid type, expected string
Post by: KAKAN on Jul 27, 2016, 08:28 AM
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() );
  }
 }
}