Raised This Month: $ Target: $400
 0% 

How would i register a cmd to +forward


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 07-31-2005 , 18:45   How would i register a cmd to +forward
Reply With Quote #1

How would a register a function to a +forward,back,moveright, or moveleft.

Cuz i made a helicopter mod and i want it to dip forward when going forward like in real life. Thatd be kinda cool.
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
D_Hawk
Veteran Member
Join Date: Apr 2005
Location: No
Old 07-31-2005 , 19:05  
Reply With Quote #2

Doesn't this already exist though? AMX Apache (not the webserver)?
__________________
User has abandoned this account.
D_Hawk is offline
Send a message via ICQ to D_Hawk Send a message via AIM to D_Hawk Send a message via MSN to D_Hawk Send a message via Yahoo to D_Hawk
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 07-31-2005 , 19:29  
Reply With Quote #3

AMX Apache

AMX? Its possible
but no, the closetests thing ive seen is that jetpack one. So no, it dosnt exist. I coded it completly by me, sound by me, and a helicopter i think is from shmod.
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 07-31-2005 , 19:34  
Reply With Quote #4

there is a amx apache plugin on the amx forums but it havent been ported to amxmodx
Belsebub is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 07-31-2005 , 19:57  
Reply With Quote #5

well this isnt apache. it was made for rp, and its probably not run the same way. because its probably done with setting the gravity to .0001 then letting them move in the air, like supergirl on superhero mod

mine is made for ts, were setting a user's gravity dosnt work
so i set an invisable ent under the players feet so they stay in the air, but a few coords under so they can slowly land and inviable dosnt work on ts so i had to set_entity_visibility(id, 0), then a i put a copter model over the guy. so it looks like your a copter. then you can use commands like +heli to go up
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 08-01-2005 , 06:38  
Reply With Quote #6

To register stuff on most buttons like +forward etc, you'll have to hook the player's prethink function (I think engine.inc provides a client prethink forward), there check whether the client's buttons entvar (EV_INT_button or EV_INT_buttons or whatever) contains the bit you are searching for (using a simple bitwise and operation)

