Originally Posted by _Zume
pawn Код:
ReturnDate() { static date[36];
getdate(date[2], date[1], date[0]); gettime(date[3], date[4], date[5]);
format(date, sizeof(date), "%02d/%02d/%d, %02d:%02d", date[0], date[1], date[2], date[3], date[4]); return date; }
stock Log_Write(const path[], const str[], {Float,_}:...) { static args, start, end, File:file, string[1024] ; if ((start = strfind(path, "/")) != -1) { strmid(string, path, 0, start + 1);
if (!fexist(string)) return printf("** Advertencia: El directorio \"%s\" no existe.", string); } #emit LOAD.S.pri 8 #emit STOR.pri args
file = fopen(path, io_append);
if (!file) return 0;
if (args > 8) { #emit ADDR.pri str #emit STOR.pri start
for (end = start + (args - 8); end > start; end -= 4) { #emit LREF.pri end #emit PUSH.pri } #emit PUSH.S str #emit PUSH.C 1024 #emit PUSH.C string #emit PUSH.C args #emit SYSREQ.C format
fwrite(file, string); fwrite(file, "\r\n"); fclose(file);
#emit LCTRL 5 #emit SCTRL 4 #emit RETN } fwrite(file, str); fwrite(file, "\r\n"); fclose(file);
return 1; }
pawn Код:
CMD:kick(playerid, params[]) { if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Vocк nгo tem permissгo para usar esse comando!"); new id; new motivo[64]; new string[80]; if(sscanf(params,"us", id, motivo)) return SendClientMessage(playerid, -1, "Use: /kick [id] [motivo]");
format(string, sizeof(string), "AdmCmd: %s foi Kickado por %s. Razгo: %s.", PlayerName(id), PlayerName(playerid), (motivo) ); SendClientMessageToAll(COLOR_LIGHTRED, string); Log_Write("kicks.txt", "[%s] %s foi Kickado por %s. Razгo: %s", ReturnDate(), PlayerName(id), PlayerName(playerid), (motivo)) Kick(id); return 1; }
|