Help with dialogs, retrieving weapon. Need solution ideas.
#1

pawn Код:
CMD:vgetwep(playerid, params[])
{
    new vehicleid = GetClosestVehicle(playerid);
    new string[128],string1[256];
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    if(VehicleSQLID[vehicleid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You cannot store a weapon in this vehicle.");
    new model = GetVehicleModel(vehicleid) - 400;
    new amount;
    for(new x = 1; x < MAX_WEAPONS; x++)
    {
        if(VehWepStored[x] == VehicleSQLID[vehicleid])
        {
            if(amount == 0)
            {
                format(string1, sizeof(string1),"Weapon: %s Ammo: %d",WeaponNames[WepModel[x]], WepAmmo[x]);
            }
            if(amount > 0)
            {
               format(string1, sizeof(string1),"%s\nWeapon: %s Ammo: %d",string1, WeaponNames[WepModel[x]], WepAmmo[x]);
            }
            amount++;
        }
    }
    if(amount == 0)
    {
        SendClientMessage(playerid, COLOUR_GREY, "There are no weapons in this vehicle.");
    }
        format(string, sizeof(string), "%s Weapons", VehicleNames[model]);
        ShowPlayerDialog(playerid, DIALOG_GETVEHWEP, DIALOG_STYLE_LIST, string, string1, "Select", "Close");
    return 1;
}
I store my weapons individually with their respective SQLID's. How can I allow them to select a weapon in another dialog, which they want to remove? I can't think of a solution.
Reply
#2

I don't understand what you're trying to do. Perhaps you're trying to get the ID of the weapon relative to the listitem ID? Could you try to paraphrase?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)