engine_const.inc contains a list of buttons (the #define IN_* stuff); these may vary across mods though.

You can check how I did it in my broken superkeeper plugin for IOS which can be found somewhere in the Plugins section.
__________________
hello, i am pm
PM is offline
leakgfhp
Member
Join Date: Apr 2005
Old 08-01-2005 , 11:43  
Reply With Quote #7

new moviments

but i dont know how works the oldbuttons

Code:
new buttons[33] //, oldbuttons[33]   public plugin_init() {     register_clcmd("+@attack1","on_attack")     register_clcmd("-@attack1","off_attack")     register_clcmd("+@jump","on_jump")     register_clcmd("-@jump","off_jump")     register_clcmd("+@duck","on_duck")     register_clcmd("-@duck","off_duck")     register_clcmd("+@forward","on_forward")     register_clcmd("-@forward","off_forward")     register_clcmd("+@back","on_back")     register_clcmd("-@back","off_back")     register_clcmd("+@use","on_use")     register_clcmd("-@use","off_use")     register_clcmd("+@cancel","on_cancel")     register_clcmd("-@cancel","off_cancel")     register_clcmd("+@left","on_left")     register_clcmd("-@left","off_left")     register_clcmd("+@right","on_right")     register_clcmd("-@right","off_right")     register_clcmd("+@moveleft","on_moveleft")     register_clcmd("-@moveleft","off_moveleft")     register_clcmd("+@moveright","on_moveright")     register_clcmd("-@moveright","off_moveright")     register_clcmd("+@attack2","on_attack2")     register_clcmd("-@attack2","off_attack2")     register_clcmd("+@run","on_run")     register_clcmd("-@run","off_run")     register_clcmd("+@reload","on_reload")     register_clcmd("-@reload","off_reload")     register_clcmd("+@alt1","on_alt1")     register_clcmd("-@alt1","off_alt1")     register_clcmd("+@score","on_score")     register_clcmd("-@score","off_score") } public on_attack(id){     if(!(buttons[id] & IN_ATTACK)){         buttons[id] += IN_ATTACK     } } public off_attack(id){     if(buttons[id] & IN_ATTACK){         buttons[id] -= IN_ATTACK     }     if(oldbuttons[id] & IN_ATTACK){         oldbuttons[id] -= IN_ATTACK     } } public on_jump(id){     if(!(buttons[id] & IN_JUMP)){         buttons[id] += IN_JUMP     } } public off_jump(id){     if(buttons[id] & IN_JUMP){         buttons[id] -= IN_JUMP     }     if(oldbuttons[id] & IN_JUMP){         oldbuttons[id] -= IN_JUMP     } } public on_duck(id){     if(!(buttons[id] & IN_DUCK)){         buttons[id] += IN_DUCK     } } public off_duck(id){     if(buttons[id] & IN_DUCK){         buttons[id] -= IN_DUCK     }     if(oldbuttons[id] & IN_DUCK){         oldbuttons[id] -= IN_DUCK     } } public on_forward(id){     if(!(buttons[id] & IN_FORWARD)){         buttons[id] += IN_FORWARD     } } public off_forward(id){     if(buttons[id] & IN_FORWARD){         buttons[id] -= IN_FORWARD     }     if(oldbuttons[id] & IN_FORWARD){         oldbuttons[id] -= IN_FORWARD     }   } public on_back(id){     if(!(buttons[id] & IN_BACK)){         buttons[id] += IN_BACK     } } public off_back(id){     if(buttons[id] & IN_BACK){         buttons[id] -= IN_BACK     }     if(oldbuttons[id] & IN_BACK){         oldbuttons[id] -= IN_BACK     }   } public on_use(id){     if(!(buttons[id] & IN_USE)){         buttons[id] += IN_USE     } } public off_use(id){     if(buttons[id] & IN_USE){         buttons[id] -= IN_USE     }     if(oldbuttons[id] & IN_USE){         oldbuttons[id] -= IN_USE     } } public on_cancel(id){     if(!(buttons[id] & IN_CANCEL)){         buttons[id] += IN_CANCEL     } } public off_cancel(id){     if(buttons[id] & IN_CANCEL){         buttons[id] -= IN_CANCEL     }     if(oldbuttons[id] & IN_CANCEL){         oldbuttons[id] -= IN_CANCEL     } } public on_left(id){     if(!(buttons[id] & IN_LEFT)){         buttons[id] += IN_LEFT     } } public off_left(id){     if(buttons[id] & IN_LEFT){         buttons[id] -= IN_LEFT     }     if(oldbuttons[id] & IN_LEFT){         oldbuttons[id] -= IN_LEFT     } } public on_right(id){     if(!(buttons[id] & IN_RIGHT)){         buttons[id] += IN_RIGHT     } } public off_right(id){     if(buttons[id] & IN_RIGHT){         buttons[id] -= IN_RIGHT     }     if(oldbuttons[id] & IN_RIGHT){         oldbuttons[id] -= IN_RIGHT     } } public on_moveleft(id){     if(!(buttons[id] & IN_MOVELEFT)){         buttons[id] += IN_MOVELEFT     } } public off_moveleft(id){     if(buttons[id] & IN_MOVELEFT){         buttons[id] -= IN_MOVELEFT     }     if(oldbuttons[id] & IN_MOVELEFT){         oldbuttons[id] -= IN_MOVELEFT     } } public on_moveright(id){     if(!(buttons[id] & IN_MOVERIGHT)){         buttons[id] += IN_MOVERIGHT     } } public off_moveright(id){     if(buttons[id] & IN_MOVERIGHT){         buttons[id] -= IN_MOVERIGHT     }     if(oldbuttons[id] & IN_MOVERIGHT){         oldbuttons[id] -= IN_MOVERIGHT     } } public on_attack2(id){     if(!(buttons[id] & IN_ATTACK2)){         buttons[id] += IN_ATTACK2     } } public off_attack2(id){     if(buttons[id] & IN_ATTACK2){         buttons[id] -= IN_ATTACK2     }     if(oldbuttons[id] & IN_ATTACK2){         oldbuttons[id] -= IN_ATTACK2     } } public on_run(id){     if(!(buttons[id] & IN_RUN)){         buttons[id] += IN_RUN     } } public off_run(id){     if(buttons[id] & IN_RUN){         buttons[id] -= IN_RUN     }     if(oldbuttons[id] & IN_RUN){         oldbuttons[id] -= IN_RUN     } } public on_reload(id){     if(!(buttons[id] & IN_RELOAD)){         buttons[id] += IN_RELOAD     } } public off_reload(id){     if(buttons[id] & IN_RELOAD){         buttons[id] -= IN_RELOAD     }     if(oldbuttons[id] & IN_RELOAD){         oldbuttons[id] -= IN_RELOAD     } } public on_alt1(id){     if(!(buttons[id] & IN_ALT1)){         buttons[id] += IN_ALT1     } } public off_alt1(id){     if(buttons[id] & IN_ALT1){         buttons[id] -= IN_ALT1     }     if(oldbuttons[id] & IN_ALT1){         oldbuttons[id] -= IN_ALT1     } } public on_score(id){     if(!(buttons[id] & IN_SCORE)){         buttons[id] += IN_SCORE     } } public off_score(id){     if(buttons[id] & IN_SCORE){         buttons[id] -= IN_SCORE     }     if(oldbuttons[id] & IN_SCORE){         oldbuttons[id] -= IN_SCORE     } }
leakgfhp is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 08-01-2005 , 13:03  
Reply With Quote #8

i prethought, and checked if they were moving, thanks anyways
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ 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 15:17.


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