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

Ham_ObjectCaps bug ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-31-2022 , 06:17   Ham_ObjectCaps bug ?
Reply With Quote #1

I've two plugins each of them hooking objectcaps for info_target, and its failing to call use for the first plugin in the plugin.ini list? why is that happening ?


First plugin.
PHP Code:

#define DOLL_ID 909069

#define PEV_IDENTITY pev_iuser4

public plugin_init()
{

    
RegisterHam(Ham_ObjectCaps"info_target""doll_objectcaps_pre");
}

public 
doll_use_post(idcalleractivatoruse_typeFloat:value)
{
    if(
pev(idPEV_IDENTITY) != DOLL_ID)
    {
        return 
HAM_IGNORED;
    }

    
doll_control_menu(callerid);
    return 
HAM_IGNORED;
}

public 
doll_objectcaps_pre(id)
{
    if(
pev(idPEV_IDENTITY) != DOLL_ID)
    {
        return 
HAM_IGNORED;
    }

    
SetHamReturnInteger(FCAP_IMPULSE_USE);
    return 
HAM_OVERRIDE;

Second plugin.

PHP Code:
#define NPC_ID 85471

#define PEV_IDENTITY pev_iuser4

public plugin_init()
{
    
RegisterHam(Ham_ObjectCaps"info_target""npc_objectcaps_pre");
}


public 
npc_use_post(idcalleractivatoruse_typeFloat:value)
{
    if(
pev(idPEV_IDENTITY) != NPC_ID || pev(idPEV_OWNER) != caller)
    {
        return 
HAM_IGNORED;
    }
    
    new 
Float:fHealth;
    
pev(idpev_healthfHealth);
    if(
fHealth <= 0.0)
    {
        return 
HAM_IGNORED;
    }
    
    
pet_control_menu(callerid);
    return 
HAM_IGNORED;
}

public 
npc_objectcaps_pre(id)
{
    if(
pev(idPEV_IDENTITY) != NPC_ID)
    {
        return 
HAM_IGNORED;
    }
    
    
SetHamReturnInteger(FCAP_IMPULSE_USE);
    return 
HAM_OVERRIDE;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-22-2022 at 06:40.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Old 06-04-2022, 13:51
Natsheh
This message has been deleted by HamletEagle. Reason: Do not bump
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-15-2022 , 21:48   Re: Ham_ObjectCaps bug ?
Reply With Quote #2

bump
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-15-2022 at 21:48.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-21-2022 , 23:22   Re: Ham_ObjectCaps bug ?
Reply With Quote #3

Post full code, at least constants definition and functions registration
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-22-2022 , 06:41   Re: Ham_ObjectCaps bug ?
Reply With Quote #4

Quote:
Originally Posted by meTaLiCroSS View Post
Post full code, at least constants definition and functions registration
Done 1st post was edited
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-23-2022 , 12:10   Re: Ham_ObjectCaps bug ?
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Done 1st post was edited
Well it seems you are not providing the entire code because I see no fault in the coding and you're missing some function hooking.

Quote:
Provide code. No matter how great your explanation is, nothing explains your code better than itself. As said on the previous section, isolate your problem, post the snippet, and attach the full code.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-23-2022 , 15:13   Re: Ham_ObjectCaps bug ?
Reply With Quote #6

Quote:
Originally Posted by meTaLiCroSS View Post
Well it seems you are not providing the entire code because I see no fault in the coding and you're missing some function hooking.
I did not miss any function hooking, the problem is not in the two plugins, the problem is related to the
ham module.

You can give it a test yourself and see what i am talking about.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-23-2022 , 17:18   Re: Ham_ObjectCaps bug ?
Reply With Quote #7

PHP Code:
public npc_objectcaps_pre(id)
{
    if(
pev(id,PEV_IDENTITY) == NPC_ID)
    {
        
SetHamReturnInteger(FCAP_IMPULSE_USE);

        return 
HAM_OVERRIDE;
    }

    return 
HAM_IGNORED;

I think this will not changed nothing, but there is.

Also test if npc_objectcaps_pre is called on second plugin.
Or finally hook using RegisterHamFromEntity
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 12:20.


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