SA-MP Forums Archive
/report request - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /report request (/showthread.php?tid=141418)



/report request - xmarc12 - 13.04.2010

Hi is there any report system working please someone reply and post here because cant find it on search, thanks


Re: /report request - Jeffry - 13.04.2010

Might help you.
http://forum.sa-mp.com/index.php?top...1641#msg911641

Tip: The "Search" Function is great!


Re: /report request - xmarc12 - 14.04.2010

ok but where do I put it on pawno, do I put it under OnPlayerCommandText?


Re: /report request - Correlli - 14.04.2010

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.


Re: /report request - johnnyc - 14.04.2010

add this to under any commands like /invite or /b or /o or w/e

Код:
//-------------------------[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;
}