[Help]: /reports command
#2

Try this bro

Код:
CMD:report(playerid,params[]) {
    new reported, tmp[128], tmp2[128], Index;		tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /report [playerid] [reason]");
	reported = strval(tmp);

 	if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) {
		if(PlayerInfo[reported][Level] == ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot report this administrator");
		if(playerid == reported) return SendClientMessage(playerid,red,"ERROR: You Cannot report yourself");
		if(strlen(params) > 7) {
			new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str[128], hour,minute,second; gettime(hour,minute,second);
			GetPlayerName(reported, reportedname, sizeof(reportedname));	GetPlayerName(playerid, reporter, sizeof(reporter));
			format(str, sizeof(str), "||NewReport||  %s(%d) reported %s(%d) Reason: %s |@%d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second);
			MessageToAdmins(COLOR_WHITE,str);
			SaveToFile("ReportLog",str);
			format(str, sizeof(str), "Report(%d:%d:%d): %s(%d) reported %s(%d) Reason: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]);
			for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1];
			Reports[MAX_REPORTS-1] = str;
			return SendClientMessage(playerid,yellow, "Your report has been sent to online administrators.");
		} else return SendClientMessage(playerid,red,"ERROR: Must be a valid reason");
	} else return SendClientMessage(playerid, red, "Player is not connected");
}
Reply


Messages In This Thread
[Help]: /reports command - by Areax - 21.06.2013, 14:07
Re: [Help]: /reports command - by ScripteRNaBEEL - 21.06.2013, 14:39
Re: [Help]: /reports command - by Areax - 21.06.2013, 14:41
Re: [Help]: /reports command - by ScripteRNaBEEL - 21.06.2013, 14:46
Re: [Help]: /reports command - by Areax - 21.06.2013, 14:48
Re: [Help]: /reports command - by Goldilox - 21.06.2013, 16:43
Re: [Help]: /reports command - by Kindred - 21.06.2013, 17:52
Re: [Help]: /reports command - by Areax - 22.06.2013, 11:43

Forum Jump:


Users browsing this thread: 1 Guest(s)