View Single Post
Old 05/07/2019, 09:12 PM   #12
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 22
Default Re: How to give weapons after they choosed?

Create an array for the weapons and use listitem as index. Saves a lot of typing and you can reuse the array for other stuff.
Example:
Code:
//if you use different types, use an enum
enum exampleEnum {
   wName[30],
   wID.
   wAmmo,
   wPrice
}
new weaponArray[][exampleEnum] = {
   {"M4", WEAPON_M4,500,2000},
   {...}
};
//OnDialogResponse
GivePlayerWeapon(playerid, weaponArray[listitem][wID],weaponArray[listitem][wAmmo]);
Plastikmensch is offline   Reply With Quote