why this dini_Get gives me errors?
#1

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
Reply
#2

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");
Reply
#3

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
Reply
#4

Try then this

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

Use dini_Get in a format.
Reply
#6

ah worked ty
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)