Raised This Month: $ Target: $400
 0% 

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-17-2011 , 10:12   Re: SDK Hooks 2.0
#1391

Quote:
Originally Posted by xbatista View Post
I'm using WeaponCanUse hook and sometimes weapons dissapear like this (image), as i noticed it happens only on CS:S.
You've posted this numerous times and had the same answer each time.
It's not going to suddenly change.
__________________
asherkin is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-17-2011 , 11:00   Re: SDK Hooks 2.0
#1392

I know thats annoying. Then how it possible to remove weapon without a model?
__________________
xbatista is offline
Send a message via Skype™ to xbatista
joshtrav
Senior Member
Join Date: Sep 2009
Old 05-17-2011 , 22:28   Re: SDK Hooks 2.0
#1393

Quote:
Originally Posted by xbatista View Post
I'm using WeaponCanUse hook and sometimes weapons dissapear like this (image), as i noticed it happens only on CS:S.

Code(it's fine) :
PHP Code:
//On client Put in server
SDKHook(clientSDKHook_WeaponCanUseOnWeaponCanUse);

// callback
public Action:OnWeaponCanUse(clientweapon)
{
    if ( !
IsValidClient(client) )
        return 
Plugin_Continue;

    
decl String:sWeapon[32];
    
GetEdictClassname(weaponsWeaponsizeof(sWeapon));
    
    if ( 
PlayerTeam[client] == CS_TEAM_CT )
    {
        if ( 
GetConVarInt(CvarWeaponRestriction) )
        {
            for (new 
level_equip_id PlayerLevel[client] + 1level_equip_id MAX_LEVELSlevel_equip_id++) 
            { 
                if( 
StrEqual(sWeaponWEAPONCONST[level_equip_id]) )
                {
                    return 
Plugin_Handled;
                }
            }
        }
    }
    else if ( 
PlayerTeam[client] == CS_TEAM_T )
    {
        if( !
StrEqual(sWeapon"weapon_knife") || IsSpawnMode[client] )
        {
            return 
Plugin_Handled;
        }
    }
    
}

// Also if you care strip weapon stock
public Action:Strip_User_Weapons(client)
{
    if ( !
IsValidAlive(client) )
        return 
Plugin_Continue;

    if ( 
PlayerTeam[client] == CS_TEAM_T )
    {
        new 
wepIdx;
        for (new 
CS_SLOT_PRIMARYCS_SLOT_C4 1x++)
        {
            if ( (
wepIdx GetPlayerWeaponSlot(clientx)) != -)
            {  
                
RemovePlayerItem(clientwepIdx);
                
AcceptEntityInput(wepIdx"Kill");
                
//RemoveEdict(wepIdx);
            
}
        }
    }
    else if ( 
PlayerTeam[client] == CS_TEAM_CT )
    {
        new 
wepIdx;
        for (new 
CS_SLOT_PRIMARYCS_SLOT_C4 1x++)
        {
            if ( 
!= CS_SLOT_GRENADE && (wepIdx GetPlayerWeaponSlot(clientx)) != -)
            {  
                
RemovePlayerItem(clientwepIdx);
                
AcceptEntityInput(wepIdx"Kill");
                
//RemoveEdict(wepIdx);
            
}
        }
    }
    
    if ( !
IsSpawnMode[client] )
        
GivePlayerItemclient"weapon_knife" );
    
    
//CreateTimer( 0.1, GiveKnife, client, TIMER_FLAG_NO_MAPCHANGE);
    
    
return Plugin_Continue

We had a similar issue and it seems related to the engine after talking with psychonic. What happens is that the m_hMyWeapons properties for players are not being reset when they drop the weapon nor when another player picks it up.

So when you go to strip one player (A) weapons, you can actually strip the weapon from another player (B) if (A) dropped it and then (B) picked it up.

We got around this by doing a simple
Code:
if(GetEntPropEnt(index, Prop_Data, "m_hOwnerEntity") == client)
before removing the weapon. Hope that helps.
__________________

joshtrav is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-18-2011 , 08:05   Re: SDK Hooks 2.0
#1394

joshtrav thanks and you mean like this:
PHP Code:
new wepIdx;
for (new 
CS_SLOT_PRIMARYCS_SLOT_C4 1x++)
{
    if ( (
wepIdx GetPlayerWeaponSlot(clientx)) != -&& GetEntPropEnt(wepIdxProp_Data"m_hOwnerEntity") == client )
    {  
        
RemovePlayerItem(clientwepIdx);
        
AcceptEntityInput(wepIdx"Kill");
    }

__________________
xbatista is offline
Send a message via Skype™ to xbatista
Denpa
New Member
Join Date: May 2011
Old 05-18-2011 , 19:45   Re: SDK Hooks 2.0
#1395

I've been trying to get SDKHook to work on my Age of Chivalry server for the past while with no luck.

Code:
[SM] Unable to load extension "sdkhooks.ext": Failed to locate IEntityFactoryDictionary sig!
I've tried other versions but then it ends up as

Code:
[SM] Failed metamod attach.
I'm pretty sure there is a way since i've seen other severs with sdkhook features running.

Any help would be appreciated or another way to hook SDKHook_OnTakeDamage tried hooking "player_hurt" but that didn't work.
Denpa is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-18-2011 , 20:52   Re: SDK Hooks 2.0
#1396

Quote:
Originally Posted by Denpa View Post
I've been trying to get SDKHook to work on my Age of Chivalry server for the past while with no luck.

Code:
[SM] Unable to load extension "sdkhooks.ext": Failed to locate IEntityFactoryDictionary sig!
I've tried other versions but then it ends up as

Code:
[SM] Failed metamod attach.
I'm pretty sure there is a way since i've seen other severs with sdkhook features running.

Any help would be appreciated or another way to hook SDKHook_OnTakeDamage tried hooking "player_hurt" but that didn't work.
AOC gamedata has now been added to the repository as well as SM's gamedata updater. You should receive it on next server start.
psychonic is offline
SmackDaddy
Veteran Member
Join Date: Oct 2009
Old 05-19-2011 , 21:14   Re: SDK Hooks 2.0
#1397

Quote:
Originally Posted by psychonic View Post
AOC gamedata has now been added to the repository as well as SM's gamedata updater. You should receive it on next server start.
Sorry for the noob question psychonic, but how do we "enable" auto-updates to the gamedata for SM and SDHooks?
SmackDaddy is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-19-2011 , 21:18   Re: SDK Hooks 2.0
#1398

Quote:
Originally Posted by SmackDaddy View Post
Sorry for the noob question psychonic, but how do we "enable" auto-updates to the gamedata for SM and SDHooks?
It's enabled by default for SM if you're on a release version or for supported 3rd-party extensions on release or dev versions of SM.

You can check the options in sourcemod/configs/core.cfg.

Note that at the time of this post, the only third-party extensions utilizing the official updater are SDKHooks (2.0 and above) and TFDodgeball.

Last edited by asherkin; 05-20-2011 at 00:31. Reason: It's TFDodgeball not TF2 Dodgeball :P
psychonic is offline
DerpyEngie
New Member
Join Date: May 2011
Old 05-20-2011 , 19:06   Re: SDK Hooks 2.0
#1399

<FAILED> file "sdkhooks.ext.so": /home/maxs/orangebox/tf/addons/sourcemod/extensions/sdkhooks.ext.so: cannot open shared object file: No such file or directory


wat.
DerpyEngie is offline
sinblaster
Grim Reaper
Join Date: Feb 2010
Location: Australia
Old 05-20-2011 , 20:37   Re: SDK Hooks 2.0
#1400

nvm
__________________
Happy Happy Joy Joy

sinblaster is offline
Closed Thread



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


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