Raised This Month: $ Target: $400
 0% 

block +moveright &left.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-25-2009 , 04:54   block +moveright &left.
Reply With Quote #1

i tried this one here :

PHP Code:
public client_prethink(id)
{
    new 
button pev(id,pev_button);
    if (
button IN_MOVERIGHT)
    {
        
client_cmd(id"+right;wait;-right")
    }
    if (
button IN_MOVELEFT)
    {
        
client_cmd(id"+left;wait;-left")
    }

i just wanna to block +moveright or left & have only IN_RIGHT or IN_LEFT.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
shine771
Senior Member
Join Date: Jun 2007
Old 05-25-2009 , 04:59   Re: block +moveright &left.
Reply With Quote #2

PHP Code:
if((Buttons IN_MOVERIGHT) && (Buttons IN_RIGHT)) {
    
    
set_pev(id,pev_buttons,Buttons & ~IN_RIGHT)

shine771 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-25-2009 , 05:12   Re: block +moveright &left.
Reply With Quote #3

Quote:
Originally Posted by shine771 View Post
PHP Code:
if((Buttons IN_MOVERIGHT) && (Buttons IN_RIGHT)) {
    
    
set_pev(id,pev_buttons,Buttons & ~IN_RIGHT)

yay, ty. ill test. i hope this work

+k later.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 05-25-2009 , 08:19   Re: block +moveright &left.
Reply With Quote #4

Better use CMDSTART, it is better than PRETHINK for what you want to do ;).

PHP Code:
// PLUGIN_INIT()
register_forward(FM_CmdStart"fw_cmdstart")

public 
fw_cmdstart(iducseed)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED

    
static buttons
    buttons 
get_uc(uc_handleUC_Buttons)

    
// Here do what shine did! but instead of SET_PEV use SET_UC

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-25-2009 , 08:17   Re: block +moveright &left.
Reply With Quote #5

Not tested.
Code:
public plugin_init()         register_forward(FM_CmdStart, "CmdStart");   public CmdStart(Client, Handle) {         static Buttons, InLeftOrRight;         Buttons = get_uc(Handle, UC_Buttons);           if ((Buttons & IN_LEFT) && (Buttons & IN_MOVELEFT))         {                 InLeftOrRight = true;                   Buttons &= ~IN_LEFT;                 Buttons |= ~IN_MOVELEFT;         }           if ((Buttons & IN_RIGHT) && (Buttons & IN_MOVERIGHT))         {                 if (InLeftOrRight)                 {                         Buttons |= ~IN_RIGHT;                         Buttons |= ~IN_MOVERIGHT;                 }                 else                 {                         InLeftOrRight = true;                           Buttons &= ~IN_RIGHT;                         Buttons |= ~IN_MOVERIGHT;                 }         }           if (InLeftOrRight)         {                 set_uc(Handle, UC_Buttons, Buttons);                   return FMRES_SUPERCEDE;         }           return FMRES_IGNORED; }
__________________

Last edited by hleV; 05-25-2009 at 08:20.
hleV is offline
shine771
Senior Member
Join Date: Jun 2007
Old 05-25-2009 , 10:17   Re: block +moveright &left.
Reply With Quote #6

Quote:
+k later.
No need, i've already got excellent karma and it seems like you can't give me more.
shine771 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-26-2009 , 04:33   Re: block +moveright &left.
Reply With Quote #7

Ty again.

no code works.

IN_MOVELEFT/RIGHT still works when i press A or D( +moveright & +moveleft )

imagin u are playing NFS or so, when u press +right or +left, you cant have a side move. you just move the screen. better said, you dont have +moveleft. you have +left.




&& i dont open a new TH for this :

how can i show ° in hud?

100°

i dont want to write GRAD
__________________

Last edited by One; 05-26-2009 at 04:57.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-26-2009 , 05:05   Re: block +moveright &left.
Reply With Quote #8

You can't block something client-side. There is probably an alternative way.
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-26-2009 , 06:03   Re: block +moveright &left.
Reply With Quote #9

Quote:
Originally Posted by arkshine View Post
You can't block something client-side. There is probably an alternative way.
lol? first u say i cant & after this u say there is a alternative way to do this?

or maybe i didnt understood u.

i want just change movexx to xx. this must be poss.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
shine771
Senior Member
Join Date: Jun 2007
Old 05-26-2009 , 11:05   Re: block +moveright &left.
Reply With Quote #10

I suppose you're making an racing mod or something? I've already have done a racing mod. I suggest you use an extra entity for players car, cause it's too messy with players. That's only a lame suggestion. I would finish my own mod, but there was a problem with entity stepsize, that's why i didn't publish it .

About your problem, try
PHP Code:
engclient_cmd(id,"-right"
or

PHP Code:
if((Buttons IN_MOVERIGHT) || (Buttons IN_MOVELEFT)) {
        
      
set_pev(id,pev_button,Buttons & ~IN_RIGHT & ~IN_LEFT)


Last edited by shine771; 05-26-2009 at 11:12.
shine771 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 01:30.


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