AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client_prethink - buttons (https://forums.alliedmods.net/showthread.php?t=107453)

Vertricus 10-26-2009 19:05

Client_prethink - buttons
 
Can we detect which button's player press without use client_prethink?
If yes how?

minimiller 10-26-2009 19:09

Re: Client_prethink - buttons
 
which buttons do u need?

Vertricus 10-26-2009 19:22

Re: Client_prethink - buttons
 
Duck, Jump, Use, Reload, Attack2, Attack.
That's all ;)

Xellath 10-26-2009 19:35

Re: Client_prethink - buttons
 
You could use FM_CmdStart and get_uc(), with UC_Buttons.

Example:

Code:
#include < amxmodx > #include < fakemeta > const IN_ALL = ( IN_JUMP | IN_DUCK | IN_ATTACK | IN_ATTACK2 | IN_USE | IN_RELOAD ); // You may add more public plugin_init( ) {     register_plugin( "CmdStart Example", "0.1.0", "Xellath" );         register_forward( FM_CmdStart, "Forward_CmdStart" ); } public Forward_CmdStart( iClient, ucHandle ) {     if ( !is_user_alive( iClient ) )         return;         new iButton = get_uc( ucHandle, UC_Buttons );     if ( iButton & IN_ALL )     {         client_print( iClient, print_chat, "You used a button!" );     } }

Vertricus 10-26-2009 20:00

Re: Client_prethink - buttons
 
Thanks a lot Tomorrow I'll test it :)
And one more question :)
Can I without prethink something like:
Quote:

(floatround(halflife_time())-time[id] >= 2.0)

Exolent[jNr] 10-26-2009 20:09

Re: Client_prethink - buttons
 
Why don't you want to use PreThink?

Vertricus 10-26-2009 20:22

Re: Client_prethink - buttons
 
Because I have a large piece of code in it and plugin which I'm using take a lot of "processor".


All times are GMT -4. The time now is 17:41.

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