- Amx Mod X
- AMXX 1.9.0-dev
- Ошибка
-
Код:// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(31) : error 021: symbol already defined: "client_print_color"
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(34) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(36) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(39) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(45) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(49) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(56) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(58) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(62) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(67) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(70) : error 021: symbol already defined: "get_user_team"
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(74) : error 021: symbol already defined: "id"
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(74) : warning 218: old style prototypes used with optional semicolumns
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(77) : error 021: symbol already defined: "id"
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(77) : warning 218: old style prototypes used with optional semicolumns
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(80) : error 021: symbol already defined: "id"
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(80) : warning 218: old style prototypes used with optional semicolumns
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(81) : error 054: unmatched closing brace
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(82) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(84) : warning 218: old style prototypes used with optional semicolumns
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(85) : error 054: unmatched closing brace
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(89) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(95) : error 021: symbol already defined: "get_players"
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(96) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(98) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(105) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(107) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(110) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(114) : error 010: invalid function or declaration
// H:\Ёрсюўшщ ёЄюы\HLDS_6153_Windows\cstrike\addons\amxmodx\scripting\include\colorchat.inc(115) : error 010: invalid function or declaration
- Исходник
-
Код:#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif
enum _:CVARS {NIGHTMODE, SHOW_TYPE, HUDSYSTEM, REMOVE_FLAG, REMOVE_ALL };
new Array:g_StartTime
new Array:g_EndTime
new Array:g_Flag
new Array:g_IgnoreFlag
new Float:g_posX;
new Float:g_posY;
new Float:g_time;
static szRgbRRR[8], szRgbGGG[8], szRgbBBB[8], szPosX[8], szPosY[8], szHoldTime[8], szHudType[8];
new szHudSettings[128], g_rgbR, g_rgbG, g_rgbB, g_type, Holiday_Start[384], Holiday_End[384], Holiday_Flag[16], Holiday_Ignore[16];
new g_bMode_Holiday, g_bMode_Night, give_holiday, give_night, ig_night, ig_holiday;
new g_pCvars[CVARS], g_Holiday_StartNum, g_Current, Night_Ignore[16];
public plugin_precache(){
Init_Cvars();
LoadSettings();
}
public plugin_init(){
g_StartTime=ArrayCreate(384);
g_EndTime=ArrayCreate(384);
g_Flag=ArrayCreate(16);
g_IgnoreFlag=ArrayCreate(16);
register_plugin("Ultimate Flags", "29.10.19", "by detu mou");
register_dictionary("ultimate_flags.txt");
register_event("ResetHUD","spawn_show","b","");
register_srvcmd("flags_holiday", "setholiday");
new szPath[64];
get_localinfo("amxx_configsdir", szPath, charsmax(szPath));
ExecConfigs(szPath);
}
stock Init_Cvars(){
g_pCvars[HUDSYSTEM] = register_cvar("flags_hud", "");
g_pCvars[NIGHTMODE] = register_cvar("flags_night", "");
g_pCvars[SHOW_TYPE] = register_cvar("flags_info", "1");
g_pCvars[REMOVE_ALL] = register_cvar("flags_remove", "1");
g_pCvars[REMOVE_FLAG] = register_cvar("flags_z", "1");
}
public LoadSettings(){
get_pcvar_string(g_pCvars[HUDSYSTEM], szHudSettings, charsmax(szHudSettings));
parse(szHudSettings, szRgbRRR, charsmax(szRgbRRR), szRgbGGG, charsmax(szRgbGGG), szRgbBBB, charsmax(szRgbBBB), szPosX, charsmax(szPosX), szPosY, charsmax(szPosY), szHoldTime, charsmax(szHoldTime), szHudType, charsmax(szHudType));
g_rgbR = str_to_num(szRgbRRR);
g_rgbG = str_to_num(szRgbGGG);
g_rgbB = str_to_num(szRgbBBB);
g_type = str_to_num(szHudType);
g_posX = str_to_float(szPosX);
g_posY = str_to_float(szPosY);
g_time = str_to_float(szHoldTime);
}
public client_putinserver(id){
if(g_bMode_Night){
set_task(10.0, "ConnectNight");
}
if(g_bMode_Holiday){
set_task(10.0, "ConnectHoliday");
}
}
public spawn_show(id){
set_task(0.1,"Task_Spawns",1,_,_,_,1)
}
public Task_Spawns(id){
TaskCheck_Holiday();
TaskCheck_Night();
if(g_bMode_Night){
if(get_pcvar_num(g_pCvars[REMOVE_FLAG])){
remove_user_flags(id, read_flags("z"));
}
if(~get_user_flags(id) & ig_night){
set_user_flags(id,give_night);
//client_print_color(0, print_team_default, "^1ТЕСТ^3 НОЧНОЙ РЕЖИМ ВКЛЮЧЕН И РАБОТАЕТ^1.");
}
}
if(g_bMode_Holiday){
if(get_pcvar_num(g_pCvars[REMOVE_FLAG])){
remove_user_flags(id, read_flags("z"));
}
if(~get_user_flags(id) & ig_holiday){
set_user_flags(id,give_holiday);
//client_print_color(0, print_team_default, "^1ТЕСТ^3 HOLIDAY РЕЖИМ ВКЛЮЧЕН И РАБОТАЕТ^1.");
}
}
}
public TaskCheck_Holiday(){
if (g_Current >= g_Holiday_StartNum)
g_Current = 0
if (g_Holiday_StartNum==0){
return;
}
ArrayGetString(g_StartTime, g_Current, Holiday_Start, charsmax(Holiday_Start));
ArrayGetString(g_EndTime, g_Current, Holiday_End, charsmax(Holiday_End));
ArrayGetString(g_Flag, g_Current, Holiday_Flag, charsmax(Holiday_Flag));
ArrayGetString(g_IgnoreFlag, g_Current, Holiday_Ignore, charsmax(Holiday_Ignore));
give_holiday = read_flags(Holiday_Flag);
ig_holiday = read_flags(Holiday_Ignore);
new bOldMode_Holiday = g_bMode_Holiday;
if(parse_time(Holiday_Start, "%d.%m.%y %H:%M") != parse_time(Holiday_End, "%d.%m.%y %H:%M") && (parse_time(Holiday_Start, "%d.%m.%y %H:%M") == get_systime() && parse_time(Holiday_End, "%d.%m.%y %H:%M") == get_systime())){
g_bMode_Holiday = true;
}else if(parse_time(Holiday_Start, "%d.%m.%y %H:%M") == parse_time(Holiday_End, "%d.%m.%y %H:%M")){
g_bMode_Holiday = true;
}else if(parse_time(Holiday_Start, "%d.%m.%y %H:%M") > parse_time(Holiday_End, "%d.%m.%y %H:%M") && (parse_time(Holiday_Start, "%d.%m.%y %H:%M") < get_systime() < parse_time(Holiday_End, "%d.%m.%y %H:%M"))){
g_bMode_Holiday = true;
}else if(parse_time(Holiday_Start, "%d.%m.%y %H:%M") < get_systime() < parse_time(Holiday_End, "%d.%m.%y %H:%M")){
g_bMode_Holiday = true;
}else{
g_bMode_Holiday = false;
++g_Current;
}
if(g_bMode_Holiday && !bOldMode_Holiday){
set_task(20.0, "StartHolidayShow");
}
if(!g_bMode_Holiday && bOldMode_Holiday){
set_task(20.0, "StopshowHoliday");
++g_Current;
}
}
public TaskCheck_Night(){
new szNight_Time[128], Night_Start[8], Night_End[8], Night_Flag[64], iStartHour, iStartMinutes, iEndHour, iEndMinutes;
get_pcvar_string(g_pCvars[NIGHTMODE], szNight_Time, charsmax(szNight_Time));
parse(szNight_Time, Night_Start, charsmax(Night_Start), Night_End, charsmax(Night_End), Night_Flag, charsmax(Night_Flag), Night_Ignore, charsmax(Night_Ignore));
get_int_time(Night_Start, iStartHour, iStartMinutes);
get_int_time(Night_End, iEndHour, iEndMinutes);
give_night = read_flags(Night_Flag)
ig_night = read_flags(Night_Ignore)
new iCurHour, iCurMinutes; time(iCurHour, iCurMinutes);
new bOldMode_Night = g_bMode_Night;
if(iStartHour != iEndHour && (iStartHour == iCurHour && iCurMinutes >= iStartMinutes || iEndHour == iCurHour && iCurMinutes < iEndMinutes)){
g_bMode_Night = true;
}else if(iStartHour == iEndHour && iStartMinutes <= iCurMinutes < iEndMinutes){
g_bMode_Night = true;
}else if(iStartHour > iEndHour && (iStartHour < iCurHour < 24 || 0 <= iCurHour < iEndHour)){
g_bMode_Night = true;
}else if(iStartHour < iCurHour < iEndHour){
g_bMode_Night = true;
}else{
g_bMode_Night = false;
}
if(g_bMode_Night && !bOldMode_Night){
set_task(15.0, "StartNightShow");
}
if(!g_bMode_Night && bOldMode_Night){
set_task(15.0, "StopshowNight");
}
}
public setholiday(){
read_argv(1, Holiday_Start, charsmax(Holiday_Start))
read_argv(2, Holiday_End, charsmax(Holiday_End))
read_argv(3, Holiday_Flag, charsmax(Holiday_Flag))
read_argv(4, Holiday_Ignore, charsmax(Holiday_Ignore))
g_Holiday_StartNum++
ArrayPushString(g_StartTime, Holiday_Start);
ArrayPushString(g_EndTime, Holiday_End);
ArrayPushString(g_Flag, Holiday_Flag);
ArrayPushString(g_IgnoreFlag, Holiday_Ignore);
return PLUGIN_HANDLED
}
public StartHolidayShow(id){
ArrayGetString(g_StartTime, g_Current, Holiday_Start, charsmax(Holiday_Start));
ArrayGetString(g_EndTime, g_Current, Holiday_End, charsmax(Holiday_End));
client_print_color(0, print_team_default, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_CHAT", Holiday_Start, Holiday_End);
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(0, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_HUD", Holiday_Start, Holiday_End);
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(0, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_HUD", Holiday_Start, Holiday_End);
}
return PLUGIN_HANDLED
}
public StartNightShow(id){
client_print_color(0, print_team_default "%L", LANG_PLAYER, "FLAGS_NIGHT_START_CHAT");
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(0, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_HUD");
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(0, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_HUD");
}
return PLUGIN_HANDLED
}
ExecConfigs(amxxcfgdir[]){
new szFullDir[128];
formatex(szFullDir, charsmax(szFullDir), "%s/ultimate_flags.cfg", amxxcfgdir);
ExecCfg(szFullDir);
}
ExecCfg(const cfg[]){
server_cmd("exec %s", cfg);
server_exec();
}
get_int_time(string[], &hour, &minutes){
new left[4], right[4]; strtok(string, left, charsmax(left), right, charsmax(right), ':');
hour = str_to_num(left);
minutes = str_to_num(right);
}
public ConnectHoliday(id){
ArrayGetString(g_StartTime, g_Current, Holiday_Start, charsmax(Holiday_Start));
ArrayGetString(g_EndTime, g_Current, Holiday_End, charsmax(Holiday_End));
if(get_pcvar_num(g_pCvars[SHOW_TYPE]) == 1){
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_HUD", Holiday_Start, Holiday_End);
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_HUD", Holiday_Start, Holiday_End);
}
}
if(get_pcvar_num(g_pCvars[SHOW_TYPE]) == 2){
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_CHAT", Holiday_Start, Holiday_End);
}
if(get_pcvar_num(g_pCvars[SHOW_TYPE]) == 3){
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_CHAT", Holiday_Start, Holiday_End);
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_HUD", Holiday_Start, Holiday_End);
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_START_HUD", Holiday_Start, Holiday_End);
}
}
return PLUGIN_HANDLED
}
public ConnectNight(id){
if(get_pcvar_num(g_pCvars[SHOW_TYPE]) == 1){
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_HUD");
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_HUD");
}
}
if(get_pcvar_num(g_pCvars[SHOW_TYPE]) == 2){
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_CHAT");
}
if(get_pcvar_num(g_pCvars[SHOW_TYPE]) == 3){
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_CHAT");
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_HUD");
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_START_HUD");
}
}
return PLUGIN_HANDLED
}
public StopshowHoliday(id){
if(get_pcvar_num(g_pCvars[REMOVE_ALL]) == 1){
server_cmd("amx_reloadadmins");
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_STOP_HUD");
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_STOP_HUD");
}
}
if(get_pcvar_num(g_pCvars[REMOVE_ALL]) == 2){
server_cmd("amx_reloadadmins");
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_STOP_CHAT");
}
if(get_pcvar_num(g_pCvars[REMOVE_ALL]) == 3){
server_cmd("amx_reloadadmins");
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_STOP_CHAT");
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_STOP_HUD");
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_HOLIDAY_STOP_HUD");
}
}
return PLUGIN_HANDLED
}
public StopshowNight(id){
if(get_pcvar_num(g_pCvars[REMOVE_ALL]) == 1){
server_cmd("amx_reloadadmins");
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_STOP_HUD");
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_STOP_HUD");
}
}
if(get_pcvar_num(g_pCvars[REMOVE_ALL]) == 2){
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_NIGHT_STOP_CHAT");
}
if(get_pcvar_num(g_pCvars[REMOVE_ALL]) == 3){
server_cmd("amx_reloadadmins");
client_print_color(id, print_team_default, "%L", LANG_PLAYER, "FLAGS_NIGHT_STOP_CHAT");
if (g_type){
set_dhudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00);
show_dhudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_STOP_HUD");
}else{
set_hudmessage(g_rgbR, g_rgbG, g_rgbB, g_posX, g_posY, 0, 0.00, g_time, 0.00, 0.00, -1);
show_hudmessage(id, "%L", LANG_PLAYER, "FLAGS_NIGHT_STOP_HUD");
}
}
return PLUGIN_HANDLED
}
public plugin_end(){
ArrayDestroy(g_StartTime);
ArrayDestroy(g_EndTime);
ArrayDestroy(g_Flag);
ArrayDestroy(g_IgnoreFlag);
}
в обсуждение смотрел решение, мне не помогло )