Raised This Month: $51 Target: $400
 12% 

Very basic code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OW3R
Junior Member
Join Date: Sep 2021
Old 05-07-2022 , 13:07   Very basic code
Reply With Quote #1

Hi guys, I want it to do the task when the IN_RELOAD key is pressed for 3 seconds. can you give me this code

Last edited by OW3R; 05-07-2022 at 13:46.
OW3R is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-07-2022 , 14:32   Re: Very basic code
Reply With Quote #2

PHP Code:
public plugin_init() {    
    
register_forward(FM_CmdStart"fw_CmdStart");
}

public 
fw_CmdStart(id)
{
    if( 
pevidpev_button ) & IN_RELOAD )
    {
        
set_task1.0"OnReload"id )
    }

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-07-2022 , 15:10   Re: Very basic code
Reply With Quote #3

supremache, did you test your code and works?

I think hooking reload works a bit trickier than that: https://forums.alliedmods.net/showth...ht=hook+reload


Not sure honestly .

edit: Now i see , the above code will check when pressing R button but will not hook the actual reload (Use ham for that ).

Here: https://forums.alliedmods.net/showpo...2&postcount=20

Also the author wanted an code snippet if you hold the button pressed more than three seconds.
__________________
Project: Among Us

Last edited by Craxor; 05-07-2022 at 15:19.
Craxor is offline
Send a message via ICQ to Craxor
OW3R
Junior Member
Join Date: Sep 2021
Old 05-08-2022 , 03:40   Re: Very basic code
Reply With Quote #4

Quote:
Originally Posted by Craxor View Post
supremache, did you test your code and works?

I think hooking reload works a bit trickier than that: https://forums.alliedmods.net/showth...ht=hook+reload


Not sure honestly .

edit: Now i see , the above code will check when pressing R button but will not hook the actual reload (Use ham for that ).

Here: https://forums.alliedmods.net/showpo...2&postcount=20

Also the author wanted an code snippet if you hold the button pressed more than three seconds.
Works really well thanks
OW3R 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 05:27.


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