Raised This Month: $ Target: $400
 0% 

Questions about scripting and HL engine


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-18-2009 , 16:50   Re: Questions about scripting and HL engine
Reply With Quote #7

Quote:
Originally Posted by OlikA View Post
I read that I have to use bitwise operators and get the actual buttons pressed like
PHP Code:
pev(idpev_buttonbutton)
if (
button IN_JUMP
But I want to make a specific plugin that allows me to control another player. No abuse, I'm about to make a public HNS server with bunny hop courses (blockmaker) and it would be great if I could help out newbies to reach what they want. So if they want help, I could easily control them to the right place. I tried this code:

PHP Code:
       pev(idpev_buttonButtons)
        
pev(idpev_anglesAngles)
        
set_pev(Slavepev_buttonButtons)
        
set_pev(Slavepev_anglesAngles
And on the dedicated server, I saw that when I press +forward or simply looking left, the Slave is also was about to go forward and look left but it was only a "visual" change, the Slave didn't saw any change. Give me some minutes and I will post the code.

PHP Code:
pev(idpev_buttonbutton)
if (
button IN_JUMP
it is used this way ->

PHP Code:
button pev(idpev_button)
if (
button IN_JUMP
And yes you need to use the bitwise operators! A good idea is to check all the topics in this thread -> http://forums.alliedmods.net/forumdisplay.php?f=83


PHP Code:
       pev(idpev_buttonButtons)
        
pev(idpev_anglesAngles)
        
set_pev(Slavepev_buttonButtons)
        
set_pev(Slavepev_anglesAngles
For this you should correct the button ones with what I have said above.
And for angles it is correct. Angles must be a float vector.
PHP Code:
    new buttonsFloat:angles[3]
    
buttons pev(idpev_button)
    
pev(idpev_anglesangles)
    
set_pev(Slavepev_buttonbuttons)
    
set_pev(Slavepev_anglesangles
Edit:
I suggest using engine at least when you are a beginner at scripting because it is better when we talk about user friendly access.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 08-18-2009 at 16:54.
ot_207 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 15:06.


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