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

Set convar based on flag.


Post New Thread Reply   
 
Thread Tools Display Modes
Terminatorr
Member
Join Date: Dec 2018
Old 12-26-2018 , 03:27   Re: Set convar based on flag.
Reply With Quote #21

Quote:
Originally Posted by Bacardi View Post
*pRed have done this ages ago.
Peek inside others plugin
https://www.sourcemod.net/plugins.ph...tion=&search=1
none of them is what i need, this snippet was done by you somewhere i guise, could be mistaken, however it work out of the box for z, i need it to be enabled out of the box for CUSTOM1,too, but was not able to.
PHP Code:
#include <sdktools>

new bool:HasAccess[MAXPLAYERS +1];

public 
OnPluginStart()
{
    
HookEventEx("bomb_begindefuse"begin);
    
HookEventEx("bomb_beginplant"begin);
}

public 
OnClientPostAdminCheck(client)
{
    
HasAccess[client] = CheckCommandAccess(client"sm_instant_plant_defuse"ADMFLAG_CUSTOM1);
}

public 
begin(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
userid GetEventInt(event"userid");
    if(
StrContains(name"defuse"false) != -1)
    {
        
CreateTimer(5.0timer_delay_defuseuserid);
        return;
    }

    
CreateTimer(5.0timer_delay_plantuserid);
}

public 
Action:timer_delay_defuse(Handle:timerany:userid)
{

    new 
client GetClientOfUserId(userid);

    if(
client != && IsPlayerAlive(client) && HasAccess[client])
    {
        new 
c4 FindEntityByClassname(MaxClients+1"planted_c4");
        if(
c4 != -1)
        {
            
SetEntPropFloat(c4Prop_Send"m_flDefuseCountDown"GetGameTime());
        }
    }
}
public 
Action:timer_delay_plant(Handle:timerany:userid)
{

    new 
client GetClientOfUserId(userid);

    if(
client != && IsPlayerAlive(client) && HasAccess[client])
    {
        new 
c4 GetEntPropEnt(clientProp_Send"m_hActiveWeapon");
        new 
String:classname[30];
        
GetEntityClassname(c4classnamesizeof(classname));
        if(
StrEqual(classname"weapon_c4"false))
        {
            
SetEntPropFloat(c4Prop_Send"m_fArmedTime"GetGameTime());
        }
    }

Terminatorr is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-26-2018 , 04:54   Re: Set convar based on flag.
Reply With Quote #22

5 seconds is long time... try 1.0 second or 0.0

*edit
and another thing is, if you reload/load plugin in middle of the game, your variable HasAccess get clear also.
So player need reconnect after plugin reload. Or change map.
__________________
Do not Private Message @me

Last edited by Bacardi; 12-26-2018 at 04:55.
Bacardi is offline
Terminatorr
Member
Join Date: Dec 2018
Old 12-26-2018 , 05:02   Re: Set convar based on flag.
Reply With Quote #23

Quote:
Originally Posted by Bacardi View Post
5 seconds is long time... try 1.0 second or 0.0

*edit
and another thing is, if you reload/load plugin in middle of the game, your variable HasAccess get clear also.
So player need reconnect after plugin reload. Or change map.
number of seconds is not the issue here, its that Z user have it out of the box`defuse in 5 seconds`, but CUSTOME1, dose not have it. i wish for custom1 to have it out of the box enabled without having to type any command, i guise i need to learn the logic how to have it autoenabled, perhaps with you example me
Terminatorr is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-26-2018 , 06:34   Re: Set convar based on flag.
Reply With Quote #24

could you dump admin cache file

sm_rcon sm_dump_admcache

file is in addons\sourcemod\data\admin_cache_dump.txt
__________________
Do not Private Message @me

Last edited by Bacardi; 12-26-2018 at 06:34.
Bacardi is offline
Terminatorr
Member
Join Date: Dec 2018
Old 12-26-2018 , 06:57   Re: Set convar based on flag.
Reply With Quote #25

Quote:
Originally Posted by Bacardi View Post
could you dump admin cache file

sm_rcon sm_dump_admcache

file is in addons\sourcemod\data\admin_cache_dump.txt
Sure, here is the output.
PHP Code:
"Groups"
{
    
/* num = 1, gid = 0x0 */
    
"Default"
    
{
        
"flags"            ""
        "immunity"        "1"

        "Overrides"
        
{
        }
    }

    
/* num = 2, gid = 0x2C */
    
"Full Admins"
    
{
        
"flags"            "abcdefghiz"
        "immunity"        "99"

        "Overrides"
        
{
        }
    }

    
/* num = 3, gid = 0x5C */
    
"VIP"
    
{
        
"flags"            "o"
        "immunity"        "1"

        "Overrides"
        
{
            
"sv_autobunnyhopping"        "deny"
            "sv_accelerate"        "deny"
            "sv_airaccelerate"        "deny"
            "sv_enablebunnyhopping"        "deny"
            "sv_staminalandcost"        "deny"
            "sv_clamp_unsafe_velocities"        "deny"
            "sv_staminarecoveryrate"        "deny"
            "sv_staminamax"        "deny"
            "sv_staminajumpcost"        "deny"
        
}
    }
}

"Admins"
{
    
/* num = 1, aid = 0x84, serialno = 0x3*/
    
""
    
{
        
"auth"            "steam"
        "identity"        "MYID"
        "flags"            "zo"
        "immunity"        "0"
    
}
}

"Overrides"
{

Terminatorr is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-26-2018 , 07:47   Re: Set convar based on flag.
Reply With Quote #26

ok, did you wipe/edit that ouput "admins" part or do you have only one admin in admin settings ?
Bacardi is offline
Terminatorr
Member
Join Date: Dec 2018
Old 12-26-2018 , 08:05   Re: Set convar based on flag.
Reply With Quote #27

Quote:
Originally Posted by Bacardi View Post
ok, did you wipe/edit that ouput "admins" part or do you have only one admin in admin settings ?
Did not wipe anything, this is my kitchen server.
Terminatorr is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-26-2018 , 08:15   Re: Set convar based on flag.
Reply With Quote #28

ok, what I tested with only "o" flag and change timers to 1.0 sec, works fine.
Not sure how you are doing this...

Which admin file you are using ? admin_simple.ini or admins.cfg ? Show that file.
Bacardi is offline
Terminatorr
Member
Join Date: Dec 2018
Old 12-26-2018 , 08:22   Re: Set convar based on flag.
Reply With Quote #29

Quote:
Originally Posted by Bacardi View Post
ok, what I tested with only "o" flag and change timers to 1.0 sec, works fine.
Not sure how you are doing this...

Which admin file you are using ? admin_simple.ini or admins.cfg ? Show that file.
Thanks for testing, i am using neither of them, am using tvip plugin with flag `o`.
Terminatorr 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 22:37.


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