Raised This Month: $ Target: $400
 0% 

[CSS] Block weapon pick up


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-06-2009 , 15:05   [CSS] Block weapon pick up
Reply With Quote #1

Is it possible in sourcemod? ...
__________________
xbatista is offline
Send a message via Skype™ to xbatista
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 12-07-2009 , 11:14   Re: [CSS] Block weapon pick up
Reply With Quote #2

yeap, use SDK Hooks extension
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-07-2009 , 14:12   Re: [CSS] Block weapon pick up
Reply With Quote #3

PHP Code:
public OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_WeaponEquipOnWeaponEquip)
}
public 
OnClientDisconnect(client)
{
    if ( 
IsClientInGame(client) )
    {
        
SDKUnhook(clientSDKHook_WeaponEquipOnWeaponEquip)
    }
}
public 
Action:OnWeaponEquip(clientweapon)
{
    
decl String:sWeapon[32];
    
GetEdictClassname(weaponsWeaponsizeof(sWeapon));
    
    if( !
StrEqual(sWeapon"weapon_knife") )
    {
        if( 
Player_Team[client] == CS_TEAM_T )
        {
            return 
Plugin_Handled;
        }
    }
    
    return 
Plugin_Continue;

Seems to work perfect, but if I'll remove SDKUnhook from disconnect, then I'll get server crash on mapchange(when client put in server)
__________________
xbatista is offline
Send a message via Skype™ to xbatista
API
Veteran Member
Join Date: May 2006
Old 12-07-2009 , 15:34   Re: [CSS] Block weapon pick up
Reply With Quote #4

Then why would you remove the SDKUnhook? It is a necessary component of a virtual hook.
__________________
API is offline
Send a message via AIM to API
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-07-2009 , 16:04   Re: [CSS] Block weapon pick up
Reply With Quote #5

I don't understand what you mean ? :]
I just unhook it on disconnect ,becouse of crash,when I delete unhook, then i change map and I've been put in server and Crash
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Antithasys
Moderator
Join Date: Apr 2008
Old 12-07-2009 , 16:11   Re: [CSS] Block weapon pick up
Reply With Quote #6

SDKHooks does the cleanup for you. Don't unhook an entity in that mannor. It does it when the entity is destroyed...
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 12-07-2009 , 19:38   Re: [CSS] Block weapon pick up
Reply With Quote #7

The client entity isn't destroyed though, it's just not used at the time. The problem is that he's trying to hook the entity more than once when the map changes (OnClientPutInServer gets fired again once the map changes and the client enters the game).
bl4nk is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-08-2009 , 00:38   Re: [CSS] Block weapon pick up
Reply With Quote #8

Right bl4nk
__________________
xbatista is offline
Send a message via Skype™ to xbatista
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 12-09-2009 , 20:34   Re: [CSS] Block weapon pick up
Reply With Quote #9

so whats the proper way to use this extension? im confused. do you have to unhook players on disconnect? or is that what was crashing the server? because ive had some issues with the hooks working intermittently.
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-10-2009 , 01:13   Re: [CSS] Block weapon pick up
Reply With Quote #10

Yes you should unhook it on disconnect, I'm getting server crash on the next map when clientputinserver
__________________
xbatista is offline
Send a message via Skype™ to xbatista
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:37.


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