Raised This Month: $ Target: $400
 0% 

Solved Orpheu natives


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-15-2018 , 09:08   Re: Orpheu natives
Reply With Quote #2

No, it passes the parameters that are listed in the orpheu file.
OrpheuGetParamStructMember is to be used with structures, not needed in this case.

For DropPlayerItem the function is:
PHP Code:
CBasePlayer::DropPlayerItem(const char *pszItemName
Meaning that the function gets a parameter that is a char array, which in pawn translates to ItemName[MAX_DIM].
But that's not the only parameter. Functions that are member of a class pass the object as the first parameter("this") which in a plugin translates to the entity index. In your case it would be the player index since DropPlayerItem is member of CBasePlayer class.

The correct header would be:
PHP Code:
public @DropPlayerItem(idItemName[32]). 
The OrpheuGetFunction would look like this:
PHP Code:
new OrpheuFunction:DropPlayerItem OrpheuGetFunction("DropPlayerItem""CBasePlayer"); 
And the signature would be:
PHP Code:
{
    
"name" "DropPlayerItem",
    
"class" "CBasePlayer",
    
"library" "mod",
    
"arguments" :
    [
        {
            
"type" "char *"
        
}
    ],
    
"identifiers" :
    [
        {
            
"os" "windows",
            
"mod" "cstrike",
            
"value" : [0x83,"*","*",0x33,"*",0x53,0x55,0x56,0x8b,"*","*","*",0x57,0x8B,"*",0x8B]
        },
        {
            
"os" "linux",
            
"mod" "cstrike",
            
"value" "_ZN11CBasePlayer14DropPlayerItemEPKc"
        
}
    ]

Notice the arguments part, you don't need to specify the object(the entity index), we only mention the ItemName argument.

But I see you are trying to hook Spawn. What spawn are you trying to hook? For what entity?
__________________

Last edited by HamletEagle; 07-15-2018 at 09:15.
HamletEagle is offline
 



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:49.


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