View Single Post
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-19-2023 , 12:03   Re: Compiling errors
Reply With Quote #6

Quote:
Originally Posted by lexzor View Post
that error means you don't have a native called get_gamerules_round_end_time.

you forgot to include the .inc file of the main plugin or the native doesn't exist in plugin and .inc file
Can you do it for me please. It was for time it

I did that.
PHP Code:
public cmdLockBlock(id)
{
    new 
entbodypart;
    
get_user_aiming(identbodypart);
    
    new 
tname[7], cname[10];
    
entity_get_string(entEV_SZ_targetnametname6);
    
entity_get_string(entEV_SZ_classnamecname9);
    
    
// Get the remaining time in seconds
    
new round_time cvar("mp_roundtime") * 60;
    new 
elapsed_time get_gametime();
    new 
remaining_time round_time elapsed_time;
    
    
// Only allow VIPs to lock base during last 20 seconds of the round
    
if (remaining_time <= 20)
    {
        if (!
access(idADMIN_VOTE))
        {
            
client_print(idprint_chat"Only VIPs can lock the base during the last 20 seconds of the round.");
            return 
PLUGIN_HANDLED;
        }
    }
    
// Admins can lock the base any time
    
else if (!access(idLOCK_BLOCKS))
    {
        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;

//// basebuilder54.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuild er54.sma(1025) : error 017: undefined symbol "cvar"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuild er54.sma(1026) : warning 213: tag mismatch
Attached Files
File Type: sma Get Plugin or Get Source (basebuilder54 (8).sma - 45 views - 51.6 KB)
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 03-19-2023 at 13:06.
Ace67 is offline