Raised This Month: $ Target: $400
 0% 

Solved PrintToServer bug?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode