sscanf warning: strings without a lenght.......
#4

actually you should size the arrays in sscanf
Try this
PHP код:
CMD:veh(playeridparams[])
{
    new 
model[32], color1color2VehicleIDstring[128];
    if(
PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(
sscanf(params"s[32]ii"modelcolor1color2)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /veh [ID/NAME] || Optional: [Color1] [Color2]");
        
VehicleID GetVehicleModelIDFromName(model);
         if(
VehicleID == -)
          {
            
VehicleID strval(model);
            if(
VehicleID 400 || VehicleID 611 )
                   {
                       return 
SendClientMessage(playeridCOLOR_WHITE"SERVER: You entered an invalid vehicle name or ID!");
                   }
           }
        if(
IsPlayerInAnyVehicle(playerid))
        {
            new 
vehicle GetPlayerVehicleID(playerid);
            
RemovePlayerFromVehicle(playerid);
            
DestroyVehicle(vehicle);
        }
        if(
AdmVeh[playerid] != 0){
        
DestroyVehicle(AdmVeh[playerid]);}
        new    
Float:XFloat:YFloat:ZFloat:A;
        
GetPlayerPos(playeridX,Y,Z);
        
GetPlayerFacingAngle(playerid,A);
        new 
carid CreateVehicle(VehicleIDX,Y,Z,Acolor1color2, -1);
        
PutPlayerInVehicle(playerid,carid0);
        
LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
         
format(stringsizeof(string), "{FFFFFF}SERVER: You've spawned the selected vehicle.");
         
SendClientMessage(playeridCOLOR_WHITEstring);
         
AdmVeh[playerid] = carid;
    }
    else return 
SendClientMessage(playeridCOLOR_GRAD2NOTADMIN);
    return 
1;

Reply


Messages In This Thread
sscanf warning: strings without a lenght....... - by faff - 03.10.2015, 09:28
Re: sscanf warning: strings without a lenght....... - by faff - 03.10.2015, 10:51
Re: sscanf warning: strings without a lenght....... - by Bolex_ - 03.10.2015, 11:05
Re: sscanf warning: strings without a lenght....... - by karemmahmed22 - 03.10.2015, 11:07
Re: sscanf warning: strings without a lenght....... - by faff - 03.10.2015, 12:56

Forum Jump:


Users browsing this thread: 1 Guest(s)