Dynamic System [Important]
#1

I don't know whats wrong at all...



pawn Код:
CMD:buyhotdog(playerid, params[])
{
    for(new i; i < MAX_HDSTANDS; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3, HotDogStands[i][Hds_X], HotDogStands[i][Hds_Y], HotDogStands[i][Hds_Z]))
        {
            if(pData[playerid][StaffLevel] >=1)
            {
                SendClientMessage(playerid,-1,"[Admin]: *Mexican Accent*: Welcome to the adminhotdog stand");
            }
        }
    }
    return 1;
}
CMD:createhotdogstand(playerid, params[])
{

    if(pData[playerid][StaffLevel] >=6)
    {
        new sBuyPrice, sSellPrice,sHotdogPrice,Float:P_X,Float:P_Y,Float:P_Z;
        if(sscanf(params, "dd" , sBuyPrice, sSellPrice, sHotdogPrice)) return SendClientMessage(playerid, -1,"Syntax: /createhotdogstand [Buy Price] [Sell Price] [Hotdog Price]");
       
        GetPlayerPos(playerid,P_X,P_Y,P_Z);
        format(Query,sizeof(Query),"INSERT INTO `DynamicHotdogStands` (Hds_X,Hds_Y,Hds_Z,Products,HotDogPrice,BuyPrice,SellPrice,Owner) VALUES('%f','%f','%f','%d','%d','%d','%d','%s')",P_X,P_Y,P_Z,0,sHotdogPrice,sBuyPrice,sSellPrice,"The State");
        mysql_query(Query);
        SendClientMessage(playerid,-1,"Hotdog Stand Created, Reloading and adding now!");
        ReloadHotdogStands();
       
    } else {
   
   
    }
    return 1;
}

stock ReloadHotdogStands()
{
    for(new id; id < MAX_HDSTANDS; id++)
    {
        DestroyDynamicObject(FoodStallHotdog[id]);
    }
    return LoadHotdogStands();
}

stock LoadHotdogStands()
{
    //
    for(new id; id < MAX_HDSTANDS; id++)
    {
        format(Query, sizeof(Query), "SELECT * FROM `DynamicHotdogStands` WHERE ID = %d", id);
        mysql_query(Query);
        mysql_store_result();
        if(mysql_num_rows())
       
        if(mysql_fetch_row_format(Query,"|"))
        {
             sscanf(Query, "e<p<|>dfffdddds[100]>",HotDogStands[id]);
             FoodStallHotdog[id] = CreateDynamicObject(1340, HotDogStands[id][Hds_X],HotDogStands[id][Hds_Y],HotDogStands[id][Hds_Z], 0.0, 0.0, 0.0, 100);
             printf("Hotdog Stand [%d] - Owner: %s",id,HotDogStands[id][Owner]);
        }
       
    }
    return 1;
}
Reply
#2

What seems to be the problem?
Reply
#3

The, Objects aren't loading into the game.
Reply
#4

im pretty sure this
pawn Код:
if(sscanf(params, "dd" , sBuyPrice, sSellPrice, sHotdogPrice)) return SendClientMessage(playerid, -1,"Syntax:  /createhotdogstand [Buy Price] [Sell Price] [Hotdog Price]");
should be
pawn Код:
if(sscanf(params, "ddd" , sBuyPrice, sSellPrice, sHotdogPrice)) return SendClientMessage(playerid, -1,"Syntax:  /createhotdogstand [Buy Price] [Sell Price] [Hotdog Price]");
Reply
#5

Wrong, Thats inserting into the database not loading, laughing my ass off due to your lack of looking.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)