Raised This Month: $ Target: $400
 0% 

[REQ] Command stacking between AMXX and the Game itself


  
 
 
Thread Tools Display Modes
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-04-2006 , 16:48   [REQ] Command stacking between AMXX and the Game itself
#1

Example:
In almost every Game you have the Command +jump/-jump,
which, indeed, makes you jump. Now if I do this in my Plugin:
Code:
register_concmd("+jump","something_on",0) register_concmd("-jump","something_off",0)
It has no Effect, because the Game is already using this.
So the Thing I ask you to change is, that both works:
1. Jumping
2. The On and Off Commands
- Not only Number '1.'!
Thanks for Replies in Advance!
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 09-04-2006 , 17:16   Re: [REQ] Command stacking between AMXX and the Game itself
#2

+jump is a client side command
you have to do something like this in prethink
Code:
if(pev( id, pev_buttons ) & IN_JUMP) { //put your jump code here }
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-04-2006 , 17:54   Re: [REQ] Command stacking between AMXX and the Game itself
#3

Thanks alot!
It works just fine in this Case!


Code:
public client_PreThink(id) {     if(pev(id,pev_button)&IN_JUMP)     {         gravityon(id)     }     else     {         gravityoff(id)     } }
__________________
EAT YOUR VEGGIES
Silencer123 is offline
BAILOPAN
Join Date: Jan 2004
Old 09-04-2006 , 18:02   Re: [REQ] Command stacking between AMXX and the Game itself
#4

hi,
i do not understand your other items on the list but as greenberet said, +jump is a usercmd (like impulses), processed internally by the engine. it is not hookable as a client command.
__________________
egg
BAILOPAN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-05-2006 , 08:24   Re: [REQ] Command stacking between AMXX and the Game itself
#5

Quote:
Originally Posted by BAILOPAN View Post
it is not hookable as a client command.
That is what I needed a Solution for.
But there might be other Commands which do not have a fakemeta, client_PreThink or engine
way of Solution and if so there would be no way to solve the Problem, as long as you cannot
do a register_concmd or such via AMXX for Commands which are already defined by the Games Engine
__________________
EAT YOUR VEGGIES
Silencer123 is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-05-2006 , 15:36   Re: [REQ] Command stacking between AMXX and the Game itself
#6

Quote:
Originally Posted by Silencer123 View Post
That is what I needed a Solution for.
But there might be other Commands which do not have a fakemeta, client_PreThink or engine
way of Solution and if so there would be no way to solve the Problem, as long as you cannot
do a register_concmd or such via AMXX for Commands which are already defined by the Games Engine
All console commands that are not processed by the client directly are sent to the server and go through the gamedll's ClientCommand handler, and thus you can hook them using register_clcmd. Commands which are handled on the client never get sent to the server. This means that the only way of knowing that such a command was executed on the client in AMXx (which is a server-side modification) is looking for side-effects (such as the buttons entvar for commands like +attack or client disconnect for commands like quit). It also means that you can't prevent the command from being executed; the best you can do is try to revert its effects.

So no, there is really no server-side solution for this problem.
__________________
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 16:59.


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