Thread: [Solved] PrintToServer bug?
View Single Post
Author Message
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 02-02-2023 , 16:55   PrintToServer bug?
Reply With Quote #1

Can someone tell me why some of the PrintToServer commands aren't working?

No errors on console, no errors in logs.

Game: TF2
Sourcemod version: 1.11.0.6927

PHP Code:
#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo 
{
    
name "[TF2] Test PrintToServer at Round Start",
    
author "PC Gamer",
    
description "Prints to Server after round start",
    
version "PLUGIN_VERSION 1.0",
}

public 
void OnPluginStart()

    
HookEvent("teamplay_round_start"OnRoundStart);
}

public 
void OnRoundStart(Event hEvent, const char[] strNamebool bDontBroadcast)

    
PrintToServer("Round Test: Starting Round"); //This line prints
    
PrintToChatAll("Round Test: Starting Round"); //This line prints
    
    
int realplayers 6;
    
PrintToServer("Round Test: There are %i Human Players"realplayers); //This line does not print
    
PrintToChatAll("Round Test: There are %i Human Players"realplayers);    //This line prints
    
    
int hcount 0;
    for (
int i 1i<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i))
        {
            
hcount++;
        }
    }
    
    
PrintToServer("Round Test: Just kidding. There are really only %i Human Players"hcount); //This line does not print
    
PrintToChatAll("Round Test: Just kidding. There are really only %i Human Players"hcount); //This line prints
    
PrintToServer("Round Test: Done testing PrintToServer commands"); //This line prints
    
PrintToChatAll("Round Test: Done testing PrintToServer commands");//This line prints


Last edited by PC Gamer; 02-03-2023 at 15:51.
PC Gamer is offline