if (strcmp("/report", command, true, 7) == 0) { if(IsPlayerConnected(playerid)) { new string[256], sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); 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, 0xFFFFFFAA, "USAGE: /report <playerid> <reason>"); return 1; } format(string, sizeof(string), "Report from %s(%d): %s", sendername, playerid, result); SendAdminMessage( 0xFF4646FF, string); format(string, sizeof(string), "6Report from %s(%d): %s", sendername, playerid, result); ircSay(EchoConnection, AdminChan, string); format(string, sizeof(string), "[Report] %s(%d) %s", sendername, playerid, result); add_log(string); SendClientMessage(playerid, 0xFF9900AA, "Report sent to currently online admins."); } return 1; }
C:\Users\Admin\Desktop\New Folder (4)\f\ech.pwn(1219) : warning 215: expression has no effect C:\Users\~\Desktop\New Folder (4)\f\ech.pwn(1221) : warning 217: loose indentation C:\Users\~\Desktop\New Folder (4)\f\ech.pwn(1221) : error 029: invalid expression, assumed zero C:\Users\~\Desktop\New Folder (4)\f\ech.pwn(1221) : warning 215: expression has no effect C:\Users\~\Desktop\New Folder (4)\f\ech.pwn(1221) : error 001: expected token: ";", but found ")" C:\Users\~\Desktop\New Folder (4)\f\ech.pwn(1221) : error 029: invalid expression, assumed zero C:\Users\~\Desktop\New Folder (4)\f\ech.pwn(1221) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if(strcmp(cmd, "/report", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ORANGE, "USAGE: /report [playername/id] [reason]");
SendClientMessage(playerid, ORANGE, "FUNCTION: Will report the specified player to the administrators(online).");
return 1;
}
new targetid = ReturnUser(tmp);
if(targetid != INVALID_PLAYER_ID)
{
GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
GetPlayerName(playerid, sendername, sizeof(sendername));
new reason[128];
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /report [playerid] [reason]");
format(string, sizeof(string), "|- %s reported %s [ Reason: %s ]", sendername,giveplayername,reason);
SendClientMessageToAdmins(ADMIN_RED, string,1);
format(string, sizeof(string), "Your report on '%s' has been sent to the current online admins. Thank you.", giveplayername);
SendClientMessage(playerid, GREEN, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, RED, string);
}
return 1;
}