AlliedModders

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

Owner123 08-24-2010 07:03

[Orpheu] Problem with SecondarAttack.
 
Hi.
I want to make for AK-47 Zoom like Aug/Awp. I hook CBasePlayerWeapon::SecondaryAttack with this sig:
Code:

{
    "name"      : "SecondaryAttack",
    "class"    : "CBasePlayerWeapon",
    "library"  : "mod",
    "indexes" :
    [
        {
            "os"    : "windows",
            "mod"  : "cstrike",
            "value" : 88
        },
        {
            "os"    : "linux",
            "mod"  : "cstrike",
            "value" : 90
        }
    ]
}

Sig is ok, but when i turn on my plugin, server crash after start ...
My code:
PHP Code:

#include <amxmodx>
#include <orpheu>

new const gszVersion[] = "1.0.0";

new 
OrpheuFunction:gcAwp;
new 
OrpheuFunction:gcAug;
new 
OrpheuFunction:gcAk47;

public 
plugin_precache()
{
    
gcAk47 OrpheuGetFunctionFromClass("weapon_ak47""SecondaryAttack""CBasePlayerWeapon");
    
gcAug OrpheuGetFunctionFromClass("weapon_aug""SecondaryAttack""CBasePlayerWeapon");
    
gcAwp OrpheuGetFunctionFromClass("weapon_awp""SecondaryAttack""CBasePlayerWeapon");
}

public 
plugin_init()
{
    
register_plugin("Weapon Zoom Changer"gszVersion"Owner");
    
OrpheuRegisterHook(gcAk47"OrpheuSecondaryAttackPre");
}

public 
OrpheuHookReturn:OrpheuSecondaryAttackPre(weapon_ent)
{
    
OrpheuCall(gcAugweapon_ent);
    
    return 
OrpheuSupercede;


Help! :x

Arkshine 08-24-2010 07:13

Re: [Orpheu] Problem with SecondarAttack.
 
If you want a zoom on another weapon, see this plugin : http://forums.alliedmods.net/showthread.php?t=124972

ConnorMcLeod 08-24-2010 08:30

Re: [Orpheu] Problem with SecondarAttack.
 
SecondaryAttack doesn't exist on weapon_ak47, where have you found it ?


All times are GMT -4. The time now is 21:59.

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