20.03.2018, 10:46
Quote:
Assuming your business name enum is saved as a string you could try replacing:
Код:
cache_get_value(i, "NAME", Business[i][Name], 128); Код:
cache_get_value_name(i, "NAME", Business[i][Name], 128); |
Quote:
Are u using auto increment? Also note that update only works if the row exists. to create a new row use INSERT INTO
|
Код:
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; }