SA-MP Forums Archive
A little problem with saving - 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: A little problem with saving (/showthread.php?tid=284220)



A little problem with saving - Coffeemonster - 18.09.2011

I don't like making people do things for me but this is now too much for my tired brains, It's always giving error and stuff about undefined things or definition matches.

So my request is, I need this thing converted from SII to y_ini...

Code:

Код:
forward LoadGangs();
public LoadGangs()
{
    printf("Loading Gangs...");
    for(new i = 1; i < MAX_GANGS; i++)
    {
        format(GangStat[i][GangFile], 60, "Gangs/Gang %d.ini", i);
        if(INI_Open(GangStat[i][GangFile]))
	    {
           INI_String(GangStat[i][Leader],"Leader",60);
           INI_String(GangStat[i][GangName],"Name",60);
           INI_String(GangStat[i][MOTD],"MOTD", 128);

           INI_String(GangStat[i][Rank1],"Rank1",60);
           INI_String(GangStat[i][Rank2],"Rank2",60);
           INI_String(GangStat[i][Rank3],"Rank3",60);
           INI_String(GangStat[i][Rank4],"Rank4",60);
           INI_String(GangStat[i][Rank5],"Rank5",60);
           INI_String(GangStat[i][Rank6],"Rank6",60);

           GangStat[i][Skin1] = INI_Int("Skin1");
           GangStat[i][Skin2] = INI_Int("Skin2");
           GangStat[i][Skin3] = INI_Int("Skin3");
           GangStat[i][Skin4] = INI_Int("Skin4");
           GangStat[i][Skin5] = INI_Int("Skin5");
           GangStat[i][Skin6] = INI_Int("Skin6");
           GangStat[i][fSkin] = INI_Int("fSkin");

           GangStat[i][Members] = INI_Int("Members");

           GangStat[i][Color] = INI_Int("Color");

           INI_Save();
           INI_Close();
        }
    }
    printf("Gangs Loaded.");
	return 1;
}

stock SaveGang(gangid)
{
    format(GangStat[gangid][GangFile], 20, "Gangs/Gang %d.ini", gangid);
    if(INI_Open(GangStat[gangid][GangFile]))
    {

        INI_WriteString("Leader", GangStat[gangid][Leader]);
		INI_WriteString("Name", GangStat[gangid][GangName]);
		INI_WriteString("MOTD", GangStat[gangid][MOTD]);

		INI_WriteString("Rank1", GangStat[gangid][Rank1]);
		INI_WriteString("Rank2", GangStat[gangid][Rank2]);
		INI_WriteString("Rank3", GangStat[gangid][Rank3]);
		INI_WriteString("Rank4", GangStat[gangid][Rank4]);
		INI_WriteString("Rank5", GangStat[gangid][Rank5]);
		INI_WriteString("Rank6", GangStat[gangid][Rank6]);

		INI_WriteInt("Skin1", GangStat[gangid][Skin1]);
		INI_WriteInt("Skin2", GangStat[gangid][Skin2]);
		INI_WriteInt("Skin3", GangStat[gangid][Skin3]);
		INI_WriteInt("Skin4", GangStat[gangid][Skin4]);
		INI_WriteInt("Skin5", GangStat[gangid][Skin5]);
		INI_WriteInt("Skin6", GangStat[gangid][Skin6]);
		INI_WriteInt("fSkin", GangStat[gangid][fSkin]);

		INI_WriteInt("Members", GangStat[gangid][Members]);

		INI_WriteInt("Color", GangStat[gangid][Color]);

		INI_Save();
		INI_Close();
    }
	return 1;
}
Код:
(354) : error 017: undefined symbol "name"
error 001: expected token: "-string end-", but found "-identifier-"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
fatal error 107: too many error messages on one line



Re: A little problem with saving - =WoR=G4M3Ov3r - 18.09.2011

Post the errors please.


Re: A little problem with saving - Coffeemonster - 18.09.2011

Okay I tried again, still no success. Maybe Im too dumb but this would be needed..


Re: A little problem with saving - Coffeemonster - 19.09.2011

Anyone?


Re: A little problem with saving - usersamp - 19.09.2011

What is the String 354.


Re: A little problem with saving - GrimR - 19.09.2011

Pastebin more or all of source if not too large maybe (or at least the lines that PAWN says the error is on).

Also unless you actually need something yini has that SII does not, don't bother switching. I just converted from DINI to SII and it's perfect and fast as, I could not get yini to work either *shrugs*.