[Ajuda] WriteLog
#6

Usa esse cуdigo ou remove todas as linhas que estгo dando erro.

PHP код:
stock WriteLog(file[], input[]) 

    new 
fileText[126]; 
    
format(fileText126"%s.txt"file); 
    new 
File:handle fopen(fileTextio_append); 
    if(
handle
    { 
        new 
HMS
            
inputText[126]; 
        
gettime(HMS); 
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput); 
        
fwrite(handleinputText); 
        
fclose(handle); 
    } 
    else 
    { 
        new 
printText[126]; 
        
format(printText126"Could not append to file %s"file); 
        print(
"Error at stock WriteLog(file[], input[])"); 
        print(
printText); 
    } 

stock WritePlayerLog(playeridinput[]) 

    new 
fileText[126], 
        
name[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnamesizeof(name)); 
    
format(fileText126"log/%s.txt"name); 
    new 
File:handle fopen(fileTextio_append); 
    if(
handle
    { 
        new 
HMS
            
inputText[126]; 
        
gettime(HMS); 
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput); 
        
fwrite(handleinputText); 
        
fclose(handle); 
    } 
    else 
    { 
        new 
printText[126]; 
        
format(printText126"Could not append to file %s"name); 
        print(
"Error at stock WritePlayerLog(file[], input[])"); 
        print(
printText); 
    } 

Reply


Messages In This Thread
WriteLog - by BrGabrielBr - 15.07.2018, 00:27
Re: WriteLog - by Marllun - 15.07.2018, 00:37
Re: WriteLog - by BrGabrielBr - 15.07.2018, 00:44
Re: WriteLog - by Marllun - 15.07.2018, 00:48
Re: WriteLog - by BrGabrielBr - 15.07.2018, 01:04
Re: WriteLog - by Marllun - 15.07.2018, 01:08
Re: WriteLog - by ipsLuan - 15.07.2018, 01:18

Forum Jump:


Users browsing this thread: 1 Guest(s)