Raised This Month: $ Target: $400
 0% 

error 017: undefined symbol


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fjlep
Junior Member
Join Date: Apr 2024
Old 05-05-2024 , 19:02   error 017: undefined symbol
Reply With Quote #1

Hello, i cannot compile this code, i get the following message, please help


PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

1.sma
(36) : error 017undefined symbol "CS_TEAM_CT"
1.sma(38) : error 017undefined symbol "CS_TEAM_T"
1.sma(50) : error 088number of arguments does not match definition
1.sma
(54) : warning 213tag mismatch
1.sma
(58) : error 017undefined symbol "server_command"
1.sma(60) : warning 213tag mismatch
1.sma
(67) : error 017undefined symbol "server_command"
1.sma(71) : error 017undefined symbol "server_command"
1.sma(82) : error 017undefined symbol "server_command"
1.sma(88) : error 059: function argument may not have a default value (variable "active")
1.sma(90) : warning 213tag mismatch
1.sma
(99) : error 017undefined symbol "get_args"

9 Errors.
Could not locate output file 1.amx (compile failed
Here code:

PHP Code:
#include <amxmodx>
#include <engine>
#include <amxconst>

#define PLUGIN_VERSION "1.0"
#define PLUGIN_NAME "Warmup Knife Round"
#define MUSIC_FILE "your_music_file.mp3"
#define WARMUP_TIME 60
#define MAX_SPEED 500

new const g_szMusic[] = MUSIC_FILE;
new 
g_fRoundStartTime;
new 
g_bWarmupActive false;

public 
plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSION"Author");

    
register_event("HLTV""Event_HLTV""b");
    
register_event("player_connect""Event_PlayerConnect""b");
    
register_event("round_start""Event_RoundStart""b");
    
register_event("round_end""Event_RoundEnd""b");
}

public 
Event_PlayerConnect(id) {
    if (
get_user_team(id) != 0) {
        
check_start_warmup();
    }
}

public 
check_start_warmup() {
    new 
teamCTPlayers 0;
    new 
teamTPlayers 0;

    for (new 
1<= get_maxplayers(); i++) {
        if (
is_user_connected(i) && !is_user_bot(i)) {
            if (
get_user_team(i) == CS_TEAM_CT) {
                
teamCTPlayers++;
            } else if (
get_user_team(i) == CS_TEAM_T) {
                
teamTPlayers++;
            }
        }
    }

    if (
teamCTPlayers && teamTPlayers && !g_bWarmupActive) {
        
start_warmup_round();
    }
}

public 
start_warmup_round() {
    
set_cvar_string("mp_roundtime"format("%d"WARMUP_TIME));
    
set_cvar_string("mp_freezetime""0");
    
set_cvar_string("mp_round_restart_delay""10");

    
set_cvar_float("sv_maxspeed"MAX_SPEED);

    
play_music();

    
server_command("sv_restartround 1");

    
g_fRoundStartTime get_gametime();
    
g_bWarmupActive true;
}

public 
play_music() {
    new 
szCommand[256];
    
formatex(szCommandsizeof(szCommand), "mp3 play %s"g_szMusic);
    
server_command(szCommand);
}

public 
Event_HLTV() {
    
server_command("mp3 stop");
}

public 
Event_RoundStart() {
    
show_activity();
}

public 
Event_RoundEnd() {
    
show_activity(0);

    for (new 
03i++) {
        
server_command("sv_restartround 1");
    }

    
g_bWarmupActive false;
}

public 
show_activity(active 1) {
    if (
active && g_bWarmupActive) {
        new 
timeRemaining WARMUP_TIME - (get_gametime() - g_fRoundStartTime);
        
show_activity_text("Time Remaining: %d"timeRemaining);
    } else {
        
show_activity_text("");
    }
}

public 
show_activity_text(const msg[], any:...) {
    new 
sBuffer[128];
    
format(sBuffersizeof(sBuffer), msgget_args(1));
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _0);
    
write_byte(1);
    
write_byte(255);
    
write_byte(255);
    
write_byte(255);
    
write_string(sBuffer);
    
message_end();

fjlep is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 05-05-2024 , 19:49   Re: error 017: undefined symbol
Reply With Quote #2

https://www.diffchecker.com/g8mRSQO2/
PHP Code:
#include <amxmodx>
#include <engine>
#include <amxconst>
#include <cstrike_const>

#define PLUGIN_VERSION "1.0"
#define PLUGIN_NAME "Warmup Knife Round"
#define MUSIC_FILE "your_music_file.mp3"
#define WARMUP_TIME 60
#define MAX_SPEED 500.0

