detect if player is switching weapons.
#1

So i wonder if this is possible because i am creating a switching weapons system on different keys. This is because i want players to only equip 4 weapons at a time(there is an equipment textdraw.) And also let them equip deagle and 9mm etc together.

I can't use onplayerkeystatechange i think because you also use the the switch keys when you are using sniper right? correct me if i am wrong.

What i actually want to do now, is block the player from using the original weapon switching scrolling.
Is that possible?
Reply
#2

Give players only one weapon at once, and when pressing your custom weapon switch key, remove it and give them the next equipped weapon.
They can still switch to unarmed, you may prevent that with SetPlayerArmedWeapon in OnPlayerUpdate, but maybe you want it like that, so they can always use unarmed attacks.
Reply
#3

OnPlayerUpdate:

Code:
     
                new wid = GetPlayerWeapon(playerid);
		if( pInfo[playerid][player_held_weapon] != wid )
		{
			OnPlayerWeaponSwitch(playerid, wid, pInfo[playerid][player_held_weapon]);
			pInfo[playerid][player_held_weapon] = wid;
		}
Reply
#4

Quote:
Originally Posted by raydx
View Post
OnPlayerUpdate:

Code:
     
                new wid = GetPlayerWeapon(playerid);
		if( pInfo[playerid][player_held_weapon] != wid )
		{
			OnPlayerWeaponSwitch(playerid, wid, pInfo[playerid][player_held_weapon]);
			pInfo[playerid][player_held_weapon] = wid;
		}
what is this OnPlayerWeaponSwitch?
provide code please, otherwise your given code will not work.

Mauzen's idea is good.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)