Weapon skills
#2

If you wanna count the bullets then OnPlayerKeyStateChange callback will do it.
1- Check if the player has pressed KEY_FIRE ( left click)
2- If he pressed it then check if he has a weapon in his hand (GetPlayerWeapon).
3- Set a variable, each KEY_FIRE pressed increase it (Note: a variable/array must be set for each weapon)
4- OnPlayerUpdate check if the variable is 100 = then SetPlayerWeaponSkill, ETC..
However there still might be a bug since if you keep your hand on Left Click it will shoot many bullets but it will be counted as 1 bullet, so..

EDIT:
Maybe you can set a variable if the player is kept pressing KEY_FIRE then keep increasing the variable OnPlayerUpdate.
Example:
Код:
new is_shooting[MAX_PLAYERS] = 0;

OnPlayerUpdate
{
	if(is_shooting[MAX_PLAYERS] = 1)
	{
	  //  Increase the Bullet Variable.
 	}
}
Reply


Messages In This Thread
Weapon skills - by Steve1312 - 26.03.2014, 08:12
Re: Weapon skills - by DaniceMcHarley - 26.03.2014, 08:30
Re: Weapon skills - by Steve1312 - 26.03.2014, 08:33

Forum Jump:


Users browsing this thread: 1 Guest(s)