Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new PlayerWeaponList[MAX_PLAYERS],
- pWepList[MAX_PLAYERS][2][13];
- CMD:listitems(playerid,params[])
- {
- new item_list[256], item_holder[128];
- new weapon_id, weapon_ammo;
- // Weapon Data
- for(new i, j = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, weapon_id, weapon_ammo);
- if(weapon_id != 0)
- {
- format(item_holder, sizeof item_holder, "Wep ID: %i - Ammo: %i\n", weapon_id, weapon_ammo);
- strcat(item_list, item_holder);
- pWepList[playerid][0][j] = weapon_id;
- pWepList[playerid][1][j] = weapon_ammo;
- j++;
- PlayerWeaponList[playerid] = j;
- }
- }
- //
- //Vehicle Name (Make Vehicle as Last Select)
- if(IsPlayerInAnyVehicle(playerid))
- {
- format(item_holder, sizeof item_holder, "%i\n", GetVehicleModel(playerid));
- strcat(item_list, item_holder);
- }
- //
- ShowPlayerDialog(playerid, DIALOG_LISTWEAPONS, DIALOG_STYLE_LIST, "Items", item_list, "Continue", "Close");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_LISTWEAPONS:
- {
- if(listitem < PlayerWeaponList[playerid])
- {
- printf("You have selected listitem Weapon %d, Ammo %d",pWepList[playerid][0][listitem], pWepList[playerid][1][listitem]);
- }
- else // last select vehicle
- {
- printf("You have selected vehicle Model %i",GetVehicleModel(playerid));
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment