[Include] Multi-Weapon - Able to switch to every weapon received
#1

Description
Allows players to switch through weapons with the same weapon slot instead of loosing their previous weapon.
Lets say you are holding a Deagle with 25 ammo, normally when you get a silencer with 25 ammo, you
would lose the deagle and than have a silencer with 50 ammo.
With this include you will get a silencer with 25 ammo instead and have the ability to switch to the deagle by pressing ALT, receiving the ammo specifically for that weapon.
This system works for every weapon.

Video
Having some trouble uploading an attached file, will try again tomorrow.

How to use
Simply include the file in your gamemode and you're done.
No changes are required within the gamemode for this to work.
Although, if you are using 'GetPlayerWeaponData' you will have to use it differently now.

Before:
Код:
	new weapons[12][2];
	for (new i = 0; i <= 12; i++)
	{
	    GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
	}
Now:

Код:
	new weapons[47][2];
	for (new i = 1; i <= 47; i++)
	{
	    GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
	}
This function now returns every weapon instead of only the weapon slot in use.

How to switch weapon (Note: Switching weapons through the weapon slot of your equipped weapon)
By default you can switch weapons with the 'ALT' key.
Incase you feel like changing this:
-> open 'multi_weapon.inc'
-> go to line '9' (#define MULTI_WEAPON_SWITCH_KEY KEY_WALK)
-> change 'KEY_WALK' to any SAMP KEY you like.
(info about keys: https://sampwiki.blast.hk/wiki/Keys)

Dependencies
y_hooks

Download
git: multi_weapon.inc
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)