CMD:savebiz(playerid, params[]) { new DB_Query[2000]; //Running a query to save the player's data using the stored stuff. for(new i; i <= MAX_BUSINESS; i++) { if(Business[i][Used]) { mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `BUSINESS` SET `NAME` = %s, `TYPE` = %d, `PRODUCT` = %d, `FEE` = %d, `SAFE` = %d, `VW` = %d, `INT` = %d, `OWNER` = %d, `PRICE` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f WHERE `ID` = %d LIMIT 1", Business[i][Name],Business[i][Type],Business[i][Product],Business[i][Fee],Business[i][Safe],Business[i][Vw],Business[i][Int],Business[i][Owner],Business[i][Price],Business[i][PosX],Business[i][PosY],Business[i][PosZ],i); mysql_tquery(Database, DB_Query); } } return SendClientMessage(playerid, COLOR_RED,"DONE DONE DONE DONE"); }
enum ENUM_BUSINESS_DATA { Name[125], Type, Product, Fee, Safe, Vw, Int, Owner, Price, Float:PosX, Float:PosY, Float:PosZ, Text3D: BizText[MAX_BUSINESS], bool: Used, }
CMD:savebiz(playerid, params[])
{
new DB_Query[2000];
//Running a query to save the player's data using the stored stuff.
for(new i; i < MAX_BUSINESS; i++)
{
if(Business[i][Used])
{
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `BUSINESS` SET `NAME` = %s, `TYPE` = %d, `PRODUCT` = %d, `FEE` = %d, `SAFE` = %d, `VW` = %d, `INT` = %d, `OWNER` = %d, `PRICE` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f WHERE `ID` = %d LIMIT 1",
Business[i][Name],Business[i][Type],Business[i][Product],Business[i][Fee],Business[i][Safe],Business[i][Vw],Business[i][Int],Business[i][Owner],Business[i][Price],Business[i][PosX],Business[i][PosY],Business[i][PosZ],i);
mysql_tquery(Database, DB_Query);
}
}
return SendClientMessage(playerid, COLOR_RED,"DONE DONE DONE DONE");
}
CMD:savebiz(playerid, params[])
{
new DB_Query[2000];
for(new i = 0; i < MAX_BUSINESS; i++)
{
if(Business[i][Used] == true)
{
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `BUSINESS` SET `NAME`='%s',`TYPE`='%d',`PRODUCT`='%d',`FEE`='%d',`SAFE`='%d',`VW`='%d',`INT`='%d',`OWNER`='%s',`PRICE`='%d',`PosX`='%f',`PosY`='%f',`PosZ`='%f' WHERE `ID`='%d' LIMIT 1", Business[i][Name],Business[i][Type],Business[i][Product],Business[i][Fee],Business[i][Safe],Business[i][Vw],Business[i][Int],Business[i][Owner],Business[i][Price],Business[i][PosX],Business[i][PosY],Business[i][PosZ],i);
mysql_tquery(Database, DB_Query);
}
}
SendClientMessage(playerid, COLOR_RED,"DONE DONE DONE DONE");
return 1;
}
enum ENUM_BUSINESS_DATA
{
Name[125],
Type,
Product,
Fee,
Safe,
Vw,
Int,
Owner[MAX_PLAYER_NAME],
Price,
Float:PosX,
Float:PosY,
Float:PosZ,
Text3D:BizText,
bool: Used,
}
new Business[MAX_BUSINESS][ENUM_BUSINESS_DATA];
Aigh thank you the loop stuff worked but now the saving process is not working lol. However, kovac I'm saving it like that cuz I wanna make sure that everything is working alright then I will add more stuffs ! thank you very much <3
|