SA-MP Forums Archive
Problem with Log - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with Log (/showthread.php?tid=422663)



Problem with Log - Zumba - 14.03.2013

Hi, i create log in this command but it have problem, when i use command and open log i says me:
Код:
AdmCmd: Э e isklucen odstrana na Э, pricina: Э
But in command i add to display time name of admin and kicker and reason but dont write that.
Here is command:
Код:
CMD:kick(playerid,params[])
{
    new id,name1[MAX_PLAYER_NAME], reason[35],name2[MAX_PLAYER_NAME], string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_GREY,"Nemozete da ja koristite komandata");
    if(sscanf(params,"uz",id,reason)) return SCM(playerid, COLOR_WHITE,"Koristi: /kick [playerid] [pricina]");
    if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Pogresen ID");
    else
    {
	    GetPlayerName(playerid,name1,sizeof(name1));
	    GetPlayerName(id,name2,sizeof(name2));
	    new year,month,day;
        getdate(year, month, day);
	    format(string, sizeof(string),"AdmCmd: %s e isklucen odstrana na %s, pricina: %s",day,month,year,name2,name1,reason);
	    acmdLog(string);
	    GetPlayerName(playerid,name1,sizeof(name1));
	    GetPlayerName(id,name2,sizeof(name2));
	    format(string, sizeof(string),"AdmCmd: %s e isklucen odstrana na %s, pricina: %s",name2,name1,reason);
	    SendClientMessageToAll(COLOR_LIGHTRED,string);
	    Kick(id);
    }
    return 1;
}
What is problem how to fix this ??


Re: Problem with Log - Zumba - 14.03.2013

Please help


Re: Problem with Log - Zumba - 14.03.2013

I fix the problem with this
But how to make to save in next row in log file ?? Because everything save in one row ??


Re: Problem with Log - Tika Spic - 14.03.2013

Код:
format(string, sizeof(string),"[%02d/%02d/%d] AdmCmd: %s e isklucen odstrana na %s, pricina: %s",day,month,year,name2,name1,reason);
acmdLog(string);
try like this


Re: Problem with Log - Zumba - 14.03.2013

Dont work give me like this:
Код:
[15.3.2013]AdmCmd: Kevin_Hawk e isklucen odstrana na Kevin_Hawk, pricina: test[15/03/2013] AdmCmd: Kevin_Hawk e isklucen odstrana na Kevin_Hawk, pricina: 9
I want to make to save in different row


Re: Problem with Log - Tika Spic - 14.03.2013

Код:
format(string, sizeof(string),"[%02d/%02d/%d] AdmCmd: %s e isklucen odstrana na %s, pricina: %s\n",day,month,year,name2,name1,reason);
acmdLog(string);