[+Rep] Mysql Can't Save Setting !
#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


Messages In This Thread
[+Rep] Mysql Can't Save Setting ! - by ScorpiusMalfoy - 24.05.2014, 06:14
Re: [+Rep] Mysql Can't Save Setting ! - by ScorpiusMalfoy - 24.05.2014, 06:16
Re: [+Rep] Mysql Can't Save Setting ! - by Koala818 - 24.05.2014, 06:37
Re: [+Rep] Mysql Can't Save Setting ! - by ScorpiusMalfoy - 24.05.2014, 06:49
Re: [+Rep] Mysql Can't Save Setting ! - by Koala818 - 24.05.2014, 07:43
Re: [+Rep] Mysql Can't Save Setting ! - by ScorpiusMalfoy - 24.05.2014, 08:51
Re: [+Rep] Mysql Can't Save Setting ! - by ScorpiusMalfoy - 24.05.2014, 08:58
Re: [+Rep] Mysql Can't Save Setting ! - by Rydur - 24.05.2014, 10:32
Re: [+Rep] Mysql Can't Save Setting ! - by ScorpiusMalfoy - 24.05.2014, 12:14

Forum Jump:


Users browsing this thread: 1 Guest(s)