SA-MP Forums Archive
About my report command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: About my report command (/showthread.php?tid=648616)



About my report command - ivndosos - 25.01.2018

I've made a report command, I'm not sure if it will work or not, Didn't try it out yet because I've one error, Along the way tell me if that command will work properly as it should.

Код:
CMD:report(playerid, params[])
{
   new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], target, str[128], reason[128];
   if(sscanf(params, "dz", target, reason)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /report [id] [reason]");
   if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) The player you are trying to report is offline!");
   if(playerid == target) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You can't report yourself.");
   GetPlayerName(playerid, name, sizeof(name));
   GetPlayerName(target, name2, sizeof(name2));
   for (new i = 0; i < MAX_PLAYERS; i++)
   {
	   if(IsPlayerConnected(i))
	   {
		new aname[MAX_PLAYER_NAME], afile[256];
		GetPlayerName(playerid, aname, sizeof(aname));
		format(afile, sizeof(afile), "Users%\%s.ini", aname);
		new INI:file = INI_Open(Path(i));
		if(IsPlayerAdmin(i) || INI_WriteInt(file, "Admin") >= 1)
		{
			 format(str, sizeof(str), "{EFB509}(INFO) {FF0000}%s(%d) {FFFFFF}has reported {ff0000}%s(%d) {ffffff}|| reason: {ff0000}%s", name, playerid, name2, target, reason);
			 SendClientMessage(i, -1, str);
			 INI_Close(file);
			 
		}
	 }
   }
   return 1;
}
Error:
Код:
C:\Users\yan\Desktop\SA-MP Server\gamemodes\DBv1.pwn(656) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.