sscanf error
#1

PHP код:
[19:22:53sscanf warningStrings without a length are deprecatedplease add a destination size
I get this every time I use this command:

PHP код:
CMD:asv(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid))
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        new 
vehmodel GetVehicleModel(vehicleid);
        new 
string[25], Float:vehxFloat:vehyFloat:vehzFloat:vehrot;
        
        
GetVehiclePos(vehicleidvehxvehyvehz);
        
GetVehicleZAngle(vehicleidvehrot);
        new 
col1col2vehtypepriceplate[24], DB_Query[256];
        if (
sscanf(params"iiiis"col1col2vehtypepriceplate)) SendClientMessage(playeridCOLOR_GREY"> Type /asv <color1> <color2> <VehicleType> <Price> <Plate>");
        if(
vehtype == 1)
        {
            
mysql_format(DatabaseDB_Querysizeof(DB_Query), "INSERT INTO `Vehicles` ( `vModel`, `Pos_x`, `Pos_y`, `Pos_z`, `Rot`, `Fuel`, `Type`, `Plate`, `vLock`, `Color1`, `Color2`, `RespawnDelay`, `Price`)\
            VALUES ( %d, %f, %f, %f, %f, '100', %d, '%s', 0, %d, %d, -1, %d)"
vehmodelvehxvehyvehzvehrotvehtypeplatecol1col2price);
             
mysql_tquery(DatabaseDB_Query);
        }
        else if(
vehtype == 2)
        {
        
        }
        else if(
vehtype == 3)
        {
            
mysql_format(DatabaseDB_Querysizeof(DB_Query), "INSERT INTO `Vehicles` ( `vModel`, `Pos_x`, `Pos_y`, `Pos_z`, `Rot`, `Fuel`, `Type`, `Plate`, `vLock`, `Color1`, `Color2`, `RespawnDelay`, `Price`)\
            VALUES ( %d, %f, %f, %f, %f, '100', %d, '%s', 0, %d, %d, -1, %d)"
vehmodelvehxvehyvehzvehrotvehtypeplatecol1col2price);
             
mysql_tquery(DatabaseDB_Query);
        }
        else if(
vehtype == 4)
        {
            
mysql_format(DatabaseDB_Querysizeof(DB_Query), "INSERT INTO `Vehicles` ( `vModel`, `Pos_x`, `Pos_y`, `Pos_z`, `Rot`, `Fuel`, `Type`, `Plate`, `vLock`, `Color1`, `Color2`, `RespawnDelay`, `Price`)\
            VALUES ( %d, %f, %f, %f, %f, '100', %d, '%s', 0, %d, %d, -1, %d)"
vehmodelvehxvehyvehzvehrotvehtypeplatecol1col2price);
             
mysql_tquery(DatabaseDB_Query);
        }
        
format(stringsizeof(string), "Vehicle model is: %d | Type: %d | Price: %d | Plate: %s"vehmodelvehtypepriceplate);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
    }
    return 
1;

Reply
#2

Not sure if it would make any deffirence, try this
PHP код:
if (sscanf(params"iiiis[24]"col1col2vehtypepriceplate)) 
Reply
#3

Quote:
Originally Posted by Eoussama
Посмотреть сообщение
Not sure if it would make any deffirence, try this
PHP код:
if (sscanf(params"iiiis[24]"col1col2vehtypepriceplate)) 
I thought of that too but didn't try it yet, will test and come back to update this post.
Reply
#4

Код:
if (sscanf(params, "iiiis", col1, col2, vehtype, price, plate))
The error basically explains itself. "Strings without a length are deprecated, please add a destination size." Add a length to that string there and it shouldn't appear anymore as Eoussama indicated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)