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

Apply On ADMFLAG_CUSTOM6


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ApoziX
Member
Join Date: Sep 2018
Old 12-25-2019 , 18:48   Apply On ADMFLAG_CUSTOM6
Reply With Quote #1

Hey I want that to apply only on admflag_custom6 +rep for helpers
PHP Code:
#include <sourcemod>
#include <tf2>

new Handle:crits INVALID_HANDLE;
new 
Handle:chance INVALID_HANDLE;

#define PLUGIN_VERSION "0.1"

public Plugin:myinfo 
{
    
name "SM Crits chance",
    
author "pRED*",
    
description "Change critical hit %",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
};

public 
OnPluginStart()
{
    
crits CreateConVar("sm_crits_enabled""1");
    
chance CreateConVar("sm_crits_chance""1.00");
    
    
CreateConVar("sm_crits_version"PLUGIN_VERSION"Crits Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}


public 
Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
{
    if (!
GetConVarBool(crits))
    {
        return 
Plugin_Continue;    
    }
    
    if (
GetConVarFloat(chance) > GetRandomFloat(0.01.0))
    {
        
result true;
        return 
Plugin_Handled;    
    }
    
    
result false;
    
    return 
Plugin_Handled;

__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
JeremyDF93
Junior Member
Join Date: Dec 2019
Old 12-25-2019 , 19:46   Re: Apply On ADMFLAG_CUSTOM6
Reply With Quote #2

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

new Handle:crits INVALID_HANDLE;
new 
Handle:chance INVALID_HANDLE;

#define PLUGIN_VERSION "0.1"

public Plugin:myinfo 
{
    
name "SM Crits chance",
    
author "pRED*",
    
description "Change critical hit %",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
};

public 
OnPluginStart()
{
    
crits CreateConVar("sm_crits_enabled""1");
    
chance CreateConVar("sm_crits_chance""1.00");
    
    
CreateConVar("sm_crits_version"PLUGIN_VERSION"Crits Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}


public 
Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
{
    if (!
GetConVarBool(crits))
    {
        return 
Plugin_Continue;    
    }

    if (!
IsClientAdmin(clientADMFLAG_CUSTOM6))
    {
        return 
Plugin_Continue;  
    }
    
    if (
GetConVarFloat(chance) > GetRandomFloat(0.01.0))
    {
        
result true;
        return 
Plugin_Handled;    
    }
    
    
result false;
    
    return 
Plugin_Handled;
}

stock bool IsClientAdmin(int clientint flags ADMFLAG_GENERIC) {
    return (
GetUserFlagBits(client) & flags) > 0;

__________________
Find my work helpful? Please consider donating. - Discord: Kiwi#7534
JeremyDF93 is offline
ApoziX
Member
Join Date: Sep 2018
Old 12-25-2019 , 19:54   Re: Apply On ADMFLAG_CUSTOM6
Reply With Quote #3

Thank you +rep mate
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
Reply


Thread Tools
Display Modes

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 16:36.


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