Raised This Month: $ Target: $400
 0% 

JUMP problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alfre
Member
Join Date: Feb 2010
Old 09-20-2012 , 14:29   JUMP problems
Reply With Quote #1

hello all,i need help.
i edited soccerjam plugin.e.g. when i have ball and i jump and i not press e,it will be a task.
Problem is,that when i hold jump button with ball,shows about 10000 texts..
code :
public Player_Jump(id)
{
new button = entity_get_int(id, EV_INT_button)
new usekey = (button & IN_USE)
if(!usekey && id == ballholder)
client_print(0,print_chat,"TEST")
__________________

alfre is offline
Send a message via Skype™ to alfre
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-20-2012 , 16:01   Re: JUMP problems
Reply With Quote #2

how is Player_Jump called?
jimaway is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-20-2012 , 17:45   Re: JUMP problems
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
how is Player_Jump called?
also show the function hooked to player_jump.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
alfre
Member
Join Date: Feb 2010
Old 09-21-2012 , 06:56   Re: JUMP problems
Reply With Quote #4

RegisterHam( Ham_Player_Jump, "player", "Player_Jump" )
__________________

alfre is offline
Send a message via Skype™ to alfre
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-21-2012 , 09:05   Re: JUMP problems
Reply With Quote #5

show the entire function, please.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
alfre
Member
Join Date: Feb 2010
Old 09-21-2012 , 10:14   Re: JUMP problems
Reply With Quote #6

This code only....
this is in soccerjam (ballholder)..
the problem is in holding,it can be fixed with oldbuttons,but i dont know how to make with !usekey and ballholder
public Player_Jump(id)
{
new button = entity_get_int(id, EV_INT_button)
new usekey = (button & IN_USE)
if(!usekey && id == ballholder)
client_print(0,print_chat,"TEST")
__________________

alfre is offline
Send a message via Skype™ to alfre
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-21-2012 , 11:48   Re: JUMP problems
Reply With Quote #7

at the end of the function put this line.
Code:
button &= ~IN_JUMP
set_pev(id, pev_buttons, button)
This will make sure you only press jump once by essentially deactivating the jump button from currently pressed buttons.
Its kinda sloppy, but it should work for you.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
alfre
Member
Join Date: Feb 2010
Old 09-21-2012 , 11:57   Re: JUMP problems
Reply With Quote #8

Quote:
Originally Posted by Liverwiz View Post
at the end of the function put this line.
Code:
set_pev(id, pev_buttons, button)
This will make sure you only press jump once by essentially deactivating the jump button from currently pressed buttons.
Its kinda sloppy, but it should work for you.
so like this?
public Player_Jump(id)
{
button &= ~IN_JUMP
new button = entity_get_int(id, EV_INT_button)
new usekey = (button & IN_USE)
if(!usekey && id == ballholder)
set_pev(id, pev_buttons, button)
client_print(0,print_chat,"TEST")
__________________

alfre is offline
Send a message via Skype™ to alfre
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-21-2012 , 12:32   Re: JUMP problems
Reply With Quote #9

put them at the END. LAST 2 lines of the function.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
alfre
Member
Join Date: Feb 2010
Old 09-21-2012 , 12:56   Re: JUMP problems
Reply With Quote #10

not working.
__________________

alfre is offline
Send a message via Skype™ to alfre
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 08:10.


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