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

task problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-23-2023 , 15:43   task problem
Reply With Quote #1

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

Quote:
new bool:Lockround
PHP Code:
// 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(255255255, -1.00.4501.010.00.10.21)
    new 
nLenszMsg[128]
    
nLen += formatszMsg[nLen], 127-nLen"%L"LANG_SERVER"WELCOME_MSG"VERSION);
    
nLen += formatszMsg[nLen], 127-nLen"%L"LANG_SERVER"BIND_KEY");
    
show_hudmessage(0szMsg);
    
    
print_color(0"%s %s ^x04- ^x01%L"formatmodnameVERSIONLANG_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_numg_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_MovingEntfalseMAXENTS)
    
arrayset(g_EntOwner0MAXENTS)
    
arrayset(g_OwnedEnts0g_MaxPlayers+1)
    
set_task((get_cvar_float("mp_roundtime") * 60) - 21"Lock_round"TASK_ID)

PHP Code:
public Lock_round()
{
    
Lockround false


Lock codes
PHP Code:
public cmdLockBlock(id)
{
    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 ((
Lockround || !access(idADMIN_VOTE)) && !access(idLOCK_BLOCKS))
    {
        if (
access(idADMIN_VOTE))
        {
            
client_print(idprint_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

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

Last edited by Ace67; 03-23-2023 at 15:50.
Ace67 is online now
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-25-2023 , 07:01   Re: task problem
Reply With Quote #2

bump
__________________
CS:CZ > CS 1.6
Ace67 is online now
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-02-2023 , 10:24   Re: task problem
Reply With Quote #3

bump
__________________
CS:CZ > CS 1.6
Ace67 is online now
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-02-2023 , 17:16   Re: task problem
Reply With Quote #4

Can you be more specific about your issue? It's going to take me too much time to reverse engineer your code to figure out what your problem is.

What is the code doing that you do not want it do to? What code does the 'unlock'? The more specific you can be the faster you will get an answer.
__________________
Bugsy is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 04-02-2023 , 18:47   Re: task problem
Reply With Quote #5

Are you identing the code with both spaces and tabs?

Are you checking !access(id, ADMIN_VOTE) twice?

PHP Code:
<TAB>if ((Lockround || <!access(idADMIN_VOTE)>) && !access(idLOCK_BLOCKS))
    {
        if (<
access(idADMIN_VOTE)>)
        {
            
client_print(idprint_chat"[X-BB] You can only lock base at l<e>ast 20 seconds before the round end!");
        }
        return 
PLUGIN_HANDLED;
    } 
Are you excluding the VIP in the lock?

PHP Code:
public Lock_round()
{
    
Lockround false

Are you using integers in the place of floats?

PHP Code:
set_task((get_cvar_float("mp_roundtime") * <60>) - <21>, "Lock_round"TASK_ID
WATCH_D0GS UNITED is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-03-2023 , 04:19   Re: task problem
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
Can you be more specific about your issue? It's going to take me too much time to reverse engineer your code to figure out what your problem is.

What is the code doing that you do not want it do to? What code does the 'unlock'? The more specific you can be the faster you will get an answer.
My code was blocking the lockbase for VIP until 20 seconds before the round endings. At 20 seconds they can lock base but the problem after they cannot unlock at any time their base, so they need to wait until 20 seconds for locking base

The codes for lock & unlock its cmdLockBlock(id)
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 04-03-2023 at 07:56.
Ace67 is online now
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-05-2023 , 11:10   Re: task problem
Reply With Quote #7

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
Are you identing the code with both spaces and tabs?

Are you checking !access(id, ADMIN_VOTE) twice?

PHP Code:
<TAB>if ((Lockround || <!access(idADMIN_VOTE)>) && !access(idLOCK_BLOCKS))
    {
        if (<
access(idADMIN_VOTE)>)
        {
            
client_print(idprint_chat"[X-BB] You can only lock base at l<e>ast 20 seconds before the round end!");
        }
        return 
PLUGIN_HANDLED;
    } 
Are you excluding the VIP in the lock?

PHP Code:
public Lock_round()
{
    
Lockround false

Are you using integers in the place of floats?

PHP Code:
set_task((get_cvar_float("mp_roundtime") * <60>) - <21>, "Lock_round"TASK_ID
Hm what?
__________________
CS:CZ > CS 1.6
Ace67 is online now
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 04-11-2023 , 19:09   Re: task problem
Reply With Quote #8

Try this and come back with the results.

PHP Code:
if ((Lockround || !access(idADMIN_VOTE)) && !access(idLOCK_BLOCKS))
    {
        if (
access(idADMIN_VOTE))
        {
            
client_print(idprint_chat"[X-BB] You can only lock base at last 20 seconds before the round end!");
        }
        return 
PLUGIN_HANDLED;
    } 
TO
PHP Code:
if ((Lockround || !access(idADMIN_VOTE)) && !access(idLOCK_BLOCKS))
    {

        return 
PLUGIN_CONTINUE;
    } 
Uzviseni Bog is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-11-2023 , 22:47   Re: task problem
Reply With Quote #9

Quote:
Originally Posted by Uzviseni Bog View Post
Try this and come back with the results.

PHP Code:
if ((Lockround || !access(idADMIN_VOTE)) && !access(idLOCK_BLOCKS))
    {
        if (
access(idADMIN_VOTE))
        {
            
client_print(idprint_chat"[X-BB] You can only lock base at last 20 seconds before the round end!");
        }
        return 
PLUGIN_HANDLED;
    } 
TO
PHP Code:
if ((Lockround || !access(idADMIN_VOTE)) && !access(idLOCK_BLOCKS))
    {

        return 
PLUGIN_CONTINUE;
    } 
This won't work already did!
__________________
CS:CZ > CS 1.6
Ace67 is online now
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 04-12-2023 , 07:25   Re: task problem
Reply With Quote #10

Quote:
Originally Posted by Ace67 View Post
This won't work already did!


Try to change all of this.
PHP Code:
"CountDown"30000
30sec
PHP Code:
set_task(5.0"Base_Calc"
5sec
PHP Code:
set_task(5.0"Fix_Spawns"
5sec
Uzviseni Bog 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 19:51.


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