SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/01/2014, 07:45 PM   #1
GBLTeam
Gangsta
 
GBLTeam's Avatar
 
Join Date: Mar 2009
Location: Macedonia
Posts: 641
Reputation: 6
Default [Help] sscanf warning [Strings]

Sscanf warning: Strings without a length are deprecated, please add a destionation size.
I got this warnings when i use this cmds:

pawn Code:
CMD:addv(playerid, params[])
{
    if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_GREY, "You are not admin!");
    if(!IsPlayerSpawned(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Ti nemas prava koristi ovu komandu!");
    new model[32], modelid, dealerid, color1, color2, price;
    if(sscanf(params, "dsddd", dealerid, model, color1, color2, price))
        return SendClientMessage(playerid, COLOR_GREY, "INFO: /addv [dealerid] [model] [color1] [color2] [price]");
    if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_GREY, "Nevalidan autoshop ID!");
    if(IsNumeric(model)) modelid = strval(model);
    else modelid = GetVehicleModelIDFromName(model);
    if(modelid < 400 || modelid > 611) return SendClientMessage(playerid, COLOR_GREY, "Nevalidan auto model ID!");
    if(color1 < 0 || color2 < 0) return SendClientMessage(playerid, COLOR_GREY, "Nevalidan ID boja!");
    if(price < 0) return SendClientMessage(playerid, COLOR_GREY, "Nevalidna cjena!");
    new Float:X, Float:Y, Float:Z, Float:angle;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, angle);
    X += floatmul(floatsin(-angle, degrees), 4.0);
    Y += floatmul(floatcos(-angle, degrees), 4.0);
    for(new i=1; i < MAX_DVEHICLES; i++)
    {
        if(!VehicleCreated[i])
        {
            new msg[128];
            VehicleCreated[i] = VEHICLE_DEALERSHIP;
            VehicleModel[i] = modelid;
            VehiclePos[i][0] = X;
            VehiclePos[i][1] = Y;
            VehiclePos[i][2] = Z;
            VehiclePos[i][3] = angle+90.0;
            VehicleColor[i][0] = color1;
            VehicleColor[i][1] = color2;
            VehicleInterior[i] = GetPlayerInterior(playerid);
            VehicleWorld[i] = GetPlayerVirtualWorld(playerid);
            VehicleValue[i] = price;
            valstr(VehicleOwner[i], dealerid);
            VehicleNumberPlate[i] = DEFAULT_NUMBER_PLATE;
            for(new d=0; d < sizeof(VehicleTrunk[]); d++)
            {
                VehicleTrunk[i][d][0] = 0;
                VehicleTrunk[i][d][1] = 0;
            }
            for(new d=0; d < sizeof(VehicleMods[]); d++)
            {
                VehicleMods[i][d] = 0;
            }
            VehiclePaintjob[i] = 255;
            VehicleLock[i] = 0;
            VehicleAlarm[i] = 0;
            UpdateVehicle(i, 0);
            SaveVehicle(i);
            format(msg, sizeof(msg), "Dodano vozilo %d vo autoshop %d", i, dealerid);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, msg);
            return 1;
        }
    }
    SendClientMessage(playerid, COLOR_GREY, "Nemozes dodati vise vozila!");
    return 1;
}
CMD:editv(playerid, params[])
{
    if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_GREY, "Ti nisi admin!");
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new id = GetVehicleID(GetPlayerVehicleID(playerid));
        if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_GREY, "Ovo nije dunamicno vozilo!");
        SetPVarInt(playerid, "DialogValue1", id);
        ShowDialog(playerid, DIALOG_EDITVEHICLE);
        return 1;
    }
    new vehicleid;
    if(sscanf(params, "u", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: /editv [vozilo]");
    if(!IsValidVehicle(vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "Nevalidno vozilo ID!");
    SetPVarInt(playerid, "DialogValue1", vehicleid);
    ShowDialog(playerid, DIALOG_EDITVEHICLE);
    return 1;
}

CMD:adddealership(playerid, params[])
{
    if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_GREY, "Ti nisi admin!");
    if(!IsPlayerSpawned(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Ti nemozes koristi ovu komandu sad!");
    for(new i=1; i < MAX_DEALERSHIPS; i++)
    {
        if(!DealershipCreated[i])
        {
            new msg[128];
            DealershipCreated[i] = 1;
            GetPlayerPos(playerid, DealershipPos[i][0], DealershipPos[i][1], DealershipPos[i][2]);
            UpdateDealership(i, 0);
            SaveDealership(i);
            format(msg, sizeof(msg), "Dodan Auto Shop sa ID: %d", i);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, msg);
            return 1;
        }
    }
    SendClientMessage(playerid, COLOR_GREY, "Nemozes dodati vise Auto Shopa!");
    return 1;
}

CMD:deletedealership(playerid, params[])
{
    if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_GREY, "Ti nisi Admin!");
    new dealerid, msg[128];
    if(sscanf(params, "u", dealerid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: /deletedealership [ID]");
    if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_GREY, "Nevalidan ID!");
    for(new i=1; i < MAX_DVEHICLES; i++)
    {
        if(VehicleCreated[i] == VEHICLE_DEALERSHIP && strval(VehicleOwner[i]) == dealerid)
        {
            DestroyVehicle(VehicleID[i]);
            Delete3DTextLabel(VehicleLabel[i]);
            VehicleCreated[i] = 0;
        }
    }
    DealershipCreated[dealerid] = 0;
    Delete3DTextLabel(DealershipLabel[dealerid]);
    SaveDealership(dealerid);
    format(msg, sizeof(msg), "Izbrisan Auto Shop %d", dealerid);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, msg);
    return 1;
}

CMD:movedealership(playerid, params[])
{
    if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_GREY, "Ti nisi Admin!");
    new dealerid, msg[128];
    if(sscanf(params, "u", dealerid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: /movedealership [dealerid]");
    if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_GREY, "Nevalidan Auto Shop ID!");
    GetPlayerPos(playerid, DealershipPos[dealerid][0], DealershipPos[dealerid][1], DealershipPos[dealerid][2]);
    UpdateDealership(dealerid, 1);
    SaveDealership(dealerid);
    format(msg, sizeof(msg), "Premjesten Auto Shop %d tuka", dealerid);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, msg);
    return 1;
}
CMD:agorivo(playerid, params[])
{
    if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_GREY, "Ti nemas prava koristi ovu komandu!");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Ti nisi u vozilo!");
    new amount, msg[128];
    if(sscanf(params, "u", amount)) return SendClientMessage(playerid, COLOR_GREY, "INFO: /agorivo [iznos]");
    if(amount < 0 || amount > 100) return SendClientMessage(playerid, COLOR_GREY, "Nevalidan iznos! (0-100)");
    Fuel[GetPlayerVehicleID(playerid)] = amount;
    format(msg, sizeof(msg), "Ti si postavio gorivo na ovo vozilo %d", amount);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, msg);
    return 1;
}
__________________

←DELTA SERVERS→

[DeltaHost]Servers Hosted in Bulgaria.
[DeltaHost]Verry cheap there no other company who is cheaper than us.
←MY FRIEND→

GBLTeam is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sscanf warning: Strings without a length are deprecated AntonioCroatia Scripting Help 7 30/07/2013 02:37 PM
[17:50:56] sscanf warning: 'z' is deprecated, consider using 'S' instead. [17:50:56] sscanf warning: No default value fo Zalman Scripting Help 2 25/03/2013 06:33 PM
sscanf warning: Strings without a length are deprecated, please add a destination size. niels44 Scripting Help 11 24/10/2012 06:35 PM
sscanf warning: Strings without a length are deprecated, please add a destination size. HayZatic Help Archive 5 08/07/2011 07:26 PM


All times are GMT. The time now is 12:18 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.