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

Lock base at 20 seconds round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-17-2023 , 15:44   Lock base at 20 seconds round
Reply With Quote #1

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

Attached Files
File Type: sma Get Plugin or Get Source (basebuilder54.sma - 66 views - 51.1 KB)
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 03-21-2023 at 15:38.
Ace67 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-18-2023 , 16:41   Re: Lock base at 20 seconds round
Reply With Quote #2

bump
__________________
CS:CZ > CS 1.6
Ace67 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-14-2023 , 10:40   Re: Lock base at 20 seconds round
Reply With Quote #3

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.

Last edited by Fuck For Fun; 05-14-2023 at 10:40.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 05-14-2023 , 22:30   Re: Lock base at 20 seconds round
Reply With Quote #4

Quote:
Originally Posted by Ace67 View Post
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...
__________________
bigdaddy424 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 13:26.


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