Raised This Month: $ Target: $400
 0% 

Linking question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Storas1337
Senior Member
Join Date: Apr 2009
Location: Lithuania
Old 05-21-2014 , 19:10   Linking question
Reply With Quote #1

Hey i want to add in plugin this function which are below
mine question would be how to make this work when player is pressing shift button
and i need basic tutorial how to link this new function to old one where my main plugin will run ( i mean use function from one plugin to other)
didnt found good example thnx

Code:
BarTime(id, iSeconds = 0)
{
    if( iSeconds < 0 )
    {
        return
    }
    static BarTime = 0
    if( !BarTime )
    {
        BarTime = get_user_msgid("BarTime")
    }

    message_begin(MSG_ONE, BarTime, .player=id)
    write_short( iSeconds )
    message_end()
}
or this one from here https://forums.alliedmods.net/showthread.php?t=147843

Last edited by Storas1337; 05-26-2014 at 15:23.
Storas1337 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2014 , 21:11   Re: Help with functions
Reply With Quote #2

You can't hook random buttons on the persons keyboard, but you can hook certain activities in the game, which are sometimes the same thing.

These can be hooked with FM_CmdStart.
PHP Code:
IN_ATTACK
IN_ATTACK2
IN_BACK
IN_CANCEL
IN_DUCK
IN_FORWARD
IN_JUMP
IN_LEFT
IN_MOVELEFT
IN_MOVERIGHT
IN_RELOAD
IN_RIGHT
IN_RUN
IN_SCORE
IN_USE 
__________________
Bugsy is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-23-2014 , 23:49   Re: Help with functions
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
You can't hook random buttons on the persons keyboard, but you can hook certain activities in the game, which are sometimes the same thing.

These can be hooked with FM_CmdStart.
PHP Code:
IN_ATTACK
IN_ATTACK2
IN_BACK
IN_CANCEL
IN_DUCK
IN_FORWARD
IN_JUMP
IN_LEFT
IN_MOVELEFT
IN_MOVERIGHT
IN_RELOAD
IN_RIGHT
IN_RUN
IN_SCORE
IN_USE 
However there are better ways of hooking some of those keys such as jump, duck, attack, and use which don't require a check every frame.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 05-24-2014 , 21:30   Re: Help with functions
Reply With Quote #4

Quote:
Originally Posted by hornet View Post
However there are better ways of hooking some of those keys such as jump, duck, attack, and use which don't require a check every frame.
It bet it is orpheu, isn't it?
__________________
What are you looking for here?
DavidJr is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-24-2014 , 23:03   Re: Help with functions
Reply With Quote #5

Quote:
Originally Posted by DavidJr View Post
It bet it is orpheu, isn't it?
Not at all.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 05-25-2014 , 00:55   Re: Help with functions
Reply With Quote #6

Oh, is there any example, hornet? e.g: IN_RELOAD button
__________________
What are you looking for here?

Last edited by DavidJr; 05-25-2014 at 00:55.
DavidJr is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-25-2014 , 01:00   Re: Help with functions
Reply With Quote #7

Quote:
Originally Posted by DavidJr View Post
Oh, is there any example, hornet? e.g: IN_RELOAD button
That button press can be directly hooked with hamsandwich - Ham_Weapon_Reload.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 05-25-2014 , 01:16   Re: Help with functions
Reply With Quote #8

Oh, what about IN_DUCK, IN_USE, IN_SCORE, and IN_RUN?
__________________
What are you looking for here?
DavidJr is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-25-2014 , 04:40   Re: Help with functions
Reply With Quote #9

Quote:
Originally Posted by DavidJr View Post
Oh, what about IN_DUCK, IN_USE, IN_SCORE, and IN_RUN?
Hint. Hamsandwich module can handle a few player commands.

Here is some reading

http://www.amxmodx.org/funcwiki.php?go=module&id=24
__________________
Blizzard_87 is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 05-25-2014 , 05:00   Re: Help with functions
Reply With Quote #10

I know, hornet says that keys can be detected without checking it for every frame. I want to know how to detect Un-Duck. In_Duck can be detected with Ham_Player_Duck, but how to detect UnDuck?
__________________
What are you looking for here?
DavidJr 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 23:30.


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