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 (c) 1997-2013 ITB CompuPhase, AMX Mod X Team
1.sma(36) : error 017: undefined symbol "CS_TEAM_CT"
1.sma(38) : error 017: undefined symbol "CS_TEAM_T"
1.sma(50) : error 088: number of arguments does not match definition
1.sma(54) : warning 213: tag mismatch
1.sma(58) : error 017: undefined symbol "server_command"
1.sma(60) : warning 213: tag mismatch
1.sma(67) : error 017: undefined symbol "server_command"
1.sma(71) : error 017: undefined symbol "server_command"
1.sma(82) : error 017: undefined symbol "server_command"
1.sma(88) : error 059: function argument may not have a default value (variable "active")
1.sma(90) : warning 213: tag mismatch
1.sma(99) : error 017: undefined 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_NAME, PLUGIN_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 i = 1; i <= 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 > 0 && teamTPlayers > 0 && !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(szCommand, sizeof(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 i = 0; i < 3; i++) {
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(sBuffer, sizeof(sBuffer), msg, get_args(1));
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, 0);
write_byte(1);
write_byte(255);
write_byte(255);
write_byte(255);
write_string(sBuffer);
message_end();
}