AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Lock base at 20 seconds round (https://forums.alliedmods.net/showthread.php?t=342207)

Ace67 03-17-2023 15:44

Lock base at 20 seconds round
 
1 Attachment(s)
Hi, I want locking base for VIP (ADMIN_VOTE) at 20 seconds of end rounds. I tried to time it but i've got errors.
I want of unlock can be at any times For vip and admin. Admin can lock base at any times. I will add in attachments my basebuilder

PHP Code:

public cmdLockBlock(id)
{
    if (!
access(idLOCK_BLOCKS)) /// For Admin can lock at any timess
        
return PLUGIN_HANDLED
        
    
new entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    new 
tname[7], cname[10];
    
entity_get_string(entEV_SZ_targetnametname6);
    
entity_get_string(entEV_SZ_classnamecname9);

    if (!
ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname"func_wall") || equal(tname"ignore")) return PLUGIN_HANDLED
    
    
if (!IsBlockLocked(ent) && !g_MovingEnt[ent])
    {
        
LockBlock(ent)
        
DispatchKeyValue(ent"rendermode""1");
        
DispatchKeyValue(ent"rendercolor""125.0 0.0 0.0");
        
        
g_OwnedEnts[g_EntOwner[ent]]--
        
g_EntOwner[ent] = 0
    
}
    else if (
IsBlockLocked(ent))
    {
        
UnlockBlock(ent)
        
DispatchKeyValue(ent"rendermode""0");
    }
    return 
PLUGIN_HANDLED



Ace67 03-18-2023 16:41

Re: Lock base at 20 seconds round
 
bump

Fuck For Fun 05-14-2023 10:40

Re: Lock base at 20 seconds round
 
Code:

public cmdLockBlock(id)
{
    new Float:timeRemaining = get_gametime() - g_fTimeRoundEnd

    if (timeRemaining > 20.0 && !access(id, LOCK_BLOCKS))
    {
        // Only allow locking by VIPs within 20 seconds of end round
        return PLUGIN_HANDLED
    }

    new ent, bodypart
    get_user_aiming (id,ent,bodypart)
   
    new tname[7], cname[10];
    entity_get_string(ent, EV_SZ_targetname, tname, 6);
    entity_get_string(ent, EV_SZ_classname, cname, 9);

    if (!ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname, "func_wall") || equal(tname, "ignore")) return PLUGIN_HANDLED
   
    if (!IsBlockLocked(ent) && !g_MovingEnt[ent])
    {
        LockBlock(ent)
        DispatchKeyValue(ent, "rendermode", "1");
        DispatchKeyValue(ent, "rendercolor", "125.0 0.0 0.0");
       
        g_OwnedEnts[g_EntOwner[ent]]--
        g_EntOwner[ent] = 0
    }
    else if (IsBlockLocked(ent))
    {
        UnlockBlock(ent)
        DispatchKeyValue(ent, "rendermode", "0");
    }
    return PLUGIN_HANDLED
}

This modification checks the remaining time of the current round and only allows VIPs to lock blocks within 20 seconds of end round. For admins, they can still lock blocks anytime because of the access(id, LOCK_BLOCKS) check. The unlock feature is still available for VIPs and admins at any time.

bigdaddy424 05-14-2023 22:30

Re: Lock base at 20 seconds round
 
Quote:

Originally Posted by Ace67 (Post 2801360)
Hi, I want locking base for VIP (ADMIN_VOTE) at 20 seconds of end rounds.

i've played this mod and theres perks for having admin flags for locking and moving objects during the build, prep and zombie release phase. strategically theres no point of locking your base when the round is about to end, as you said 20 seconds before round ends, if youve made this far alive knowing that a round can go up to 6 - 7 minutes...


All times are GMT -4. The time now is 07:56.

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