Raised This Month: $51 Target: $400
 12% 

edit hook jump on players head by Connor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Meelo
Member
Join Date: Aug 2010
Old 07-12-2019 , 17:24   edit hook jump on players head by Connor
Reply With Quote #1

Hello, i have this simple plugin from Connor's last post:
https://forums.alliedmods.net/showthread.php?p=1906203
and it works fine but i have problem with xpmod

PHP Code:
public OnCBasePlayer_PostThinkid )
{
    if( 
is_user_alive(id) )
    {
        new 
Float:flFallVelocity get_pdata_float(idm_flFallVelocity)
        if( 
flFallVelocity 10.0 )
        {
            new 
target pev(idpev_groundentity)
            if( 
IsPlayer(target) && is_user_alive(target) )
            {
                
iExp[id] += gNumExp// nothing happend ( i want give exp to player on the top)
                
iExp[target] += gNumExp// now player on the bottom receives exp
              //  ExecuteHam(Ham_TakeDamage, target, id, id, flFallVelocity * 0.1, DMG_FALL)
            
}
        }
    }

Meelo is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-12-2019 , 18:15   Re: edit hook jump on players head by Connor
Reply With Quote #2

If you have no experience in coding pawn please post in the suggestion requests otherwise everything we will tell you is a nonsense.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-12-2019 at 18:16.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Meelo
Member
Join Date: Aug 2010
Old 07-12-2019 , 18:56   Re: edit hook jump on players head by Connor
Reply With Quote #3

however, maybe some tips how to do it? i would rather do it by myself
Meelo is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-12-2019 , 19:11   Re: edit hook jump on players head by Connor
Reply With Quote #4

First you need to describe what is the problem in order to solve it, what you have commented inside the script has nothing g to do with describing the problem.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-12-2019 at 19:12.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Meelo
Member
Join Date: Aug 2010
Old 07-12-2019 , 19:28   Re: edit hook jump on players head by Connor
Reply With Quote #5

I need to give exp to the player who is standing/jumping on the second player. I tested this plugin and this works:
iExp[target] += gNumExp;
but target = player on the bottom, not on the top. The problem is if i change
iExp[target] += gNumExp;
to
iExp[id] += gNumExp;

nothing happens

Last edited by Meelo; 07-12-2019 at 19:29.
Meelo is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-12-2019 , 20:27   Re: edit hook jump on players head by Connor
Reply With Quote #6

"id" is the player on the top. If it's not working, the problem is elsewhere.

PS: I suggest you have a look at my Goomba Stomp plugin - it does what you want in a much better way + it has a built-in option to give XP.
__________________

Last edited by OciXCrom; 07-12-2019 at 20:27.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-13-2019 , 02:11   Re: edit hook jump on players head by Connor
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
"id" is the player on the top. If it's not working, the problem is elsewhere.

PS: I suggest you have a look at my Goomba Stomp plugin - it does what you want in a much better way + it has a built-in option to give XP.
I don't think he needs a plugin detects when a player fall damage on another player's head...

OP : you can hook touch its much better on the other hand you can work with your method but I don't recommend using player thinking but if you want to work with your method you must do debug printing...

And see if the array cell is getting increased.

Also declare the variables as static in this kind of forwards.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-13-2019 at 02:14.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-14-2019 , 16:13   Re: edit hook jump on players head by Connor
Reply With Quote #8

Quote:
Originally Posted by Meelo View Post
Hello, i have this simple plugin from Connor's last post:
https://forums.alliedmods.net/showthread.php?p=1906203
and it works fine but i have problem with xpmod

PHP Code:
public OnCBasePlayer_PostThinkid )
{
    if( 
is_user_alive(id) )
    {
        new 
Float:flFallVelocity get_pdata_float(idm_flFallVelocity)
        if( 
flFallVelocity 10.0 )
        {
            new 
target pev(idpev_groundentity)
            if( 
IsPlayer(target) && is_user_alive(target) )
            {
                
iExp[id] += gNumExp// nothing happend ( i want give exp to player on the top)
                
iExp[target] += gNumExp// now player on the bottom receives exp
              //  ExecuteHam(Ham_TakeDamage, target, id, id, flFallVelocity * 0.1, DMG_FALL)
            
}
        }
    }

Show me how iExp is created and where it's used. I also advice you to put a log print to see if that part of the code even gets called.
__________________

Last edited by edon1337; 07-14-2019 at 16:13.
edon1337 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 13:38.


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