[+Rep] Mysql Can't Save Setting !
#1

I try to create mysql System but they not working when im try on my server

Anyone can help me pls !

Load Mysql
PHP код:
stock LoadBizs()
{
    
printf("[Loadbusiness] Dang Tai Du Lieu Tu Database....");
    
mysql_function_query(MainPipeline"SELECT * FROM `business`"true"OnLoadBizs""");
}
forward OnLoadBizs();
public 
OnLoadBizs()
{
    new 
string[512], i;
    new 
businesstype[128];
    new 
rowsfields;
    
cache_get_data(rowsfieldsMainPipeline);
    while(
i<rows)
    {
        for(new 
field;field<fields;field++)
        {
             
cache_get_row(ifieldstringMainPipeline);
            switch(
field)
            {
                case 
0BizzInfo[i][bSQLId] = strval(string);
                case 
1BizzInfo[i][bOwned] = strval(string);
                case 
2format(BizzInfo[i][bOwner], 24"%s"string);
                case 
3format(BizzInfo[i][bMessage], 255"%s"string);
                case 
4BizzInfo[i][bPickupID] = strval(string);
                case 
5BizzInfo[i][bIconID] = strval(string);
                case 
6BizzInfo[i][bIconType] = strval(string);
                case 
7BizzInfo[i][bVirWorld] = strval(string);
                case 
8BizzInfo[i][bExtortion] = strval(string);
                case 
9BizzInfo[i][bLevelNeeded] = strval(string);
                case 
10BizzInfo[i][bBuyPrice] = strval(string);
                case 
11BizzInfo[i][bEntranceCost] = strval(string);
                case 
12BizzInfo[i][bBizBank] = strval(string);
                case 
13BizzInfo[i][bLocked] = strval(string);
                case 
14BizzInfo[i][bProducts] = strval(string);
                case 
15BizzInfo[i][bPriceProd] = strval(string);
                case 
16BizzInfo[i][bDelivProd] = strval(string);
                case 
17BizzInfo[i][bPercent] = strval(string);
                case 
18BizzInfo[i][bType] = strval(string);
                case 
19BizzInfo[i][bInterior] = strval(string);
                case 
20BizzInfo[i][bInteriorID] = strval(string);
                case 
21BizzInfo[i][bExteriorID] = strval(string);
                case 
22BizzInfo[i][bExitX] = floatstr(string);
                case 
23BizzInfo[i][bExitY] = floatstr(string);
                case 
24BizzInfo[i][bExitZ] = floatstr(string);
                case 
25BizzInfo[i][bEntranceX] = floatstr(string);
                case 
26BizzInfo[i][bEntranceY] = floatstr(string);
                case 
27BizzInfo[i][bEntranceZ] = floatstr(string);
                case 
28BizzInfo[i][bDeliverX] = floatstr(string);
                case 
29BizzInfo[i][bDeliverY] = floatstr(string);
                case 
30BizzInfo[i][bDeliverZ] = floatstr(string);
                case 
31BizzInfo[i][bGiaSP1] = strval(string);
                case 
32BizzInfo[i][bGiaSP2] = strval(string);
                case 
33BizzInfo[i][bGiaSP3] = strval(string);
                case 
34BizzInfo[i][bGiaSP4] = strval(string);
                case 
35BizzInfo[i][bGiaSP5] = strval(string);
                case 
36BizzInfo[i][bGiaSP6] = strval(string);
                case 
37BizzInfo[i][bGiaSP7] = strval(string);
                case 
38BizzInfo[i][bGiaSP8] = strval(string);
                case 
39BizzInfo[i][bGiaSP9] = strval(string);
                case 
40BizzInfo[i][bGiaSP10] = strval(string);
                case 
41BizzInfo[i][bGiaSP11] = strval(string);
                case 
42BizzInfo[i][bGiaSP12] = strval(string);
                case 
43BizzInfo[i][bGiaSP13] = strval(string);
                case 
44BizzInfo[i][bGiaSP14] = strval(string);
                case 
45BizzInfo[i][bGiaSP15] = strval(string);
                case 
46BizzInfo[i][bPickkupModel] = strval(string);
                case 
47BizzInfo[i][bWeapons1] = strval(string);
                case 
48BizzInfo[i][bWeapons2] = strval(string);
                case 
49BizzInfo[i][bWeapons3] = strval(string);
                case 
50BizzInfo[i][bWeapons4] = strval(string);
                case 
51BizzInfo[i][bWeapons5] = strval(string);
                case 
52BizzInfo[i][bWeapons6] = strval(string);
                case 
53BizzInfo[i][bWeapons7] = strval(string);
                case 
54BizzInfo[i][bWeapons8] = strval(string);
                case 
55BizzInfo[i][bWeapons9] = strval(string);
                 case 
56BizzInfo[i][bWeapons10] = strval(string);
                 case 
57BizzInfo[i][bVatLieu] = strval(string);
                case 
58BizzInfo[i][bGiaMua] = strval(string);
                case 
59BizzInfo[i][bLuong] [0]= strval(string);
                 case 
60BizzInfo[i][bLuong] [1] = strval(string);
                 case 
61BizzInfo[i][bLuong] [2] = strval(string);
                case 
62BizzInfo[i][bLuong] [3] = strval(string);
                 case 
63BizzInfo[i][bLuong] [4] = strval(string);
                 case 
64BizzInfo[i][bLuong] [5] = strval(string);
                 case 
65BizzInfo[i][bBaoKe] = strval(string);
            }
        }
        
PickUpBiz(i);
        
//BizzInfo[i][bPickupID] = CreatePickupEx(1274, 23, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ], 0 );
        
SpawnedBusinesses++;
        if(
BizzInfo[i][bType] > 0)
        {
            if(
BizzInfo[i][bType] == 1) { businesstype "Gas Station"BizzInfo[i][bIconType] = 17;}
            else if(
BizzInfo[i][bType] == 2) { businesstype "Clothes Store"BizzInfo[i][bIconType] = 45;}
            else if(
BizzInfo[i][bType] == 3) { businesstype "Club"BizzInfo[i][bIconType] = 49;}
            else if(
BizzInfo[i][bType] == 4) { businesstype "Ammunation"BizzInfo[i][bIconType] = 6;}
            else if(
BizzInfo[i][bType] == 5) { businesstype "Casino"BizzInfo[i][bIconType] =  BizzInfo[i][bIconType] = 25;}
            else if(
BizzInfo[i][bType] == 6) { businesstype "Restaurant"BizzInfo[i][bIconType] = 50;}
            else if(
BizzInfo[i][bType] == 7) { businesstype "Paintball"BizzInfo[i][bIconType] = 19;}
            else if(
BizzInfo[i][bType] == 8) { businesstype "Bank"BizzInfo[i][bIconType] = 52;}
            else if(
BizzInfo[i][bType] == 9) { businesstype "Electronic Store"BizzInfo[i][bIconType] = 48;}
            else if(
BizzInfo[i][bType] == 10) { businesstype "Locks Store"BizzInfo[i][bIconType] = 42;}
            else if(
BizzInfo[i][bType] == 11) { businesstype "Radio Shop"BizzInfo[i][bIconType] = 34; }
        }
        else
        {
            
businesstype "Dang xay dung";
        }
        
BizzInfo[i][bIconID] = CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ], BizzInfo[i][bIconType], 00, -1, -1100.0);
        new 
