[Ajuda] Ajuda com log
#1

Alguйm poderia me ajuda com esse erro no meu log? Simplesmente nгo aparece o nome de quem deu o kick
PHP код:
CMD:kick(playeridparams[])
{
    if(
pDados[playerid][Staff] >= 2)
    {
        if(
pDados[playerid][StaffTrabalhando] == 1)
        {
            new 
IDMotivo[128];
            if(
sscanf(params"is"IDMotivo)) return SendClientMessage(playerid, -1"Use: /kick [id] [motivo]");
            new 
Nome[MAX_PLAYER_NAME], string[64 MAX_PLAYER_NAME];
            
GetPlayerName(IDNomesizeof(Nome));
            
Kick(ID);
            
format(stringsizeof(string), "%s Foi kickado por %s, motivo:%s"NomeplayeridMotivo);
            
SendClientMessageToAll(-1string);
            
fileLog("Kicks"string);
        } else { 
SendClientMessage(playerid, -1"Vocк precisa estб no modo trabalho!"); }
    } else { 
SendClientMessage(playerid, -1"Vocк nгo tem permissгo para usar esse comando!"); }
    return 
1;

PHP код:
stock fileLog(file[], string[])
{
    new 
time[6];
    
gettime(time[0], time[1], time[2]);
    
getdate(time[3], time[4], time[5]);
    new 
timestr[32], data[128];
    
format(timestr,32,"[%02d.%02d|%02d:%02d] ",time[5],time[4], time[0], time[1]);
    
format(datasizeof(data), "%s%s\r\n",timestr,string);
    new 
File:hFilethefile[32];
    
format(thefilesizeof(thefile), "/Logs/%s.log"file);
    
hFile fopen(thefileio_append);
    
fwrite(hFiledata);
    
fclose(hFile);
    return 
1;

Код:
[04.12|03:54] Yuri_Nogueira Foi kickado por , motivo:Text
Reply
#2

Код:
format(string, sizeof(string), "%s Foi kickado por %s, motivo:%s", Nome, playerid, Motivo);
Playerid vai pegar o id do player se vocк quiser colocar o id tire o %s e colocar %d mas vocк que o nome nй? entгo coloque isso.

Код:
new Nome2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome2, sizeof(Nome2));
format(string, sizeof(string), "%s Foi kickado por %s, motivo:%s", Nome, Nome2, Motivo);
Reply
#3

Aconselho a usar a includ Losgs.
Reply
#4

Quote:
Originally Posted by Marllun
Посмотреть сообщение
Код:
format(string, sizeof(string), "%s Foi kickado por %s, motivo:%s", Nome, playerid, Motivo);
Playerid vai pegar o id do player se vocк quiser colocar o id tire o %s e colocar %d mas vocк que o nome nй? entгo coloque isso.

Код:
new Nome2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome2, sizeof(Nome2));
format(string, sizeof(string), "%s Foi kickado por %s, motivo:%s", Nome, Nome2, Motivo);
Valeu!

Quote:
Originally Posted by SmokiieGamer
Посмотреть сообщение
Aconselho a usar a includ Losgs.
Й que eu quero criar um gm quase do zero, entгo sу vou usar sscanf zcmd e dof2 o resto quero eu fazer saca, claro que eu nгo estou fazendo, estou mesmo й pedindo ajuda kkkk.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)