This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Sprint - Run Faster [Double-Tap System]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 09-27-2023 , 12:49   Re: Sprint - Run Faster [Double-Tap System]
Reply With Quote #1

Quote:
Originally Posted by Siska1 View Post
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.
akcaliberg is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode