Define custom weapon names
#1

Hey there.
I'm working on a new weapon system at the moment, where I'm using custom weapon names for each weapon. So I for example use Desert Eagle three times with three different weapon names and weapon damages.

Issue is, how can I define the custom names and item IDs?
This is something I made really quick, but I assume it won't work:

Код:
enum InventoryItems
{
	InvName[32],
	InvItem
};

static const InvItems[][InventoryItems] = 
{
	// Desert Eagle (24)
	{"Beretta 92", 1000},
	{"SIG P226", 1001},
	{"Walther P5", 1002},
	
	// M4 (31)
	{"M4A1", 1003},
	{"Barrett REC7", 1004},
	
	// MP5 (29)
	{"AMP-69", 1005},
	{"MAS-38", 1006}
};

stock DefineGuns(playerid)
{
	if(Player[playerid][pWeapon] == "1001")
	{
		new string[128];
		format(string, sizeof(string), "Your weapon name: %s", InvItems[0001]);
		SendClientMessage(playerid, COLOR_WHITE, string);
	}
}
Would this work? If not, how can I make a weapon system like this?
Please help me out with this, and I'll do anything in return.

Thanks a lot in advance.
Reply


Messages In This Thread
Define custom weapon names - by SiraBots - 01.06.2015, 18:59
Re: Define custom weapon names - by Konstantinos - 01.06.2015, 19:10
Re: Define custom weapon names - by SiraBots - 01.06.2015, 19:12
Re: Define custom weapon names - by Konstantinos - 01.06.2015, 19:16
Re: Define custom weapon names - by SiraBots - 01.06.2015, 19:18
Re: Define custom weapon names - by Konstantinos - 01.06.2015, 19:27
Re: Define custom weapon names - by SiraBots - 01.06.2015, 19:55
Re: Define custom weapon names - by Konstantinos - 01.06.2015, 20:02
Re: Define custom weapon names - by SiraBots - 01.06.2015, 20:14
Re: Define custom weapon names - by Konstantinos - 01.06.2015, 20:26

Forum Jump:


Users browsing this thread: 1 Guest(s)