SA-MP Forums Archive
why this dini_Get gives me errors? - 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: why this dini_Get gives me errors? (/showthread.php?tid=389571)



why this dini_Get gives me errors? - niels44 - 02.11.2012

hey everyone,

i did this:
pawn Код:
PlayerInfo[playerid][currentcar] = dini_Get(file, "CurrentVehicle");
and it gives me this error:
pawn Код:
D:\Program Files\High Speed Drivers\gamemodes\HighSpeedDrivers.pwn(8328) : error 006: must be assigned to an array
i even checked the Dini.inc include, and there it says it has to be typed like this... i think the error is in the PlayerInfo[playerid][currentcar] but wuts so wrong with it?

greets niels


AW: why this dini_Get gives me errors? - Skimmer - 02.11.2012

dini_Get() returns a string! And your variable PlayerInfo[playerid][currentcar], can't save a string.

Try

pawn Код:
dini_Int(file, "CurrentVehicle");
pawn Код:
PlayerInfo[playerid][currentcar] = dini_Int(file, "CurrentVehicle");



Re: why this dini_Get gives me errors? - niels44 - 02.11.2012

no, it has to save this:
pawn Код:
CreateVehicleInWorld(411, -1978.92550000, 303.73750000, 35.17190000, 187.10190000, -1, -1, GetPlayerVirtualWorld(playerid));
thats wut it should save in CurrentVehicle, thas not an integer, so i thought of a string


AW: why this dini_Get gives me errors? - Skimmer - 02.11.2012

Try then this

pawn Код:
format(PlayerInfo[playerid][currentcar], 128, "%s", dini_Get(file, "CurrentVehicle"));



Re: why this dini_Get gives me errors? - tyler12 - 02.11.2012

Use dini_Get in a format.


Re: why this dini_Get gives me errors? - niels44 - 02.11.2012

ah worked ty