04.10.2011, 22:14
pawn Code:
if(strcmp(cmd, "/report", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [ID] [Reason]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(AdminDuty[giveplayerid] == 0) return SendClientMessage(playerid, -1, "This admin isnt onduty!");
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [ID of the Player] [Reason]");
return 1;
}
format(string, sizeof(string), "%s (%d) reported %s (%d)Reason: %s",sendername, playerid, giveplayer, giveplayerid, (result));
ABroadCast(COLOR_LIGHTRED,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Your Rapport Was Send to Online Admins.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "This Player isn't Connected !");
return 1;
}
}
return 1;
}