AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Orpheu] Problem with CBasePlayerWeapon::DefaultDeploy (https://forums.alliedmods.net/showthread.php?t=155700)

Owner123 04-25-2011 14:37

[Orpheu] Problem with CBasePlayerWeapon::DefaultDeploy
 
Hi. I have strange problem. I have plugin to hook this function but when I only hook this function, I cant change weapon.
My code:
PHP Code:

#include <amxmodx>
#include <orpheu>

public plugin_init()
{
    
register_plugin("Orpheu Test""1.0.0""Owner")
    
    
OrpheuRegisterHook(OrpheuGetFunction("DefaultDeploy""CBasePlayerWeapon"), "on_DefaultDeploy"OrpheuHookPost);
}

public 
OrpheuHookReturn:on_DefaultDeploy(enttext1[], text2[], int1text3[], int2)
{
    
client_print(0print_chat"ent=%i %s %s %i %s %i"enttext1text2int1text3int2);
    
    return 
OrpheuIgnored;


And sig:
Code:

{
    "name"      : "DefaultDeploy",
    "class"    : "CBasePlayerWeapon",
    "library"  : "mod",
    "arguments" :
    [
        {
            "type" : "char *"
        },
        {
            "type" : "char *"
        },
        {
            "type" : "int"
        },
        {
            "type" : "char *"
        },
        {
            "type" : "int"
        }
    ],
    "identifiers" :
    [
        {
            "os"    : "windows",
            "mod"  : "cstrike",
            "value" : 0
        },
        {
            "os"    : "linux",
            "mod"  : "cstrike",
            "value" : "DefaultDeploy__17CBasePlayerWeaponPcT1iT1i"
        }
    ]
}

I dont want offset for Windows.

Arkshine 04-25-2011 15:39

Re: [Orpheu] Problem with CBasePlayerWeapon::DefaultDeploy
 
My file :

PHP Code:

{
    
"name"      "DefaultDeploy",
    
"class"     "CBasePlayerWeapon",
    
"library"   "mod",
    
"arguments" 
    [
        {
            
"type" "char *" 
        
},
        {
            
"type" "char *" 
        
},
        {
            
"type" "int" 
        
},
        {
            
"type" "char *" 
        
},
        {
            
"type" "int" 
        
}
    ],
    
"return" :
    {
        
"type" "bool"
    
},
    
"identifiers" 
    [
        {
            
"os"    "windows",
            
"mod"   "cstrike",
            
"value" : [0x53,0x8B,0xD9,0x8B,0x03,0xFF,0x90,"*","*","*","*",0x85,0xC0,0x75,"*",0x5B,0xC2,"*","*",0x8B,0x8B,"*","*","*","*",0x56,0x57,0xE8]
        },
        {
            
"os"    "linux",
            
"mod"   "cstrike",
            
"value" "DefaultDeploy__17CBasePlayerWeaponPcT1iT1i"
        

    ]


You forget the return.

Owner123 04-26-2011 04:38

Re: [Orpheu] Problem with CBasePlayerWeapon::DefaultDeploy
 
Thanks ! Now work properly.


All times are GMT -4. The time now is 20:13.

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