08.07.2011, 12:57
Quote:
What is it with people recently assuming that people use MySQL - I've seen it in an increasing number of topics. The OP asks a perfectly normal question and doesn't mention MySQL at any point; at no point do they say they have it installed, have it set up or have any interest in using it at all; yet answers start using it.
MySQL, like ALL plugins, is non-standard. If you are going to use it at least mention that "this will require you to install a massive great library designed for huge websites on to your tiny little SA:MP server which already has perfectly good database functionality built in, just for one line of code" (or words to that effect). You cannot assume that people have any plugins installed, even common ones like sscanf should be explicitly stated. |
Quote:
Yes,
pawn Код:
|
Anyway, this should work :
pawn Код:
// Zcmd
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
CommandLog(playerid, cmdtext);
return 1;
}
// Strcmp
public OnPlayerCommandText(playerid, cmdtext[])
{
CommandLog(playerid, cmdtext);
return 1;
}
stock CommandLog(playerid, text[])
{
new
File:lFile = fopen("Logs/CommandLog.txt", io_append),
logData[178],
fyear, fmonth, fday,
fhour, fminute, fsecond;
getdate(fyear, fmonth, fday);
gettime(fhour, fminute, fsecond);
format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s: %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, GetName(playerid), text);
fwrite(lFile, logData);
fclose(lFile);
return 1;
}
stock GetName(playerid)
{
new pName[25];
GetPlayerName(playerid, pName, sizeof(pName));
return pName;
}