Код:
new File:acmds; // Add this at the top of your script under includes so you don't have to put it everytime in every command.
Код:
CMD:get(playerid, params[])
{
new pID, log[128], year, month, day, hour, minute, second, Float:X, Float:Y, Float:Z;
getdate(year, month, day);
gettime(hour, minute, second);
if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pAdmin] > 4) return SendClientMessage(playerid, grey, "Error: You are not authorized to use this command.");
if(sscanf(params,"i", pID)) return SendClientMessage(playerid, grey,"[Usage] /get [id]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, grey,"Error: Player not found!");
GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
SetPlayerPos(pID, Float:X + 3.0 ,Float:Y,Float:Z);
format(log, sizeof(log),"[%02d/%02d/%04d %02d:%02d:%02d] [Admin] %s has used /get on %s.\r\n",day, month, year, hour, minute, second, GetName(playerid), GetName(pID));
acmds = fopen("acmds.log", io_append);
fwrite(acmds, log);
fclose(acmds);
return 1;
}