24.05.2016, 04:18
Hi friends, when a user places / report, the command works, but when put / report id reason, says ERROR: Unknown Command.
Command code:
Command code:
PHP код:
CMD:reportar(playerid, params[])
{
new target, reason[98];
if(sscanf(params, "us[98]", target, reason)) return SendClientMessage(playerid, X11_THISTLE_1, "USA: /reportar [jugador] [razon]");
if(strlen(reason) < 1) return SendClientMessage(playerid, X11_FIREBRICK, "ERROR: La longitud del reporte debe ser mayor a 1.");
if(! IsPlayerConnected(target)) return SendClientMessage(playerid, X11_FIREBRICK, "ERROR: El jugador especifico no esta conectado.");
if(target == playerid) return SendClientMessage(playerid, X11_FIREBRICK, "ERROR: No puedes reportarte ati mismo.");
new hour, minute, second;
gettime(hour, minute, second);
for(new i = (sizeof(gReportLog) - 1); i > -1; i++) gReportLog[i+1] = gReportLog[i];
new string[145];
format(string, sizeof(string), "%02d:%02d | El jugador %s[%i] fue reportado por %s[%i] | Razon: %s", hour, minute, ReturnPlayerName(playerid), playerid, ReturnPlayerName(target), target, reason);
gReportLog[0] = string;
SendClientMessageForAdmins(X11_YELLOW_2, string);
foreach(new i : Player)
{
if(gUser[i][u_admin] > 0)
{
PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
#if defined REPORT_TEXTDRAW
TextDrawSetStringf(gReportTD, "~b~~h~~h~~h~~h~%s(%i) ~b~~h~~h~~h~fue reportado por ~b~~h~~h~~h~~h~%s(%i) ~b~~h~~h~~h~Razon: ~b~~h~~h~~h~~h~%s", ReturnPlayerName(playerid), playerid, ReturnPlayerName(target), target, reason);
TextDrawShowForPlayer(i, gReportTD);
SetTimerEx("HideTD", 10 * 1000, false, "i", i);
#endif
}
}
SendClientMessagef(playerid, X11_YELLOW_1, "Tu reporte hacia %s[%i] fue enviado a los administradores.", ReturnPlayerName(target), target);
return 1;
}
#if defined REPORT_TEXTDRAW
forward HideTD(playerid);
public HideTD(playerid) return TextDrawHideForPlayer(playerid, gReportTD);
#endif