Raised This Month: $51 Target: $400
 12% 

Stopping players from using weapons?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bmxican0091
Member
Join Date: Jan 2010
Location: Australia, Victoria.
Old 08-18-2010 , 01:44   Stopping players from using weapons?
Reply With Quote #1

How can i stop players from using or picking up weapons off the ground? I want to create a plugin that will force players to knife their last kill on my deathmatch server.

EDIT: I found this script which blocks players from picking up weapons, im just struggling to find out how to strip all weapons except knife on every spawn. Code below

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

Is this the right code for blocking weapon pickup?
__________________


Last edited by bmxican0091; 08-18-2010 at 03:13.
bmxican0091 is offline
atom0s
Senior Member
Join Date: Jul 2009
Old 08-18-2010 , 07:32   Re: Stopping players from using weapons?
Reply With Quote #2

This has been asked several times in the past:

http://forums.alliedmods.net/showthr...t=strip+weapon
http://forums.alliedmods.net/showthr...t=strip+weapon

You can also check out the super commands plugin and check how they do their !disarm command and alter it to not remove knives:
http://forums.alliedmods.net/showthread.php?t=57448
atom0s is offline
bmxican0091
Member
Join Date: Jan 2010
Location: Australia, Victoria.
Old 08-18-2010 , 08:35   Re: Stopping players from using weapons?
Reply With Quote #3

ty for you help, i will check this out for sure
__________________

bmxican0091 is offline
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 09:49.


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