Hi is there any report system working please someone reply and post here because cant find it on search, thanks
Might help you.
ok but where do I put it on pawno, do I put it under OnPlayerCommandText?
No, that command shouldn't be in any callback or function, it's dcmd-command as you can see. You will also need dcmd define for that.
Код:
//-------------------------[Report]---------------------------------------------
if(strcmp(cmd, "/report", true) == 0)
{
new rpt[256];
rpt = strtok(cmdtext, idx);
if(!strlen(rpt))
{
SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /report [playerid] [reason]");
return 1;
}
giveplayerid = strval(rpt);
strmid(tmp, cmdtext, 8+strlen(tmp), strlen(cmdtext));
if(!strlen(rpt))
{
SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /report [playerid] [reason]");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "*** %s (id: %d) reports player %s (id: %d) Reason: %s ***", sendername, playerid, giveplayer, giveplayerid, tmp);
ABroadCast(COLOR_YELLOW, string,1);
format(string, sizeof(string), "* Your report on player %s (id: %d) was sent to currently online admins*", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_GREEN, string);
} else {
format(string, sizeof(string), "* ID %d is not active a player.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}