I'm NOT such of an expert but i want to make a plugin where if it's 00:00 o'clock admins can't use amx_map with a print in the console and also if it's 00:00 o'clock and another map except de_dust2 to change it automatically that untill 07:00 o'clock.
And i'm stuck with the following errors:
Code:
mapblocker.sma(11) : error 020: invalid symbol name ""
mapblocker.sma(32) : error 033: array must be indexed (variable "mapname1")
mapblocker.sma(35) : error 001: expected token: "-identifier-", but found "="
mapblocker.sma(35) : error 029: invalid expression, assumed zero
mapblocker.sma(35) : warning 215: expression has no effect
mapblocker.sma(47) : error 001: expected token: "-identifier-", but found "="
mapblocker.sma(47) : error 029: invalid expression, assumed zero
mapblocker.sma(47) : warning 215: expression has no effect
mapblocker.sma(54) : error 029: invalid expression, assumed zero
mapblocker.sma(61) : warning 203: symbol is never used: ""
here is the .sma:
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""
new mapname1[] = "de_dust2";
new state = 0,
start,
stop,
minutes,
h,
m,
mapname[64];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_map", "cmdMapDenied", ADMIN_MAP, "<map>")
start = register_cvar( "start_map", "00" );
stop = register_cvar( "end_map", "07" );
minutes = register_cvar( "minutes_map", "00" );
set_task(60.0,"HAIDA");
}
public HAIDA() {
time( h, m, _ );
if(h >= get_pcvar_num( start ) && h < get_pcvar_num( stop ))
{
if(mapname1 == get_mapname(mapname,charsmax(mapname)))
{
server_cmd("amx_map de_dust2");
state = 1;
}
if(h == get_pcvar_num( start ) && m == get_pcvar_num( minutes ))
{
log_amx("***** MAP CHANGE LOCKED *****");
}
}
else if(h < get_pcvar_num( start ) || h >= get_pcvar_num( stop ))
{
if(h == get_pcvar_num( stop ) && m == get_pcvar_num( minutes ))
{
log_amx("***** MAP CHANGE UNLOCKED *****");
state = 2;
}
}
}
public cmdMapDenied(id) {
if (state != 1) {
console_print(id, "***** MAP CHANGE LOCKED *****.");
return PLUGIN_HANDLED;
}
return 1;
}