new const g_szMusic[] = MUSIC_FILE;
new 
Float:g_fRoundStartTime;
new 
g_bWarmupActive false;

public 
plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSION"Author");

    
register_event("HLTV""Event_HLTV""b");
    
register_event("player_connect""Event_PlayerConnect""b");
    
register_event("round_start""Event_RoundStart""b");
    
register_event("round_end""Event_RoundEnd""b");
}

public 
Event_PlayerConnect(id) {
    if (
get_user_team(id) != 0) {
        
check_start_warmup();
    }
}

public 
check_start_warmup() {
    new 
teamCTPlayers 0;
    new 
teamTPlayers 0;

    for (new 
1<= get_maxplayers(); i++) {
        if (
is_user_connected(i) && !is_user_bot(i)) {
            if (
get_user_team(i) == _:CS_TEAM_CT) {
                
teamCTPlayers++;
            } else if (
get_user_team(i) == _:CS_TEAM_T) {
                
teamTPlayers++;
            }
        }
    }

    if (
teamCTPlayers && teamTPlayers && !g_bWarmupActive) {
        
start_warmup_round();
    }
}

public 
start_warmup_round() {
    
set_cvar_string("mp_roundtime"fmt("%d"WARMUP_TIME));
    
set_cvar_string("mp_freezetime""0");
    
set_cvar_string("mp_round_restart_delay""10");

    
set_cvar_float("sv_maxspeed"MAX_SPEED);

    
play_music();

    
server_cmd("sv_restartround 1");

    
g_fRoundStartTime get_gametime();
    
g_bWarmupActive true;
}

public 
play_music() {
    new 
szCommand[256];
    
formatex(szCommandsizeof(szCommand), "mp3 play %s"g_szMusic);
    
server_cmd(szCommand);
}

public 
Event_HLTV() {
    
server_cmd("mp3 stop");
}

public 
Event_RoundStart() {
    
show_activity();
}

public 
Event_RoundEnd() {
    
show_activity(0);

    for (new 
03i++) {
        
server_cmd("sv_restartround 1");
    }

    
g_bWarmupActive false;
}

stock show_activity(active 1) {
    if (
active && g_bWarmupActive) {
        new 
Float:timeRemaining WARMUP_TIME - (get_gametime() - g_fRoundStartTime);
        
show_activity_text("Time Remaining: %d"timeRemaining);
    } else {
        
show_activity_text("");
    }
}

public 
show_activity_text(const msg[], any:...) {
    new 
sBuffer[128];
    
vformat(sBuffersizeof(sBuffer), msg2);
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _0);
    
write_byte(1);
    
write_byte(255);
    
write_byte(255);
    
write_byte(255);
    
write_string(sBuffer);
    
message_end();

__________________
bigdaddy424 is offline
fjlep
Junior Member
Join Date: Apr 2024
Old 05-05-2024 , 20:57   Re: error 017: undefined symbol
Reply With Quote #3

Quote:
Originally Posted by bigdaddy424 View Post
https://www.diffchecker.com/g8mRSQO2/
PHP Code:
#include <amxmodx>
#include <engine>
#include <amxconst>
#include <cstrike_const>

#define PLUGIN_VERSION "1.0"
#define PLUGIN_NAME "Warmup Knife Round"
#define MUSIC_FILE "your_music_file.mp3"
#define WARMUP_TIME 60
#define MAX_SPEED 500.0

new const g_szMusic[] = MUSIC_FILE;
new 
Float:g_fRoundStartTime;
new 
g_bWarmupActive false;

public 
plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSION"Author");

    
register_event("HLTV""Event_HLTV""b");
    
register_event("player_connect""Event_PlayerConnect""b");
    
register_event("round_start""Event_RoundStart""b");
    
register_event("round_end""Event_RoundEnd""b");
}

public 
Event_PlayerConnect(id) {
    if (
get_user_team(id) != 0) {
        
check_start_warmup();
    }
}

public 
check_start_warmup() {
    new 
teamCTPlayers 0;
    new 
teamTPlayers 0;

    for (new 
1<= get_maxplayers(); i++) {
        if (
is_user_connected(i) && !is_user_bot(i)) {
            if (
get_user_team(i) == _:CS_TEAM_CT) {
                
teamCTPlayers++;
            } else if (
get_user_team(i) == _:CS_TEAM_T) {
                
teamTPlayers++;
            }
        }
    }

    if (
teamCTPlayers && teamTPlayers && !g_bWarmupActive) {
        
start_warmup_round();
    }
}

