View Single Post
Author Message
szogun
Senior Member
Join Date: Apr 2016
Old 08-17-2017 , 12:00   Blocking weapons
Reply With Quote #1

I have a request if there is a good soul who will add an exception for people with a Root flag to have a smoke grenade

PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <cstrike>

public OnPluginStart()
{
    
CreateConVar("Clear Weapons""1.0""Linux`");
}
public 
OnEntityCreated(entity, const String:classname[])
{
    if(
entity MaxClients && IsValidEntity(entity))
    {
        if(!
StrEqual(classname"weapon_awp") && StrContains(classname"weapon_"false) != -1)
        if(!
StrEqual(classname"weapon_knife") && StrContains(classname"knife_"false) != -1)
            
SDKHook(entitySDKHook_SpawnOnEntitySpawned);
    }
}
public 
Action:OnEntitySpawned(entity)
{
    
AcceptEntityInput(entity"kill");
    
SDKUnhook(entitySDKHook_SpawnOnEntitySpawned);

szogun is offline