how to skip a part of a command for sscanf?
#9

alright, then how can i fix this?

pawn Код:
CMD:vget(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_BLUE, "you need to be onfoot to teleport vehicles");
    new string1[50], string2[50], string3[50], string4[50], string[128];
    if(PlayerCars[playerid][0] != -1)
    {
        format(string1, sizeof(string1), "%s", GetVehicleNameByModel(PlayerCars[playerid][0]));
    }
    else if(PlayerCars[playerid][0] == -1 )
    {
        format(string1, sizeof(string1), "Empty Slot");
    }
    if( PlayerCars[playerid][1] != -1 )
    {
        format(string2, sizeof(string2), "%s", GetVehicleNameByModel(PlayerCars[playerid][1]));
    }
    else if( PlayerCars[playerid][1] == -1 )
    {
        format(string2, sizeof(string2), "Empty Slot");
    }
    if( PlayerCars[playerid][2] != -1 )
    {
        format(string3, sizeof(string3), "%s", GetVehicleNameByModel(PlayerCars[playerid][2]));
    }
    else if( PlayerCars[playerid][2] == -1 )
    {
        format(string3, sizeof(string3), "Empty Slot");
    }
    if( PlayerCars[playerid][3] != -1 )
    {
        format(string4, sizeof(string4), "%s", GetVehicleNameByModel(PlayerCars[playerid][3]));
    }
    else if( PlayerCars[playerid][3] == -1 )
    {
        format(string4, sizeof(string4), "Empty Slot");
    }
    format(string, sizeof(string), "%s\n%s\n%s\n%s", string1, string2, string3, string4);
    ShowPlayerDialog(playerid, DIALOG_GETCARS, DIALOG_STYLE_LIST, "Vehicle Teleporting", string, "Respawn", "Cancel");
    return 1;
}
pawn Код:
CMD:col(playerid, params[])
{
    if(GetPlayerVehicleID(playerid) != PlayerVeh) return SendClientMessage(playerid, COLOR_RED, "This ain't your current car, use /v get to change your current car.");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't in any vehicle.");
    if(IsValidVehicleID(GetPlayerVehicleID(playerid)))
    {
        new col1, col2, uString[32];
        if(sscanf(params, "s[32]dd", uString, col1, col2)) return SendClientMessage(playerid, COLOR_YELLOW, "Correct Usage: {FF0000}/v color [color1] [color2]");
        ChangeVehicleColor(GetPlayerVehicleID(playerid), col1, col2);
        SendClientMessage(playerid, COLOR_GREEN, "You have successfully changed your Vehicle colors");
        SaveVehComponents(playerid, PlayerVeh, CurrentSlot(playerid));
    }
    return 1;
}
when i do /v color it says: usage: /v color col1 col2.

when i do /v color 1 1 it says: /v [respawn/lock/color/etc]
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)