AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Linking question (https://forums.alliedmods.net/showthread.php?t=240753)

Storas1337 05-21-2014 19:10

Linking question
 
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

Bugsy 05-23-2014 21:11

Re: Help with functions
 
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 


hornet 05-23-2014 23:49

Re: Help with functions
 
Quote:

Originally Posted by Bugsy (Post 2141731)
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.

DavidJr 05-24-2014 21:30

Re: Help with functions
 
Quote:

Originally Posted by hornet (Post 2141763)
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?

hornet 05-24-2014 23:03

Re: Help with functions
 
Quote:

Originally Posted by DavidJr (Post 2142112)
It bet it is orpheu, isn't it?

Not at all.

DavidJr 05-25-2014 00:55

Re: Help with functions
 
Oh, is there any example, hornet? e.g: IN_RELOAD button

hornet 05-25-2014 01:00

Re: Help with functions
 
Quote:

Originally Posted by DavidJr (Post 2142141)
Oh, is there any example, hornet? e.g: IN_RELOAD button

That button press can be directly hooked with hamsandwich - Ham_Weapon_Reload.

DavidJr 05-25-2014 01:16

Re: Help with functions
 
Oh, what about IN_DUCK, IN_USE, IN_SCORE, and IN_RUN?

Blizzard_87 05-25-2014 04:40

Re: Help with functions
 
Quote:

Originally Posted by DavidJr (Post 2142144)
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

DavidJr 05-25-2014 05:00

Re: Help with functions
 
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?


All times are GMT -4. The time now is 09:36.

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