Raised This Month: $ Target: $400
 0% 

cant get +attack and +attack2


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-01-2004 , 06:01  
Reply With Quote #2

You can't because these are executed client side. The client sends a code rather than the whole command to the server (because these buttons are pressed often).

To execute a function when a player presses attack, i think this should work:

Code:
new g_OldButtons[32]; public server_frame() {    new newButtons[32];    new i, pressedButtons;    for (i=0; i<32; ++i)    {       newButtons[i] = get_user_button(i);       pressedButtons = (newButtons[i] ^ g_OldButtons[i]) & newButtons[i];       if (pressedButtons & IN_ATTACK)          some_func(i);       g_OldButtons[i] = newButtons[i];    } }

That could work (not tested)

get_user_button and IN_ATTACK are defined in engine_stocks.inc and engine_const.inc, so you only have to #include <engine>.

PS: I don't use get_user_oldbutton because it acted weird for me
__________________
hello, i am pm
PM is offline
 



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 14:44.


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