SA-MP Forums Archive
INI_String 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: INI_String errors (/showthread.php?tid=516138)



INI_String errors - Aerotactics - 29.05.2014

Brief: I don't know why this is happening, so if you could explain the problem that would be nice. I'm familiar with y_ini, but I never took the time to actually sit down and learn how to write it.

Код:
C:\Users\Aerotactics\Desktop\SAMP testing\gamemodes\rp.pwn(49) : error 001: expected token: ")", but found "["
C:\Users\Aerotactics\Desktop\SAMP testing\gamemodes\rp.pwn(49) : warning 215: expression has no effect
C:\Users\Aerotactics\Desktop\SAMP testing\gamemodes\rp.pwn(49) : error 001: expected token: ";", but found "]"
C:\Users\Aerotactics\Desktop\SAMP testing\gamemodes\rp.pwn(49) : error 029: invalid expression, assumed zero
C:\Users\Aerotactics\Desktop\SAMP testing\gamemodes\rp.pwn(49) : fatal error 107: too many error messages on one line
pawn Код:
enum bizinfo
{
    Float:EnX,
    Float:EnY,
    Float:EnZ,

    Float:ExX,
    Float:ExY,
    Float:ExZ,
   
    bizname[64],
    bowner[64],
    bprice,
    bincome,
    btype
}
new bInfo[MAX_BIZ][bizinfo];

//Error line
INI_String("BizName", bInfo[BizID][bizname], sizeof(bInfo[BizID][bizname]));
EDIT: added enum
EDIT 2: updated enum
EDIT 3: RESOLVED


Re: INI_String errors - awsomedude - 29.05.2014

Try putting the exact size of it instead of putting sizeof.


Re: INI_String errors - R0 - 29.05.2014

Try this:
pawn Код:
INI_String("BizName", bInfo[BizID][bizname], 128));
And when you want to define [bizname] under bInfo,change it to
pawn Код:
bizname[128],



Re: INI_String errors - Aerotactics - 29.05.2014

Quote:
Originally Posted by awsomedude
Посмотреть сообщение
Try putting the exact size of it instead of putting sizeof.
That's what it was at first, same errors.

Quote:
Originally Posted by R0
Посмотреть сообщение
You want it to save or load?
This is the loading script.

Quote:
Originally Posted by R0
Посмотреть сообщение
Try this:
pawn Код:
INI_String("BizName", bInfo[BizID][bizname], 128));
And when you want to define [bizname] under bInfo,change it to
pawn Код:
bizname[128],
Same errors.

EDIT: I missed the removed sizeof. It worked, thanks.