Problem with saving/loading
#5

Quote:
Originally Posted by Chyakka
Посмотреть сообщение
Assuming your business name enum is saved as a string you could try replacing:

Код:
cache_get_value(i, "NAME", Business[i][Name], 128);
with
Код:
cache_get_value_name(i, "NAME", Business[i][Name], 128);
If that fails to work go to your logs > plugins folder and put your mysql.log in a pastebin.
Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Are u using auto increment? Also note that update only works if the row exists. to create a new row use INSERT INTO
I'm not using auto increment ! and yeah I get your points there's the stuff

Код:
CMD:createbusiness(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
	    if(pInfo[playerid][Admin] >= 3)
	    {
	        for(new i; i <= MAX_BUSINESS; i++)
	        {
	            if(Business[i][Used] = false)
	            {
	                new Float: x,Float: y,Float: z;
	                new string[500];
	                new DB_Query[500];
	                new name[24] = "BUSINESS";
	                GetPlayerPos(playerid, x,y,z);
		            Business[i][PosX] = x;
	                Business[i][PosY] = y;
	                Business[i][PosZ] = z;
	                Business[i][Fee] = 0;
	                Business[i][Type] = 0;
	                Business[i][Product] = 0;
	                Business[i][Owner] = -1;
	                Business[i][Price] = 30000;
	                Business[i][Vw] = GetPlayerVirtualWorld(playerid);
	                Business[i][Int] = GetPlayerInterior(playerid);
	                Business[i][Used] = true;
	                format(string, sizeof(string),"\t ID : %d\nName : BUSINESS\nType : %s\nPrice : %d",i,GetBusinessType(Business[i][Type]),Business[i][Price]);
	                Business[i][BizText] = Create3DTextLabel(string, COLOR_ADMIN, Business[i][PosX], Business[i][PosY], Business[i][PosZ], 10.0, Business[i][Vw], Business[i][Int]);
	                mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `BUSINESS` (`NAME`, `PosX`, `PosY`,`PosZ`, `FEE`, `TYPE`, `ID` , `PRODUCT`, `OWNER`, `VW`, `INT`, `PRICE`	) VALUES ('%s', '%f','%f','%f','0','0','%d','0','-1','%d','%d','30000')",name,Business[i][PosX],Business[i][PosY], Business[i][PosZ],i,Business[i][Vw],Business[i][Int]);
	                mysql_tquery(Database, DB_Query);
					break;
	            }
	        }
	    }
	}
	return 1;
}
Reply


Messages In This Thread
Problem with saving/loading - by Nru - 19.03.2018, 21:28
Re: Problem with saving/loading - by Chyakka - 19.03.2018, 23:24
Re: Problem with saving/loading - by Nru - 20.03.2018, 09:45
Re: Problem with saving/loading - by jasperschellekens - 20.03.2018, 10:03
Re: Problem with saving/loading - by Nru - 20.03.2018, 10:46
Re: Problem with saving/loading - by iKarim - 20.03.2018, 10:50
Re: Problem with saving/loading - by Nru - 20.03.2018, 10:56
Re: Problem with saving/loading - by kovac - 20.03.2018, 12:54
Re: Problem with saving/loading - by Nru - 20.03.2018, 13:23
Re: Problem with saving/loading - by Nru - 20.03.2018, 16:03

Forum Jump:


Users browsing this thread: 3 Guest(s)