View Single Post
Author Message
bklol
Junior Member
Join Date: May 2019
Location: Cola
Old 10-12-2020 , 11:29   [CSGO] Why MY Repeat Timer Stop PrintMessage
Reply With Quote #1

PHP Code:
#include <sourcemod>

int n 0;
int Lines;

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_test"Command_t);
}

public 
Action Command_t(int client,int args)
{
    
CreateTimer(0.1TIMER,client,TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action TIMER(Handle timerany client)
{
    
char lineBuffer[1024];
    
Handle fileHandle OpenFile("addons/sourcemod/configs/badapple.text","r");
    
Lines 1;
    while(!
IsEndOfFile(fileHandle) && ReadFileLine(fileHandlelineBuffersizeof(lineBuffer)))
    {
        for(
int line 1;line <59line++)
        {
            if(
Lines == line n*60)
                
PrintToConsole(client,"%s",lineBuffer);
        }
        
Lines++;
    }
    
n++;

And Here is text file :https://github.com/bklol/badapple-in...r/badapple.txt
Can anyone tell me why timer stop work,thanks a lot!

Last edited by bklol; 10-12-2020 at 11:30.
bklol is offline