PHP Code:
new g_oldbotname[32]
static botname[32]
formatex( botname, 31, "BOT")
// Skip Real Players
new id = find_player("ia", botname)
if( !equali(botname, g_oldbotname) )
{
if( is_user_connected(g_oldbotidct) && is_user_bot(g_oldbotidct) )
{
set_user_info(g_oldbotidct, "name", botname)
return;
}
}
g_oldbotidct = id = engfunc(EngFunc_CreateFakeClient, botname)
g_oldbotname = botname
if( pev_valid( id ) )
{
engfunc( EngFunc_FreeEntPrivateData, id)
dllfunc( MetaFunc_CallGameEntity, "player", id)
set_user_info( id, "rate", "3500" )
set_user_info( id, "cl_updaterate", "25" )
set_user_info( id, "cl_lw", "1" )
set_user_info( id, "cl_lc", "1" )
set_user_info( id, "cl_dlmax", "128" )
set_user_info( id, "cl_righthand", "1" )
set_user_info( id, "_vgui_menus", "0" )
set_user_info( id, "_ah", "0" )
set_user_info( id, "dm", "0" )
set_user_info( id, "tracker", "0" )
set_user_info( id, "friends", "0" )
set_user_info( id, "*bot", "1" )
set_pev( id, pev_flags, pev( id, pev_flags ) | FL_FAKECLIENT )
set_pev( id, pev_colormap, id )
new msg[128]
dllfunc( DLLFunc_ClientConnect, id, botname, "127.0.0.1", msg )
dllfunc( DLLFunc_ClientPutInServer, id )
engfunc( EngFunc_RunPlayerMove, id, Float:{0.0,0.0,0.0}, 0.0, 0.0, 0.0, 0, 0, 76 )
set_pev(id, pev_takedamage, DAMAGE_NO)
dllfunc(DLLFunc_Spawn, id)