Save File
#1

Hello, I have an anti weapon hack, so when someone hacks itґll send the message to an admin, But what I need is to save the file somewhere on scriptfiles, Like WeaponHacks.

[ Alex_Obando minigun hack 25/7/11 ]
Reply
#2

PHP код:
stock Save(str[])
{
    new 
File:log fopen("Log.txt"io_append);
    
format(str256"%s\r\n"str);
    
fwrite(logstr);
    
fclose(log);
    return 
1;

Usage mode:

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
str[128], ymd;
    
getdate(ymd);
    
GetPlayerName(playeridstrsizeof str);
    
format(strsizeof str"%s - %s - Date: %02d/%02d/%04d"strreasondmy);
    
Save(str);
    return 
1;

This will be written like this in the file Log.txt (if player name is Alex_Obando and reason was 1):

Код:
Alex_Obando - 1 - 25/07/2011
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)