SA-MP Forums Archive
Unknown Gamemode - 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: Unknown Gamemode (/showthread.php?tid=597743)



Unknown Gamemode - Zamora - 04.01.2016

Hello there, I'm facing a proplem with my gamemode, In my server it SAVES chars and others every 30 minute, Everytime it saves the businesses the gamemode crash, like any command we type it be UNKNOWN COMMAND. and anyone wants to login he cant such that..

Here is the SaveBusiness

pawn Код:
stock SaveBusiness()
{
    if(!fexist("business.cfg")) fcreate("business.cfg");
    new idx = 1, File:file;
    new string[128], string1[256];
    while(idx < MAX_BIZ)
    {
        format(string1, sizeof(string1), "%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|", BizInfo[idx][bType], BizInfo[idx][bStatus], BizInfo[idx][bOwner], BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], BizInfo[idx][bMoney], BizInfo[idx][bProducts], BizInfo[idx][bSold], BizInfo[idx][bLevel], BizInfo[idx][bPrice], BizInfo[idx][bAP], BizInfo[idx][bCellphone], BizInfo[idx][bPhonebook], BizInfo[idx][bDice], BizInfo[idx][bCigar], BizInfo[idx][bSprunk], BizInfo[idx][bSpraycan]);
        strcat(string, string1, sizeof(string1));
        format(string1, sizeof(string1), "%d|%d|%d|%d|%d|%d|%d|%d|%d|%s\r\n", BizInfo[idx][bRope], BizInfo[idx][bMask], BizInfo[idx][bBlindfold], BizInfo[idx][bWalkietalkie], BizInfo[idx][bMP3], BizInfo[idx][bCamera], BizInfo[idx][bGascan], BizInfo[idx][bBoombox], BizInfo[idx][bSpeedo], BizInfo[idx][bMessage]);
        strcat(string, string1, sizeof(string1));
        if(idx == 1)
        {
            file = fopen("business.cfg", io_write);
        }
        else
        {
            file = fopen("business.cfg", io_append);
        }
        fwrite(file, string);
        fclose(file);
        idx++;
    }
    print("Businesses saved successfully.");
}
Sorry for my bad English.


Re: Unknown Gamemode - Zamora - 04.01.2016

Bump


Re: Unknown Gamemode - Stones - 04.01.2016

Код:
stock SaveBusiness()
{
    if(!fexist("business.cfg")) fcreate("business.cfg");
	new idx = 1, File:file;
	new string[128], string1[256];
	while(idx < MAX_BIZ)
	{
        format(string1, sizeof(string1), "%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|", BizInfo[idx][bType], BizInfo[idx][bStatus], BizInfo[idx][bOwner], BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], BizInfo[idx][bMoney], BizInfo[idx][bProducts], BizInfo[idx][bSold], BizInfo[idx][bLevel], BizInfo[idx][bPrice], BizInfo[idx][bAP], BizInfo[idx][bCellphone], BizInfo[idx][bPhonebook], BizInfo[idx][bDice], BizInfo[idx][bCigar], BizInfo[idx][bSprunk], BizInfo[idx][bSpraycan]);
        strcat(string, string1, sizeof(string1));
        format(string1, sizeof(string1), "%d|%d|%d|%d|%d|%d|%d|%d|%d|%s\r\n", BizInfo[idx][bRope], BizInfo[idx][bMask], BizInfo[idx][bBlindfold], BizInfo[idx][bWalkietalkie], BizInfo[idx][bMP3], BizInfo[idx][bCamera], BizInfo[idx][bGascan], BizInfo[idx][bBoombox], BizInfo[idx][bSpeedo], BizInfo[idx][bMessage]);
        strcat(string, string1, sizeof(string1);
	    if(idx == 1)
	    {
	        file = fopen("business.cfg", io_write);
	    }
	    else
	    {
	    	file = fopen("business.cfg", io_append);
	    }
		fwrite(file, string);
		fclose(file);
		idx+;
	}
	print("Businesses saved successfully.");
}