public 
start_warmup_round() {
    
set_cvar_string("mp_roundtime"fmt("%d"WARMUP_TIME));
    
set_cvar_string("mp_freezetime""0");
    
set_cvar_string("mp_round_restart_delay""10");

    
set_cvar_float("sv_maxspeed"MAX_SPEED);

    
play_music();

    
server_cmd("sv_restartround 1");

    
g_fRoundStartTime get_gametime();
    
g_bWarmupActive true;
}

public 
play_music() {
    new 
szCommand[256];
    
formatex(szCommandsizeof(szCommand), "mp3 play %s"g_szMusic);
    
server_cmd(szCommand);
}

public 
Event_HLTV() {
    
server_cmd("mp3 stop");
}

public 
Event_RoundStart() {
    
show_activity();
}

public 
Event_RoundEnd() {
    
show_activity(0);

    for (new 
03i++) {
        
server_cmd("sv_restartround 1");
    }

    
g_bWarmupActive false;
}

stock show_activity(active 1) {
    if (
active && g_bWarmupActive) {
        new 
Float:timeRemaining WARMUP_TIME - (get_gametime() - g_fRoundStartTime);
        
show_activity_text("Time Remaining: %d"timeRemaining);
    } else {
        
show_activity_text("");
    }
}

public 
show_activity_text(const msg[], any:...) {
    new 
sBuffer[128];
    
vformat(sBuffersizeof(sBuffer), msg2);
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _0);
    
write_byte(1);
    
write_byte(255);
    
write_byte(255);
    
write_byte(255);
    
write_string(sBuffer);
    
message_end();

Thank you =D
fjlep is offline
fjlep
Junior Member
Join Date: Apr 2024
Old 05-07-2024 , 20:49   Re: error 017: undefined symbol
Reply With Quote #4

This appears when entering debug, the error is on line 20, help please.

L 05/07/2024 - 19:036: Start of error session.
L 05/07/2024 - 19:036: Info (map "rush") (file "addons/amxmodx/logs/error_20240507.log")
L 05/07/2024 - 19:036: Invalid event (name "player_connect") (plugin "warmup_speed.amxx")
L 05/07/2024 - 19:036: [AMXX] Run time error 10 (plugin "warmup_speed.amxx") (native "register_event") - debug not enabled!
L 05/07/2024 - 19:036: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 05/07/2024 - 19:23:19: Start of error session.


register_event("player_connect", "Event_PlayerConnect", "b");
fjlep is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 05-07-2024 , 21:15   Re: error 017: undefined symbol
Reply With Quote #5

seems generated by ai
__________________
mlibre is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-07-2024 , 22:15   Re: error 017: undefined symbol
Reply With Quote #6

You're probably right, AI is terrible.
__________________
fysiks is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 05-08-2024 , 23:16   Re: error 017: undefined symbol
Reply With Quote #7

well i feel embarrassed lol this is horrible
__________________
bigdaddy424 is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 05-09-2024 , 09:11   Re: error 017: undefined symbol
Reply With Quote #8

how not to notice such a thing lol
__________________
mlibre is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-10-2024 , 13:08   Re: error 017: undefined symbol
Reply With Quote #9

Could you at least try and explain what you're trying to achieve? This way people don't have to read the code in order to understand what you actually want. There might be someone who could just create this for you as it doesn't seem that big of a job.

Besides that, bigdaddy424 provided you with a code that's only compatible with AMXX 1.10 (fmt()). https://forums.alliedmods.net/showthread.php?t=323270

Retrieving players using get_maxplayers() should be avoided, use get_players() instead.
__________________

Last edited by Napoleon_be; 05-10-2024 at 13:18.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
fjlep
Junior Member
Join Date: Apr 2024
Old 05-10-2024 , 19:18   Re: error 017: undefined symbol
Reply With Quote #10

Quote:
Originally Posted by Napoleon_be View Post
Could you at least try and explain what you're trying to achieve? This way people don't have to read the code in order to understand what you actually want. There might be someone who could just create this for you as it doesn't seem that big of a job.

Besides that, bigdaddy424 provided you with a code that's only compatible with AMXX 1.10 (fmt()). https://forums.alliedmods.net/showthread.php?t=323270

Retrieving players using get_maxplayers() should be avoided, use get_players() instead.
The function of the plugin is that in the first warm-up round it is with a knife and it is activated when there are 2 people (one on each side) at the beginning of the round everyone will have a speed with flash, the music also has to be present and I would like it to be able to be configured using an .ini file and to have the time displayed as a hud of how long that round is lasting and for it to be displayed at the top.
fjlep 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 04:30.


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