Raised This Month: $307 Target: $400
 76%   Almost there!

Compiling errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ace67
Senior Member
Join Date: Sep 2020
Location: Switzerland
Old 03-19-2023 , 07:41   Compiling errors
Reply With Quote #1

Im getting an error, i did the locking base for 20 seconds of end round for VIP but getting this error tried to find an const/include didn't find it

//// basebuilder54.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuild er54.sma(1025) : error 017: undefined symbol "get_gamerules_round_end_time"

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);
    
    
// Only allow VIPs to lock base during last 20 seconds of the round
    
if (get_gamerules_round_end_time() - get_gametime() <= 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

__________________

Last edited by Ace67; 03-19-2023 at 07:58.
Ace67 is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 03-19-2023 , 10:19   Re: Compiling errors
Reply With Quote #2

Where did you get this get_gamerules_round_end_time?
I didn't get it right
If you want, do it 20 seconds before the end of the build time
__________________
amirwolf is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 03-19-2023 , 10:22   Re: Compiling errors
Reply With Quote #3

For example, at build time 20 seconds before end of time
Block lock is only allowed for ADMIN_VOTE
__________________

Last edited by amirwolf; 03-19-2023 at 10:24.
amirwolf is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: Switzerland
Old 03-19-2023 , 10:24   Re: Compiling errors
Reply With Quote #4

Quote:
Originally Posted by amirwolf View Post
Where did you get this get_gamerules_round_end_time?
I didn't get it right
If you want, do it 20 seconds before the end of the build time
No i don't want it from build time
__________________
Ace67 is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 03-19-2023 , 11:23   Re: Compiling errors
Reply With Quote #5

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
lexzor is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: Switzerland
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 - 3 views - 51.6 KB)
__________________

Last edited by Ace67; 03-19-2023 at 13:06.
Ace67 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-19-2023 , 13:56   Re: Compiling errors
Reply With Quote #7

round_time must be a float value
__________________
bigdaddy424 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: Switzerland
Old 03-19-2023 , 13:57   Re: Compiling errors
Reply With Quote #8

Quote:
Originally Posted by bigdaddy424 View Post
round_time must be a float value
Can you do the editing for me please?
__________________
Ace67 is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 03-19-2023 , 14:07   Re: Compiling errors
Reply With Quote #9

PHP Code:
 new round_time get_cvar_num("mp_roundtime") * 60;
 new 
Float:elapsed_time get_gametime(); 
lexzor is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: Switzerland
Old 03-19-2023 , 14:22   Re: Compiling errors
Reply With Quote #10

Quote:
Originally Posted by lexzor View Post
new round_time = get_cvar_num("mp_roundtime") * 60;
new Float:elapsed_time = get_gametime();
Quote:
Originally Posted by bigdaddy424 View Post
round_time must be a float value


There is one problem, Its working like to 0.20 seconds for VIP, and after admin can't lock base. Its like breaking it.

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 get_cvar_num("mp_roundtime") * 60;
    new 
Float:elapsed_time get_gametime(); 
    new 
Float: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;

__________________

Last edited by Ace67; 03-20-2023 at 15:03.
Ace67 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 14:36.


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