SA-MP Forums Archive
[Ajuda] Reporter - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Reporter (/showthread.php?tid=339157)



[Ajuda] Reportar - SynVengeance - 02.05.2012

meu comando reporter nao ta pegando alguem ajuda ?

Код HTML:
if (strcmp(cmd, "/report", true) == 0 || strcmp(cmd, "/reportar", true) == 0)
{
	new sendername[MAX_PLAYER_NAME];
	new tmp[256];
	tmp = strtok(cmdtext, idx);
	GetPlayerName(playerid, sendername, sizeof(sendername));
	if (!strlen(tmp))
	{
		SendClientMessage(playerid, 0x00A100AA, "Use: /report [ID] [Motivo]");
		return 1;
	}
	if (IsPlayerConnected(playerid))
	{
		new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		new result[64];
		while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
		{
			result[idx - offset] = cmdtext[idx];
			idx++;
		}
		result[idx - offset] = EOS;
		if (!strlen(result))
		{
			SendClientMessage(playerid, 0xF60000AA, "/report [ID] [Motivo]");
			return 1;
		}
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "REPORT DE : %s (id %d) Reportou %s (id %d). [Motivo: %s]", playerid, sendername, playerid, result);
		for (new i = 0; i < MAX_PLAYERS; i++)
		{
			if (IsPlayerAdmin(i))
			{
				SendClientMessage(i, 0xF60000AA, string);
			}
		}
	}
	else
	{
		format(string, sizeof(string), "%d Estб OffLine!", playerid);
		SendClientMessage(playerid, 0xB3B6BCAA, string);
	}
	return 1;
}