AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get client duck (https://forums.alliedmods.net/showthread.php?t=56172)

Toster v2.1 06-08-2007 01:02

Get client duck
 
Why doesn't this work????

Code:

register_clcmd("+duck","doit")
register_clcmd("-duck","back")


djmd378 06-08-2007 01:55

Re: Get client duck
 
It's because you can't catch those commands like that...

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Catch Duck", "0.1", "MysticDeath.com") } public client_PreThink(id) {     new iButton = get_user_button(id)     if (iButton & IN_DUCK) {         // function here     } }

Toster v2.1 06-08-2007 02:05

Re: Get client duck
 
Thx!

kmal2t 06-08-2007 04:11

Re: Get client duck
 
I think you're supposed to put a return FMRES_HANDLED or whatnot at the end of an FM forward otherwise it returns errors in meta or something.

regalis 06-08-2007 06:45

Re: Get client duck
 
Quote:

Originally Posted by kmal2t (Post 486919)
I think you're supposed to put a return FMRES_HANDLED or whatnot at the end of an FM forward otherwise it returns errors in meta or something.

Why would that return errors?
AFAIK there are no errors when you return nothing..0o

greetz regalis

_Master_ 06-08-2007 08:27

Re: Get client duck
 
I would hook FM_CmdStart for "instant" detection.

VEN 06-08-2007 12:33

Re: Get client duck
 
Button way are incorrect. For example you can be in duck even without any button. Correct way would be:
Quote:

if (pev(id, pev_flags) & FL_DUCKING)

kmal2t 06-08-2007 17:32

Re: Get client duck
 
my bad, he doesn't have any other returns in there. nvmm


All times are GMT -4. The time now is 10:33.

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