btext[30];
        if( 
BizzInfo[i][bLocked] == ) { btext "{33AA33}Open"; }
        if( 
BizzInfo[i][bLocked] == ) { btext "{AA3333}Close"; }
        if(
BizzInfo[i][bOwned] == 1)
        {
            
format(stringsizeof(string), "%s\n\n\n\n{9E9E9E}%s\n\n%s [ So Huu:  %s ]\nID: %d",btextbusinesstypeBizzInfo[i][bMessage], BizzInfo[i][bOwner], i);
            
business1[i] = CreateDynamic3DTextLabel(string0xFFFFFF88BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1100.0);
            
format(stringsizeof(string), "{808080}Dia Diem Van Chuyen Hang\n\t%s\n\t%s\nID: %d",businesstypeBizzInfo[i][bMessage],i);
            
business3[i] = CreateDynamic3DTextLabel(string0xFFFFFF88BizzInfo[i][bDeliverX]+ 1BizzInfo[i][bDeliverY]+1BizzInfo[i][bDeliverZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1100.0);
        }
        else
        {
            
format(stringsizeof(string), "%s\n\n\n\n{9E9E9E}%s \n\nBusiness For Sale!\nGia: $%s\nDe so huu no go lenh /buybiz\nID: %d",btextbusinesstype,( BizzInfo[i][bBuyPrice], 0',' ), i);
            
business2[i] = CreateDynamic3DTextLabel(string0xFFFFFF88BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1100.0);
            
format(stringsizeof(string), "{808080}Dia Diem Van Chuyen Hang\n\t%s\n\t%s\nID: %d",businesstypeBizzInfo[i][bMessage],i);
            
business3[i] = CreateDynamic3DTextLabel(string0xFFFFFF88BizzInfo[i][bDeliverX]+ 1BizzInfo[i][bDeliverY]+1BizzInfo[i][bDeliverZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1100.0);
        }
        
i++;
     }
    if(
0printf("[LoadBusiness] %d cua hang da tai thanh cong."i);
    else 
printf("[LoadBusiness] Da say ra loi khi load du lieu tu Data Base.");
    return 
1;

Enum
PHP код:
enum bInfo
{
    
bSQLId,
    
bOwned,
    
bRadio,
    
bOwner[255],
    
bMessage[255],
    
bPickupID,
    
bIconID,
    
bIconType,
    
bVirWorld,
    
bExtortion[255],
    
Float:bEntranceX,
    
Float:bEntranceY,
    
Float:bEntranceZ,
    
Float:bDeliverX,
    
Float:bDeliverY,
    
Float:bDeliverZ,
    
Float:bExitX,
    
Float:bExitY,
    
Float:bExitZ,
    
bLevelNeeded,
    
bBuyPrice,
    
bEntranceCost,
    
bBizBank,
    
bLocked,
    
bInteriorID,
    
bExteriorID,
    
bInterior,
    
bProducts,
    
bDelivProd,
    
bPercent,
    
bType,
    
BusinessProdPrice[26],
    
BusinessPrice,
    
BusinessPickup,
    
Text3D:BusinessLabel,
    
BusinessFee,
    
BusinessProducts,
    
bPriceProd,
    
bMaxProducts,
    
bGiaSP1,
    
bGiaSP2,
    
bGiaSP3,
    
bGiaSP4,
    
bGiaSP5,
    
bGiaSP6,
    
bGiaSP7,
    
bGiaSP8,
    
bGiaSP9,
    
bGiaSP10,
    
bGiaSP11,
    
bGiaSP12,
    
bGiaSP13,
    
bGiaSP14,
    
bGiaSP15,
    
bPickkupModel,
    
bWeapons1,
    
bWeapons2,
    
bWeapons3,
    
bWeapons4,
    
bWeapons5,
    
bWeapons6,
    
bWeapons7,
    
bWeapons8,
    
bWeapons9,
    
bWeapons10,
    
bVatLieu,
    
bGiaMua,
    
bLuong],
    
bBaoKe,
};
new 
BizzInfo[MAX_BUSINESSES][bInfo]; 
Save MYSQL

PHP код:
stock SaveBusiness(bizid)
{
    new 
string[2948];
    
format(stringsizeof(string), "UPDATE `business` SET \
        `Owned`=%d, \
        `Owner`='%s', \
        `Name`='%s', \
        `PickupID`=%d, \
        `IconID`=%d, \
        `IconType`=%d, \
        `VirtualWorld`=%d, \
        `Extortion`=%d, \
        `Level`=%d, \
        `Price`=%d, \
        `EntranceCost`=%d, \
        `BusinessBank`=%d, \
        `Locked`=%d, \
        `Products`=%d, \
        `PriceProd`=%d, \
        `DeliveringProducts`=%d, \
        `Percent`=%d, \
        `BusinessType`=%d, \
        `Interior`=%d, \
        `InteriorID`=%d, \
        `ExteriorID`=%d,"
,
        
BizzInfo[bizid][bOwned],
        
BizzInfo[bizid][bOwner],
        
BizzInfo[bizid][bMessage],
        
BizzInfo[bizid][bPickupID],
        
BizzInfo[bizid][bIconID],
        
BizzInfo[bizid][bIconType],
        
BizzInfo[bizid][bVirWorld],
        
BizzInfo[bizid][bExtortion],
        
BizzInfo[bizid][bLevelNeeded],
        
BizzInfo[bizid][bBuyPrice],
        
BizzInfo[bizid][bEntranceCost],
        
BizzInfo[bizid][bBizBank],
        
BizzInfo[bizid][bLocked],
        
BizzInfo[bizid][bProducts],
        
BizzInfo[bizid][bPriceProd],
        
BizzInfo[bizid][bDelivProd],
        
BizzInfo[bizid][bPercent],
        
BizzInfo[bizid][bType],
        
BizzInfo[bizid][bInterior],
        
BizzInfo[bizid][bInteriorID],
        
BizzInfo[bizid][bExteriorID]
    );
    
format(stringsizeof(string), "%s \
        `InteriorX`=%f, \
        `InteriorY`=%f, \
        `InteriorZ`=%f, \
        `EntranceX`=%f, \
        `EntranceY`=%f, \
        `EntranceZ`=%f, \
        `DeliverX`=%f, \
        `DeliverY`=%f, \
        `DeliverZ`=%f, \
        `GiaSP1`=%d, \
        `GiaSP2`=%d, \
        `GiaSP3`=%d, \
        `GiaSP4`=%d, \
        `GiaSP5`=%d, \
        `GiaSP6`=%d, \
        `GiaSP7`=%d, \
        `GiaSP8`=%d, \
        `GiaSP9`=%d, \
        `GiaSP10`=%d, \
        `GiaSP11`=%d, \
        `GiaSP12`=%d, \
        `GiaSP13`=%d, \
        `GiaSP14`=%d, \
        `GiaSP15`=%d, \
        `PickkupModel`=%d,"
,
        
string,
        
BizzInfo[bizid][bExitX],
        
BizzInfo[bizid][bExitY],
        
BizzInfo[bizid][bExitZ],
        
BizzInfo[bizid][bEntranceX],
           
BizzInfo[bizid][bEntranceY],
        
BizzInfo[bizid][bEntranceZ],
        
BizzInfo[bizid][bDeliverX],
        
BizzInfo[bizid][bDeliverY],
        
BizzInfo[bizid][bDeliverZ],
        
BizzInfo[bizid][bGiaSP1],
        
BizzInfo[bizid][bGiaSP2],
        
BizzInfo[bizid][bGiaSP3],
        
BizzInfo[bizid][bGiaSP4],
        
BizzInfo[bizid][bGiaSP5],
        
BizzInfo[bizid][bGiaSP6],
        
BizzInfo[bizid][bGiaSP7],
        
BizzInfo[bizid][bGiaSP8],
        
BizzInfo[bizid][bGiaSP9],
        
BizzInfo[bizid][bGiaSP10],
        
BizzInfo[bizid][bGiaSP11],
        
BizzInfo[bizid][bGiaSP12],
        
BizzInfo[bizid][bGiaSP13],
        
BizzInfo[bizid][bGiaSP14],
        
BizzInfo[bizid][bGiaSP15],
        
BizzInfo[bizid][bPickkupModel]
    );
    
format(stringsizeof(string), "%s \
        `Weapon0`=%d, \
        `Weapon1`=%d, \
        `Weapon2`=%d, \
        `Weapon3`=%d, \
        `Weapon4`=%d, \
        `Weapon5`=%d, \
        `Weapon6`=%d, \
        `Weapon7`=%d, \
        `Weapon8`=%d, \
        `Weapon9`=%d, \
        `VatLieu`=%d, \
        `GiaMuaVL`=%d, \
        `Luong1`=%d, \
        `Luong2`=%d, \
        `Luong3`=%d, \
        `Luong4`=%d, \
        `Luong5`=%d, \
        `Luong6` =%d,\
        `BaoKe`= %d WHERE `id`=%d"
,
        
string,
        
BizzInfo[bizid][bWeapons1],
        
BizzInfo[bizid][bWeapons2],
        
BizzInfo[bizid][bWeapons3],
        
BizzInfo[bizid][bWeapons4],
        
BizzInfo[bizid][bWeapons5],
        
BizzInfo[bizid][bWeapons6],
        
BizzInfo[bizid][bWeapons7],
        
BizzInfo[bizid][bWeapons8],
        
BizzInfo[bizid][bWeapons9],
        
BizzInfo[bizid][bWeapons10],
        
BizzInfo[bizid][bVatLieu],
        
BizzInfo[bizid][bGiaMua],
        
BizzInfo[bizid][bLuong] [0],
        
BizzInfo[bizid][bLuong] [1],
        
BizzInfo[bizid][bLuong] [2],
        
BizzInfo[bizid][bLuong] [3],
        
BizzInfo[bizid][bLuong] [4],
        
BizzInfo[bizid][bLuong] [5],
        
BizzInfo[bizid][bBaoKe],
        
bizid+1
    
); // Array starts from zero, MySQL starts at 1 (this is why we are adding one).
    
mysql_function_query(MainPipelinestringfalse"OnQueryFinish""i"SENDDATA_THREAD);

Log Error
PHP код:
[01:21:11UPDATE `businessSET `Owned`=0, `Owner`='', `Name`='', `PickupID`=427, `IconID`=28, `IconType`=45, `VirtualWorld`=182255, `Extortion`=0, `Level`=0, `Price`=1, `EntranceCost`=0, `BusinessBank`=0, `Locked`=1, `Products`=0, `PriceProd`=0, `DeliveringProducts`=0, `Percent`=0, `BusinessType`=2, `Interior`=6, `InteriorID`=0, `ExteriorID`=0, `InteriorX`=748.397766, `InteriorY`=1437.077270, `InteriorZ`=1102.953125, `EntranceX`=-1560.782958, `EntranceY`=107.523048, `EntranceZ`=3.554687, `DeliverX`=0.000000, `DeliverY`=0.000000, `DeliverZ`=0.000000, `GiaSP1`=0, `GiaSP2`=0, `GiaSP3`=0, `GiaSP4`=0, `GiaSP5`=0, `GiaSP6`=0, `GiaSP7`=0, `GiaSP8`=0, `GiaSP9`=0, `GiaSP10`=0, `GiaSP11`=0, `GiaSP12`=0, `GiaSP13`=0, `GiaSP14`=0, `GiaSP15`=0, `PickkupModel`=0, `Weapon0`=0, `Weapon1`=0, `Weapon2`=0, `Weapon3`=0, `Weapon4`=0, `Weapon5`=0, `Weapon6`=0, `Weapon7`=0, `Weapon8`=0, `Weapon9`=0, `VatLieu`=0, `GiaMuaVL`=0, `Luong1`=0, `Luong2`=0, `Luong3`=0, `Luong4`=0, `Luong5`=0, `Luong6` =0,`BaoKe`= 0 WHERE `id`=2
[01:21:19] [MySQLQuery Error - (ErrorID1054) (Handle1)
[
01:21:19] [MySQLCheck /logs/querydump.log to review the query that threw the error.
[
01:21:19Dumping query from 2014/5/24 (1:21:19)
DescriptionUnknown column 'id' in 'where clause' (index 0). Query
Reply
#2

Help me pls !
Reply
#3

Quote:

Unknown column 'id' in 'where clause'

Make sure that the column "id" exists in the 'business' table. Check twice.
Reply
#4

Quote:
Originally Posted by Koala818
Посмотреть сообщение
Make sure that the column "id" exists in the 'business' table. Check twice.
When I create Column ID in Business table Error has been changed to " sscanf warning: No default value found. " what can i do
Reply
#5

The very first column in all tables that you create i recommand to be ID with (not necessarly if you do it from script) auto_increment and index unique. This way you know exactly what column you're editing.

In the code you posted i can't see where you're using sscanf, but be sure that if you are using it, you use it correctly. The number of given parameters is equal and as the same type as the variables that you are saving the values in. You can read this for more help about the warning:https://sampforum.blast.hk/showthread.php?tid=361016
Reply
#6

Quote:
Originally Posted by Koala818
Посмотреть сообщение
The very first column in all tables that you create i recommand to be ID with (not necessarly if you do it from script) auto_increment and index unique. This way you know exactly what column you're editing.

In the code you posted i can't see where you're using sscanf, but be sure that if you are using it, you use it correctly. The number of given parameters is equal and as the same type as the variables that you are saving the values in. You can read this for more help about the warning:https://sampforum.blast.hk/showthread.php?tid=361016
I see that but i don't know how to fixed that bug, here is my Command has been fail

PHP код:
CMD:bedit(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1338)
    {
        
SendClientMessageEx(playeridCOLOR_GRAD2"Ban khong duoc phep su dung lenh nay.");
        return 
1;
    }
    new 
string[128], choice[32], bizidamountbusinesstype[128];
    if(
sscanf(params"s[32]dD"choicebizidamount))
    {
        
SendClientMessageEx(playeridCOLOR_GREY"SUDUNG: /bedit [name] [bizid] [(Optional)amount]");
        
SendClientMessageEx(playeridCOLOR_GREY"Available names: Exterior, Interior, Type, Price, PickupModel.");
        return 
1;
    }
    if(
bizid >= MAX_BUSINESSES)
    {
        
SendClientMessageExplayeridCOLOR_WHITE"Khong Hop le BIZ!");
        return 
1;
    }
    if(
strcmp(choice"interior"true) == 0)
    {
        new 
virworld random(99999)+100000;
        
GetPlayerPos(playeridBizzInfo[bizid][bExitX], BizzInfo[bizid][bExitY], BizzInfo[bizid][bExitZ]);
        
BizzInfo[bizid][bVirWorld] = PlayerInfo[playerid][pVW];
        
BizzInfo[bizid][bInterior] = GetPlayerInterior(playerid);
        
BizzInfo[bizid][bVirWorld] = virworld;
        
SendClientMessageExplayeridCOLOR_WHITE"You have changed the interior!" );
        
SaveBusiness(bizid);
        
format(stringsizeof(string), "%s has edited BizID %d's Interior."GetPlayerNameEx(playerid), bizid);
        
Log("logs/bedit.log"string);
        return 
1;
    }
    if(
strcmp(choice"deliver"true) == 0)
    {
        
GetPlayerPos(playeridBizzInfo[bizid][bDeliverX], BizzInfo[bizid][bDeliverY], BizzInfo[bizid][bDeliverZ]);
        
SendClientMessageExplayeridCOLOR_WHITE"You have changed the deliver!" );
        
DestroyDynamic3DTextLabel(business3[bizid]);
        
format(stringsizeof(string), "{808080}Dia Diem Van Chuyen Hang\n\t%s\n\t%s\nID: %d",businesstypeBizzInfo[bizid][bMessage], bizid);
        
business3[bizid] = CreateDynamic3DTextLabel(string0xFFFFFF88BizzInfo[bizid][bDeliverX]+ 1BizzInfo[bizid][bDeliverY]+1BizzInfo[bizid][bDeliverZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1100.0);
        
SaveBusiness(bizid);
        
format(stringsizeof(string), "%s has edited BizID %d's deliver point."GetPlayerNameEx(playerid), bizid);
        
Log("logs/bedit.log"string);
        return 
1;
    }
    else if(
strcmp(choice"exterior"true) == 0)
    {
        
GetPlayerPos(playeridBizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ]);
        
SendClientMessageExplayeridCOLOR_WHITE"You have changed the exterior!" );
        
format(stringsizeof(string), "%s has edited BizID %d's Exterior."GetPlayerNameEx(playerid), bizid);
        
Log("logs/bedit.log"string);
        
SaveBusiness(bizid);
        
DynamicBusinesses(bizid);
    }
    else if(
strcmp(choice"price"true) == 0)
    {
        
BizzInfo[bizid][bBuyPrice] = amount;
        
format(stringsizeof(string), "You have set the BizID price to $%d."amount );
        
SendClientMessageEx(playeridCOLOR_WHITEstring);
        
SaveBusiness(bizid);
        
DynamicBusinesses(bizid);
        
format(stringsizeof(string), "%s has edited BizID %d's Price to $%d."GetPlayerNameEx(playerid), amount);
        
Log("logs/bedit.log"string);
    }
    else if(
strcmp(choice"type"true) == 0)
    {
        if(
amount || amount 12) { SendClientMessage(playeridCOLOR_GREY"   Business Type khong the duoi 1 hoac tren 10!"); return 1; }
        
BizzInfo[bizid][bType] = amount;
        
SaveBusiness(bizid);
        
DynamicBusinesses(bizid);
           
formatstringsizeof( string ), "You have set the Business (ID: %d) type to a %s."bizidbusinesstype);
        
SendClientMessageplayeridCOLOR_WHITEstring);
    }
    else if(
strcmp(choice"pickupmodel"true) == 0)
    {
        
BizzInfo[bizid][bPickkupModel] = amount;
        
format(stringsizeof(string), "Ban da doi pickupmodel sang %d."amount);
        
SendClientMessageEx(playeridCOLOR_WHITEstring);
        
DestroyPickupEx(BizzInfo[bizid][bPickupID]);
        
PickUpBiz(bizid);
        
SaveBusiness(bizid);
        
DynamicBusinesses(bizid);
        
format(stringsizeof(string), "%s da doi pickupmodel biz id %d."GetPlayerNameEx(playerid), bizid);
        
Log("logs/bedit.log"string);
        return 
1;
    }
    
SaveBusiness(bizid);
    return 
1;

Reply
#7

Im fixed " sscanf warning: No default value found ". And have
Quote:

[04:15:25] UPDATE `business` SET `Owned`=0, `Owner`='', `Name`='', `PickupID`=0, `IconID`=0, `IconType`=0, `VirtualWorld`=0, `Extortion`=0, `Level`=0, `Price`=0, `EntranceCost`=0, `BusinessBank`=0, `Locked`=0, `Products`=0, `PriceProd`=0, `DeliveringProducts`=0, `Percent`=0, `BusinessType`=0, `Interior`=0, `InteriorID`=0, `ExteriorID`=0, `InteriorX`=0.000000, `InteriorY`=0.000000, `InteriorZ`=0.000000, `EntranceX`=1697.095336, `EntranceY`=1429.121459, `EntranceZ`=10.761407, `DeliverX`=0.000000, `DeliverY`=0.000000, `DeliverZ`=0.000000, `GiaSP1`=0, `GiaSP2`=0, `GiaSP3`=0, `GiaSP4`=0, `GiaSP5`=0, `GiaSP6`=0, `GiaSP7`=0, `GiaSP8`=0, `GiaSP9`=0, `GiaSP10`=0, `GiaSP11`=0, `GiaSP12`=0, `GiaSP13`=0, `GiaSP14`=0, `GiaSP15`=0, `PickkupModel`=0, `Weapon0`=0, `Weapon1`=0, `Weapon2`=0, `Weapon3`=0, `Weapon4`=0, `Weapon5`=0, `Weapon6`=0, `Weapon7`=0, `Weapon8`=0, `Weapon9`=0, `VatLieu`=0, `GiaMuaVL`=0, `Luong1`=0, `Luong2`=0, `Luong3`=0, `Luong4`=0, `Luong5`=0, `Luong6` =0,
[04:15:25] [MySQL] Query Error - (ErrorID: 1064) (Handle: 1)
[04:15:25] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[04:15:25] Dumping query from 2014/5/24 (4:15:25)

Reply
#8

That sscanf warning is nothing to worry about, aslong as your tables are updating its fine.
Reply
#9

Quote:
Originally Posted by Rydur
Посмотреть сообщение
That sscanf warning is nothing to worry about, aslong as your tables are updating its fine.
i don't know, they can't save my business when im creating on my server
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)