Поиск basebuilder plugin task

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
5
Реакции
0
Неверный раздел форума
Hello, I've did task for my Lock. There is a problem the unlock getting impacted so VIP will need to wait until 20 seconds for unlock, tried to do something but didn'work

Unlock should be at any times

PHP:
// Log Event Round Start (This is AFTER freeze time)
public logevent_round_start()
{
    set_pev(g_iEntBarrier,pev_solid,SOLID_BSP)
    set_pev(g_iEntBarrier,pev_rendermode,1)
    DispatchKeyValue(g_iEntBarrier, "renderamt", "255");
    
    set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1)
    new nLen, szMsg[128]
    nLen += format( szMsg[nLen], 127-nLen, "%L", LANG_SERVER, "WELCOME_MSG", VERSION);
    nLen += format( szMsg[nLen], 127-nLen, "%L", LANG_SERVER, "BIND_KEY");
    show_hudmessage(0, szMsg);
    
    print_color(0, "%s %s ^x04- ^x01%L", formatmodname, VERSION, LANG_SERVER, "ROUND_MSG")
    print_color(0, "%s Round: %d of %d", formatmodname, (g_RoundNum+1), g_pcvar_maxrounds)
    
    remove_task(TASK_ROUND)
    remove_task(30000)
    remove_task(TASK_ID)
    
    new iBuildTime = get_pcvar_num( g_pcvar_buildtime );
    set_task(1.0, "CountDown", 30000, "", 0, "a", iBuildTime);
    count_down = (iBuildTime-1);
    set_task(float(iBuildTime), "Release_Zombies", TASK_ROUND)
    
    if (get_pcvar_num(g_pcvar_basecalc) == 1)
        set_task(5.0, "Base_Calc")
        
    set_task(5.0, "Fix_Spawns")
    
    g_CanBuild = true
    lockround=true
    
    arrayset(g_MovingEnt, false, MAXENTS)
    arrayset(g_EntOwner, 0, MAXENTS)
    arrayset(g_OwnedEnts, 0, g_MaxPlayers+1)
    set_task((get_cvar_float("mp_roundtime") * 60) - 21, "Lock_round", TASK_ID)
}
PHP:
public Lock_round()
{
    lockround=false
}

lock codes
PHP:
public cmdLockBlock(id)
{
    new ent, body part
    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 ((Lockround || !access(id, ADMIN_VOTE)) && !access(id, LOCK_BLOCKS))
    {
        if (access(id, ADMIN_VOTE))
        {
            client_print(id, print_chat, "[X-BB] You can only lock base at last 20 seconds before the round end!");
        }
        return PLUGIN_HANDLED;
    }
    
    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
}
 

Вложения

Сообщения
964
Реакции
51
Помог
10 раз(а)
maCxa, как это понять, посмотрел я оригинал и твое творение!!!
Код:
    if ((Lockround || !access(id, ADMIN_VOTE)) && !access(id, LOCK_BLOCKS))
    {
        if (access(id, ADMIN_VOTE))
        {
            client_print(id, print_chat, "[X-BB] You can only lock base at last 20 seconds before the round end!");
        }
        return PLUGIN_HANDLED;
    }
 
Сообщения
5
Реакции
0
Code_0xABC, This is for preset the task to the code lockround its about the time of 20 seconds for execute it

I tried to seperate the task for unlock, but didn't work
 
Сообщения
964
Реакции
51
Помог
10 раз(а)
Код:
/*Add this to plugin_init*/
#define ADMIN_ACCESS ADMIN_MENU
#define VIP_ACCESS ADMIN_LEVEL_H
#define get_access(%0,%1) (get_user_flags(%0) & %1)

/*This is the replace code*/
public cmdLockBlock(id) {
    if(get_access(id, ADMIN_ACCESS) || get_access(id, VIP_ACCESS))
        return;

    if(Lockround) {
        client_print(id, print_chat, "[X-BB] You can only lock base at last 20 seconds before the round end!");
        return;
    }

    new ent, body part;
    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;

    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");
    }
}
 
Сообщения
5
Реакции
0
So VIP will still have 20 seconds of before round end? They can still unlock base at any moment ?
Admin should lock at any times "DEFINE LOCK_BLOCKS"

@maCxa,
Код:
/*Add this to plugin_init*/
#define ADMIN_ACCESS ADMIN_MENU
#define VIP_ACCESS ADMIN_LEVEL_H
#define get_access(%0,%1) (get_user_flags(%0) & %1)

/*This is the replace code*/
public cmdLockBlock(id) {
    if(get_access(id, ADMIN_ACCESS) || get_access(id, VIP_ACCESS))
        return;

    if(Lockround) {
        client_print(id, print_chat, "[X-BB] You can only lock base at last 20 seconds before the round end!");
        return;
    }

    new ent, body part;
    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;

    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");
    }
}
//// basebuilder54.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(1043) : error 001: expected token: ";", but found "-identifier-"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(1043) : error 017: undefined symbol "part"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(1044) : error 017: undefined symbol "bodypart"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(1044) : error 088: number of arguments does not match definition
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(1067) : warning 203: symbol is never used: "body"
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу