View Single Post
Old 06/07/2019, 03:30 PM   #16
Edvukas
Little Clucker
 
Join Date: Nov 2018
Posts: 18
Reputation: 0
Default Re: How to give weapons after they choosed?

pawn Code:
CMD:weapons(playerid,params[])
{
    new info[2000], string[150];
    for(new i = 0; i < MAX_WEAPONS; i++)
    {
    format(string, sizeof string, "%s\n", weaponArray[i][wName]);
    strcat(info, string);
    }
    ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "First gun", info, "Choose", "Cancel");
    }
    return 1;
}


if(dialogid == DIALOG_WEAPONS)
    {
        if(response)
        {
            if(listitem >= 0)
            {
                new info[2000], string[150];
                for(new i = 0; i < MAX_WEAPONS2; i++)
                {
                format(string, sizeof string, "%s\n", weaponArray2[i][wName]);
                strcat(info, string);
                }
                ShowPlayerDialog(playerid, DIALOG_WEAPONS2, DIALOG_STYLE_LIST, "Second Gun", info, "Done", "Cancel");
            }
        return 1;
    }
}

if(dialogid == DIALOG_WEAPONS2)
    {
        if(response)
        {
            if(listitem >= 0)
            {
                GivePlayerWeapon(playerid, weaponArray[listitem][wID],weaponArray[listitem][wAmmo]);
                GivePlayerWeapon(playerid, weaponArray2[listitem][wID],weaponArray2[listitem][wAmmo]);
            }
        return 1;
    }
}
what's wrong with this code? Because I get only second dialogue's weapon choosed weapons

Last edited by Edvukas; 06/07/2019 at 04:23 PM.
Edvukas is offline   Reply With Quote