This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
i wanted to add a remote bot feature to my bots which will allow clients to control
the bots if they enter the correct password.
but once one password as been entered in then any user can use this feature which is
not secure.
would something like this work?
if (FStrEq(pcmd, "bot_password"))
{
if(!strcmp(arg1, get_bot_password()) == 0)//(arg1!=get_bot_password())
{
ClientPrint(pEntity, HUD_PRINTCONSOLE, "Incorrect bot password.\n");
return;
}
else
{
for (i=0; i < 32; i++)
{
if ((the_player_admin_s[i].is_used == FALSE) && (the_player_admin_s[i].pEdict !=
pEntity))
{
the_player_admin_s[i].is_used = TRUE; // this slot is now free to use
the_player_admin_s[i].was_admin=TRUE;
the_player_admin_s[i].pEdict = pEntity;
return;
}
break;
}
ClientPrint(pEntity, HUD_PRINTCONSOLE, "Bot password accepted.\n");
return;
}
return;
}
for (i=0; i < 32; i++)
{
if ((the_player_admin_s[i].is_used == TRUE) && (the_player_admin_s[i].pEdict ==
pEntity) && (the_player_admin_s[i].was_admin==TRUE))
{
if (FStrEq(pcmd, "net_beep"))
{
BotCreate( NULL, arg1, arg2, arg3, arg4 );
return;
}
}
break;
}
---------------------------------------------------------------------------------------------------------------------------------------------
// SmiLeY
for (i=0; i < 32; i++)
{
if ((the_player_admin_s[i].is_used == TRUE) && (the_player_admin_s[i].pEdict
==pEntity))
{
// someone kicked this bot off of the server...
the_player_admin_s[i].pEdict = NULL;
the_player_admin_s[i].is_used = FALSE; // this slot is now free to use
the_player_admin_s[i].was_admin=FALSE;
break;
}
}
//SmiLeY
what i want it to do is to assign each player with the remote feature once they have
type in the password.
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders