AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_Player_Jump (https://forums.alliedmods.net/showthread.php?t=198099)

ColdWar 10-11-2012 14:38

Ham_Player_Jump
 
Hello, I'm using the HAMSANDWICH include for checking the number of jumps a player do.
I use that registerham -
PHP Code:

RegisterHam(Ham_Player_Jump"player""Fwd_JumpCount"1

and this is my "Fwd_JumpCount" public -
PHP Code:

public Fwd_JumpCount client )
{
    
g_jumps[client]++
    
Check_Ach(client)


Every time I jump, it adds 7 to the variable j_jumps[ client ].
Help please :wink:
Btw, this is my variable -
PHP Code:

new g_jumps[33]; 


Guest 10-11-2012 14:43

Re: Ham_Player_Jump
 
Maybe because ur using mwheel up / down to jump instead of space.

ColdWar 10-11-2012 14:46

Re: Ham_Player_Jump
 
Yeah i know but it doesn't metter i guess.. it should not count by +jump or -jump commands..

Guest 10-11-2012 15:01

Re: Ham_Player_Jump
 
It only check the function when +jump function is called and while doing that with mwheel up its called for several times.

jimaway 10-11-2012 16:19

Re: Ham_Player_Jump
 
check if player is on ground before increacing that variable

ConnorMcLeod 10-12-2012 00:30

Re: Ham_Player_Jump
 
If you hold +jump during 1 second, the function gonna be called like 100 times (consider that it is continuously called), this is not reliable to count jumps.

xDrugz 10-12-2012 06:37

Re: Ham_Player_Jump
 
Hook player keys and detect when he press space key.
Then increase your variable by 1 every time he uses space key.

YamiKaitou 10-12-2012 07:13

Re: Ham_Player_Jump
 
Quote:

Originally Posted by xDrugz (Post 1817308)
Hook player keys and detect when he press space key.
Then increase your variable by 1 every time he uses space key.

Not possible without slowhacking, and we do not support slowhacking

.Dare Devil. 10-12-2012 12:24

Re: Ham_Player_Jump
 
Quote:

Originally Posted by xDrugz (Post 1817308)
Hook player keys and detect when he press space key.
Then increase your variable by 1 every time he uses space key.

Better way
PHP Code:

#define IN_JUMP                         (1<<1) 

then check if velocity[2] is more than 1.0 and less than -1.0, this will means that player is in air.

Styles 10-12-2012 21:09

Re: Ham_Player_Jump
 
I check for jumping in my Shove Mod ;)


All times are GMT -4. The time now is 09:25.

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