sscanf warnings please help
#1

its causing a big problem i need to to fix it but i dont know which one here is a few
pawn Код:
public LoadStuff()
{
    new query[156];
    format(query,sizeof(query),"SELECT * FROM statistics");
    mysql_query(query);
    mysql_store_result();
    new line[1024];
    mysql_fetch_row(line);
    sscanf(line, "p<|>s[256]s[30]ds[64]s[64]dds[30]s[64]s[64]",
    ServerMOTD,ServerMOTDSetBy,ServerMaxPlayers,ServerMaxPlayersDate,ServerMaxPlayersTime,ServerTickets,ServerMaxFlightStreak,ServerMaxFlightStreakWinner,ServerMaxFlightStreakDate,ServerMaxFlightStreakTime);
    mysql_free_result();
    sTrackPlayers=1;
}
i run it on local host it was working sweet now its uploaded now look whats wrong here is few more
pawn Код:
stock AddPlayerVehicles()
{
    new Str[750], vTotal, vehID, vehModel, Float:vehX, Float:vehY, Float:vehZ, Float:vehA, vehC1, vehC2, vehOwnedBy[24], ForSale, DefaultPrice, Price, Locked;
    new carmod[17];
    mysql_reconnect();
    mysql_query("SELECT * FROM `pvehicles`");
    mysql_store_result();
    vTotal = mysql_num_rows();
    new carid = 0;
    if(vTotal > 0)
    {
        while(mysql_fetch_row(Str))
        {
            sscanf(Str, "p<|>dds[24]ffffddddddddddddddddddddddd",
            vehID,vehModel,vehOwnedBy,vehX,vehY,vehZ,vehA,vehC1,vehC2,ForSale,DefaultPrice,Price,Locked,carmod[0],carmod[1],carmod[2],carmod[3],carmod[4],carmod[5],carmod[6],carmod[7],carmod[8],carmod[9],carmod[10],carmod[11],carmod[12],carmod[13],carmod[14],carmod[15],carmod[16]);
            carid=vehID;
            new carid2 = CreateVehicle(vehModel, vehX, vehY, vehZ, vehA, vehC1, vehC2, (30 * 60));
            PVInfo[carid][vpID] = vehID;
            PVInfo[carid][vpPosX] = vehX;
            PVInfo[carid][vpPosY] = vehY;
            PVInfo[carid][vpPosZ] = vehZ;
            PVInfo[carid][vpPosA] = vehA;
            PVInfo[carid][vpColor1] = vehC1;
            PVInfo[carid][vpColor2] = vehC2;
            PVInfo[carid][vpModel] = vehModel;
            PVInfo[carid][vpForSale] = ForSale;
            PVInfo[carid][vpDefaultPrice] = DefaultPrice;
            PVInfo[carid][vpPrice] = Price;
            PVInfo[carid][vpLocked] = Locked;
            PVInfo[carid2][mod1] = carmod[0];
            PVInfo[carid2][mod2] = carmod[1];
            PVInfo[carid2][mod3] = carmod[2];
            PVInfo[carid2][mod4] = carmod[3];
            PVInfo[carid2][mod5] = carmod[4];
            PVInfo[carid2][mod6] = carmod[5];
            PVInfo[carid2][mod7] = carmod[6];
            PVInfo[carid2][mod8] = carmod[7];
            PVInfo[carid2][mod9] = carmod[8];
            PVInfo[carid2][mod10] = carmod[9];
            PVInfo[carid2][mod11] = carmod[10];
            PVInfo[carid2][mod12] = carmod[11];
            PVInfo[carid2][mod13] = carmod[12];
            PVInfo[carid2][mod14] = carmod[13];
            PVInfo[carid2][mod15] = carmod[14];
            PVInfo[carid2][mod16] = carmod[15];
            PVInfo[carid2][mod17] = carmod[16];
            PVInfo[carid][vpVehicleSpawned] = carid2;
            if(ForSale == 1)
another
pawn Код:
stock AddHousesFromSQL()
{
    new Str[300], string[128];
    mysql_reconnect();
    mysql_query("SELECT * FROM houses");
    mysql_store_result();
    new hTotal = mysql_num_rows(); //hTotal amount of houses in mysql database
    if(hTotal > 0) //1+ house.
    {
        while(mysql_fetch_row(Str))
        {
            new HID,Float:eX,Float:eY,Float:eZ,Float:iX,Float:iY,Float:iZ,OwnedBy[24],Location[128],Price,Interior,Slots,ForSale,Locked,DefaultPrice;
            sscanf(Str, "p<|>ds[24]s[128]dddffffffddd", HID,OwnedBy,Location,DefaultPrice,Price,Interior,iX,iY,iZ,eX,eY,eZ,Slots,ForSale,Locked);
            if(!strcmp(OwnedBy, "None"))
            {
                HInfo[HID][hMapIcon] = CreateDynamicMapIcon(eX, eY, eZ, 31, 0);
                HInfo[HID][hPickupID] = CreatePickup(1273, 23, eX, eY, eZ, 0);
                format(string,sizeof(string),"House for sale!\n$%d (%d slots)\n/buyhouse to purchase.", DefaultPrice, Slots);
                HInfo[HID][hHouseText] = Create3DTextLabel(string, 0x50AAC5FF, eX, eY, eZ, 50.0, 0, 1);
            }
if you can tell me how to fix one i can do the rest thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)