1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-07-09 21:39:56 -05:00

add warn event

add alert to IW4ScriptCommands
This commit is contained in:
RaidMax
2018-09-02 21:25:09 -05:00
parent bc0fe3daec
commit 9b6249a128
6 changed files with 239 additions and 184 deletions

View File

@ -11,23 +11,35 @@ WaitForCommand()
{
for(;;)
{
command = getDvar("sv_iw4madmin_command");
commandArgs = strtok(getDvar("sv_iw4madmin_commandargs"), ",");
commandInfo = strtok(getDvar("sv_iw4madmin_command"), ";");
command = commandInfo[0];
commandArgs = strtok(commandInfo[1], ",");
switch(command)
{
case "balance":
BalanceTeams(commandArgs);
break;
case "alert":
//clientId alertType sound message
SendAlert(commandArgs[0], commandArgs[1], commandArgs[2], commandArgs[3]);
break;
}
setDvar("sv_iw4madmin_command", "");
setDvar("sv_iw4madmin_commandargs", "");
wait(1);
}
}
SendAlert(clientId, alertType, sound, message)
{
client = level.players[int(clientId)];
client thread playLeaderDialogOnPlayer(sound, client.team);
client playLocalSound(sound);
client iPrintLnBold("^1" + alertType + ": ^3" + message);
}
BalanceTeams(commandArgs)
{
if (isRoundBased())