SA-MP Forums Archive
Help with dialogs, retrieving weapon. Need solution ideas. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with dialogs, retrieving weapon. Need solution ideas. (/showthread.php?tid=568119)



Help with dialogs, retrieving weapon. Need solution ideas. - Dokins - 19.03.2015

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.


Re: Help with dialogs, retrieving weapon. Need solution ideas. - admantis - 19.03.2015

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?