Oblivion_UFF

asd

Mar 15th, 2020
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. new PlayerWeaponList[MAX_PLAYERS],
  2. pWepList[MAX_PLAYERS][2][13];
  3.  
  4. CMD:listitems(playerid,params[])
  5. {
  6. new item_list[256], item_holder[128];
  7. new weapon_id, weapon_ammo;
  8.  
  9. // Weapon Data
  10. for(new i, j = 0; i < 13; i++)
  11. {
  12.  
  13. GetPlayerWeaponData(playerid, i, weapon_id, weapon_ammo);
  14.  
  15. if(weapon_id != 0)
  16. {
  17. format(item_holder, sizeof item_holder, "Wep ID: %i - Ammo: %i\n", weapon_id, weapon_ammo);
  18. strcat(item_list, item_holder);
  19.  
  20. pWepList[playerid][0][j] = weapon_id;
  21. pWepList[playerid][1][j] = weapon_ammo;
  22. j++;
  23. PlayerWeaponList[playerid] = j;
  24. }
  25. }
  26. //
  27.  
  28. //Vehicle Name (Make Vehicle as Last Select)
  29. if(IsPlayerInAnyVehicle(playerid))
  30. {
  31. format(item_holder, sizeof item_holder, "%i\n", GetVehicleModel(playerid));
  32. strcat(item_list, item_holder);
  33. }
  34. //
  35.  
  36. ShowPlayerDialog(playerid, DIALOG_LISTWEAPONS, DIALOG_STYLE_LIST, "Items", item_list, "Continue", "Close");
  37. return 1;
  38. }
  39.  
  40. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  41. {
  42. switch(dialogid)
  43. {
  44. case DIALOG_LISTWEAPONS:
  45. {
  46. if(listitem < PlayerWeaponList[playerid])
  47. {
  48. printf("You have selected listitem Weapon %d, Ammo %d",pWepList[playerid][0][listitem], pWepList[playerid][1][listitem]);
  49. }
  50. else // last select vehicle
  51. {
  52. printf("You have selected vehicle Model %i",GetVehicleModel(playerid));
  53. }
  54. }
  55. }
  56. return 1;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment