Well I need to know whats the weapin in the hand
OnWeaponFired and make weapon continue shooting until player stop pressing fire button;
I want to make a semiauto pistol into an automatic one,
Weapon fired, --- Check if its th pistol, continue firing until stop pressing buton :S
Any helP?
Solved Get weapon in hand
Discussion in 'Rust Development' started by TheMechanical97, Jan 16, 2016.
-
Hey,
I dont think it is possible to get a gun to keep firing using server scripts, someone else can indeed correct me if i am wrong.
However, to get the current active item in the hand:
Code:player.GetActiveItem()
-
If I want to check if player has in hand the pistol? Tht return an array?
-
Code:
private void Loaded() { var _pistolItem = ItemManager.FindItemDefinition("pistol.semiauto"); foreach (var player in BasePlayer.activePlayerList) { if (player.GetActiveItem()?.info.itemid == _pistolItem.itemid) { //do stuff } } }