/report
#1

Hey im new to scripting And i want to make a /report cmd but how do i make it so when players use /report it only sends it to online admins
Reply
#2

Use a for loop.

Loop through all the admins currently on and send the report to all that are on.

Example:

Код:
COMMAND:report(playerid, params[]) {
	new string[128], id, reason[128];
	if (!sscanf(params, "is", id, reason)) {
		for (new i = 0; i < MAX_PLAYERS; i++) {
	    	if (GetPVarInt(i, "Admin") >= 1) {
	        	format(string, sizeof(string), "REPORT: Player %s(%d) Has Reported %s(%d), [Reason: %s ]", Name(playerid),playerid, Name(id),id, reason);
	        	SendClientMessage(i, COLOR_WHITE, string);
	    	}
		}
		SendClientMessage(playerid, COLOR_WHITE, "Your report has been sent successfully :)");
	}
	return 1;
}
//Not tested. Example
Hope this helps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)