return ret;
}
-void IRCSay(string sourcename, string msgin)
+void IRCSay(string msgstr)
{
- entity head;
-
- if(substring(msgin, 0, 1) == " ")
- msgin = substring(msgin, 1, strlen(msgin) - 1); // work around DP say bug (say_team does not have this!)
-
- //msgin = formatmessage(msgin);
-
- if(msgin == "")
+ if(msgstr == "")
return;
- string msgstr = strcat("\{1}[IRC] ", sourcename, "^7", msgin);
+ msgstr = strcat("\{1}", strreplace("\n", " ", msgstr), "\n"); // newlines only are good for centerprint
- msgstr = strcat(strreplace("\n", " ", msgstr), "\n"); // newlines only are good for centerprint
-
- FOR_EACH_CLIENTSLOT(head)
+ entity head;
+ FOR_EACH_REALCLIENT(head)
{
if(!intermission_running)
if((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover)))
if(IS_PLAYER(head))
continue;
-
- //if(head.netaddress)
- //if(head.netaddress != "")
- //if(head.netaddress != "null/botclient")
- if(IS_REAL_CLIENT(head))
- sprint(head, msgstr);
+
+ sprint(head, msgstr);
}
}
}
}
-void GameCommand_ircmsg(float request, float argc)
+void GameCommand_ircmsg(float request, float argc, string command)
{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
- IRCSay(argv(1), argv(2));
+ IRCSay(substring(command, strlen(argv(0))+1, strlen(command)));
return;
}
SERVER_COMMAND("gettaginfo", GameCommand_gettaginfo(request, arguments), "Get specific information about a weapon model") \
SERVER_COMMAND("gotomap", GameCommand_gotomap(request, arguments), "Simple command to switch to another map") \
SERVER_COMMAND("gravity", GameCommand_gravity(request, arguments), "Changes gravity based on cvars") \
- SERVER_COMMAND("ircmsg", GameCommand_ircmsg(request, arguments), "Say a message as an IRC user") \
+ SERVER_COMMAND("ircmsg", GameCommand_ircmsg(request, arguments, command), "Say a message as an IRC user") \
SERVER_COMMAND("lockteams", GameCommand_lockteams(request), "Disable the ability for players to switch or enter teams") \
SERVER_COMMAND("make_mapinfo", GameCommand_make_mapinfo(request), "Automatically rebuild mapinfo files") \
SERVER_COMMAND("moveplayer", GameCommand_moveplayer(request, arguments), "Change the team/status of a player") \