Quote:
Originally Posted by Siska1
Can someone help me make this plugin only work if i have a knife in my hand ?
Code:
public fwd_PlayerPreThink(id) {
if (!UserCanSprint[id] || get_user_weapon(id) != CSW_KNIFE) {
return;
}
maybe something like that should be added ?
|
Your solution would work, but a more efficient way would be adding another boolean for whether the player is holding a knife and flipping that boolean in "message_cur_weapon" event based on the player's weapon. I am not sure but repeatedly calling get_user_weapon in PlayerPreThink may lower plugin's performance.