ishost builtin

This commit is contained in:
ineed bots 2023-12-03 18:21:54 -06:00
parent 9114d20f73
commit a92a5798d6
2 changed files with 20 additions and 1 deletions

View File

@ -222,6 +222,19 @@ BotBuiltinNotifyOnPlayerCommand( cmd, notif )
}
}
/*
waw doesnt have
*/
BotBuiltinIsHost()
{
if ( isDefined( level.bot_builtins ) && isDefined( level.bot_builtins["ishost"] ) )
{
return self [[ level.bot_builtins["ishost" ]]]();
}
return false;
}
/*
Returns if player is the host
*/
@ -268,7 +281,7 @@ doHostCheck()
}
}
if ( !result )
if ( !self BotBuiltinIsHost() && !result )
return;
self.pers["bot_host"] = true;

View File

@ -17,6 +17,7 @@ init()
level.bot_builtins["addtestclient"] = ::do_addtestclient;
level.bot_builtins["notifyonplayercommand"] = ::do_notifyonplayercommand;
level.bot_builtins["cmdexec"] = ::do_cmdexec;
level.bot_builtins["ishost"] = ::do_ishost;
}
do_printconsole( s )
@ -103,3 +104,8 @@ do_cmdexec( a )
{
cmdexec( a );
}
do_ishost()
{
self isHost();
}