Hello, I'm getting a compiler error when I compile my code.
(note, i use "register_forward(FM_AlertMessage, "alertmessage", 1)")
(note2, i declare g_touchmap with "new g_touchmap[4][32]")
I also have bolded the line I get the error on - error 009: Invalid array size (negative or zero)
So anyone know what I'm doing wrong?
My code is as follows:
Code:
public alertmessage(atype, message[]) {
if(containi(message,"force_map_") > -1) {
new sstart = containi(message,"force_map_") + 10
new empty[32]
new forcemapstring[76]
g_touchmap[0] = empty
for(new i = sstart; i < (strlen(message) -2); i++) {
g_touchmap[0][i - sstart] = message[i]
}
format(forcemapstring, 75, "Forcing map change to: %s", g_touchmap)
msc_hudprint_all("Forcing Map", forcemapstring)
client_print(0, print_console, "Forcing map change to: %s", g_touchmap)
g_Answer = "dochangelevel %s"
g_execLen = format(g_Execute,255,g_Answer,g_touchmap) + 1
set_task(2.0, "delayedExec", 451986, g_Execute, g_execLen)
return PLUGIN_HANDLED
}
}