SA-MP Forums Archive
INI_WriteString 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: INI_WriteString help (/showthread.php?tid=476767)



INI_WriteString help - ScrubKid - 20.11.2013

I've been trying to find a way to record the owner of the vehicle but keep getting errors such as
error 035: argument type mismatch (argument 3)

Код:
INI_String("Owner",VehicleInfo[idx][vOwner], 24);

new name[24];
format(name, sizeof(name), GetName(playerid));
INI_WriteString(File,"Owner", VehicleInfo[vehID][vOwner] = name);

stock GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, 24);
    if(playerid == INVALID_PLAYER_ID)
        name = "Disconnected / Offline";
    return name;
}
This is all I think you need to see. If anyone could help it'd be much appreciated so I can move on with my script.


Re: INI_WriteString help - AIped - 20.11.2013

try;


pawn Код:
INI_WriteString(File,"Owner", VehicleInfo[vehID][vOwner]);



Re: INI_WriteString help - ScrubKid - 20.11.2013

That doesn't work seeing as it has nothing to write as the owner.


Re: INI_WriteString help - AIped - 20.11.2013

did you at least test it ? the owner variable has to be set before saving it, then it goes automaticly and you wont need the = name part you had.

It works for me , do you have any errors ?


Re: INI_WriteString help - ScrubKid - 20.11.2013

Quote:
Originally Posted by AIped
Посмотреть сообщение
did you at least test it ? the owner variable has to be set before saving it, then it goes automaticly and you wont need the = name part you had.

It works for me , do you have any errors ?
I tested it, yes. It returns nothing as the owner.


Re: INI_WriteString help - AIped - 20.11.2013

hmm...under wich public do you save ?

EDIT: after writing you need INI_Close(File); did you do that too ?


Re: INI_WriteString help - ScrubKid - 20.11.2013

You mean like this?

Код:
public LoadVehicles_data(idx,name[],value[])
E: And yes I did close the file. I have a lot more things then owner. This is the only one that requires using letters though.


Re: INI_WriteString help - AIped - 20.11.2013

does it save the other things besides owner ?


Re: INI_WriteString help - ScrubKid - 20.11.2013

Yes, it's only this one due to it being the first time I'm using INI_Strings and all.


Re: INI_WriteString help - ScrubKid - 20.11.2013

I forgot to mention the error is on this line;
Код:
INI_WriteString(File,"Owner", VehicleInfo[vehID][vOwner] = name);