2018-10-25 09:14:39 -04:00
|
|
|
#include common_scripts\utility;
|
2018-04-28 01:22:18 -04:00
|
|
|
#include maps\mp\_utility;
|
|
|
|
#include maps\mp\gametypes\_hud_util;
|
2018-10-25 09:14:39 -04:00
|
|
|
#include maps\mp\gametypes\_playerlogic;
|
2018-04-28 01:22:18 -04:00
|
|
|
|
|
|
|
init()
|
|
|
|
{
|
2020-01-21 19:08:18 -05:00
|
|
|
SetDvarIfUninitialized( "sv_iw4madmin_command", "" );
|
2019-08-12 20:04:25 -04:00
|
|
|
level thread WaitForCommand();
|
2018-04-28 01:22:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
WaitForCommand()
|
|
|
|
{
|
2020-01-21 19:08:18 -05:00
|
|
|
level endon( "game_ended" );
|
|
|
|
|
2018-04-28 01:22:18 -04:00
|
|
|
for(;;)
|
|
|
|
{
|
2020-01-21 19:08:18 -05:00
|
|
|
commandInfo = strtok( getDvar("sv_iw4madmin_command"), ";" );
|
2018-09-02 22:25:09 -04:00
|
|
|
command = commandInfo[0];
|
2020-01-21 19:08:18 -05:00
|
|
|
|
|
|
|
switch( command )
|
2018-04-28 01:22:18 -04:00
|
|
|
{
|
2018-09-02 22:25:09 -04:00
|
|
|
case "alert":
|
2020-01-21 19:08:18 -05:00
|
|
|
//clientId alertType sound message
|
|
|
|
SendAlert( commandInfo[1], commandInfo[2], commandInfo[3], commandInfo[4] );
|
|
|
|
break;
|
|
|
|
case "killplayer":
|
|
|
|
// clientId
|
|
|
|
KillPlayer( commandInfo[1], commandInfo[2] );
|
2018-09-02 22:25:09 -04:00
|
|
|
break;
|
2018-04-28 01:22:18 -04:00
|
|
|
}
|
|
|
|
|
2020-01-21 19:08:18 -05:00
|
|
|
setDvar( "sv_iw4madmin_command", "" );
|
|
|
|
wait( 1 );
|
2018-04-28 01:22:18 -04:00
|
|
|
}
|
2018-05-28 21:30:31 -04:00
|
|
|
}
|
|
|
|
|
2020-01-21 19:08:18 -05:00
|
|
|
SendAlert( clientId, alertType, sound, message )
|
2018-09-02 22:25:09 -04:00
|
|
|
{
|
2020-01-21 19:08:18 -05:00
|
|
|
client = getPlayerFromClientNum( int( clientId ) );
|
|
|
|
client thread playLeaderDialogOnPlayer( sound, client.team );
|
|
|
|
client playLocalSound( sound );
|
|
|
|
client iPrintLnBold( "^1" + alertType + ": ^3" + message );
|
2018-09-02 22:25:09 -04:00
|
|
|
}
|
|
|
|
|
2020-01-21 19:08:18 -05:00
|
|
|
KillPlayer( targetId, originId)
|
2018-10-25 09:14:39 -04:00
|
|
|
{
|
2020-01-21 19:08:18 -05:00
|
|
|
target = getPlayerFromClientNum( int( targetId ) );
|
|
|
|
target suicide();
|
|
|
|
origin = getPlayerFromClientNum( int( originId ) );
|
2018-10-25 09:14:39 -04:00
|
|
|
|
2020-01-21 19:08:18 -05:00
|
|
|
iPrintLnBold("^1" + origin.name + " ^7killed ^5" + target.name);
|
2018-04-28 01:22:18 -04:00
|
|
|
}
|