Skip to content

Commit

Permalink
added logic check for manually moving a player
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Dec 10, 2023
1 parent 5e4b7f9 commit e7f10fa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions berobot_handler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -439,20 +439,21 @@ public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadca
int client = GetClientOfUserId(GetEventInt(event, "userid"));

// RequestFrame(RobotTeamCheck, client);

if (!g_AprilEnable) RequestFrame(RobotTeamCheck, client);//dont check robo teams if april fools mode is on

if (IsAnyRobot(client)){

//PrintToChatAll("%N spawned, checking if boss", client);

if (!g_AprilEnable) RequestFrame(RobotTeamCheck, client);//dont check robo teams if april fools mode is on
// if (!g_AprilEnable) RequestFrame(RobotTeamCheck, client);//dont check robo teams if april fools mode is on


// else
// {
// MC_PrintToChatEx(client, client, "{teamcolor}You're a robot on the robot team!");
// }
MC_PrintToChatEx(client, client, "{teamcolor}Type {orange}!bot{teamcolor} or {orange}change class{teamcolor} in spawn to change robot!");
MC_PrintToChatEx(client, client, "{teamcolor}Type {orange}!mt{teamcolor} get a mount to move around faster");
MC_PrintToChatEx(client, client, "{teamcolor}Type {orange}!car{teamcolor} get a car to move faster!");
if(g_cv_bDebugMode)PrintToChatAll("%N spawned, with %i health from previous life", client, g_PlayerHealth[client]);
//FakeClientCommand(client, "tf_respawn_on_loadoutchanges 0");
if (g_PlayerHealth[client] > 0){
Expand Down Expand Up @@ -965,6 +966,7 @@ public any Native_GetRobotTeam(Handle plugin, int numParams)

void RobotTeamCheck(int client)
{
PrintToChatAll("Robot Check");
if(IsClientInGame(client))
{
int iTeam = GetClientTeam(client);
Expand All @@ -975,6 +977,11 @@ void RobotTeamCheck(int client)
TrashRobot(client);
CreateTimer(0.5, Timer_Regen, client);
}
//Makes players who are manually moved to the robot team a robot
if (iTeam == g_RoboTeam && !IsAnyRobot(client))
{
Internal_SetRandomRobot(client);
}
}
}

Expand Down

0 comments on commit e7f10fa

Please sign in to comment.