Thread: Block E
View Single Post
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 06-20-2020 , 03:51   Re: Block E
Reply With Quote #5

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

#pragma semicolon 1

public Action:OnPlayerRunCmd(client, &buttons)
{
    if(
buttons IN_USE)
    {
        new 
target GetClientAimTarget(clientfalse);
        
        if(
target != -1)
        {
            if(
IsValidEntity(target))
            {
                new 
String:szClassname[64];
                
GetEntityClassname(targetszClassnamesizeof(szClassname));
                
                if(
StrContains(szClassname"func_button"false) != || StrContains(szClassname"func_rot_button"false) != 1)
                {
                    
buttons &= ~IN_USE;
                    
                    return 
Plugin_Changed;
                }
            }
        }
    }
    
    return 
Plugin_Continue;


Last edited by Kellan123; 06-22-2020 at 10:25. Reason: updated
Kellan123 is offline