SA-MP Forums Archive
Report - 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 (/showthread.php?tid=137630)



Report - DauerDicht - 29.03.2010

Hi, how can i make a Report Command only for Cops.. i mean if a player want to send a message to cops..

I only have /report to all admins, but how can i make this for only cops?

this is my report command

if(strcmp(cmd, "/report", true) == 0)
{
if(IsPlayerConnected(playerid))
{
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, COLOR_GRAD2, "USAGE: /report [text]");
return 1;
}
format(string, sizeof(string), "Report von %s[%d]: %s. (%d-%d-%d)", sendername, playerid, (result),month,day,year);
ABroadCast(COLOR_SACBLUE,string,1);
ReportLog(string);
SendClientMessage(playerid, COLOR_SACBLUE, "»» Vielen Dank fьr deinen Report.");
}
return 1;
}


Re: Report - Noredine - 29.03.2010

add in the commands : If gteam = COPS... this just an example


Re: Report - jamesbond007 - 29.03.2010

use [pawn] or [ code ] brackets to make the code more readable like this

Код:
public OnGameModeInIt
{
  return 1;
}



Re: Report - DauerDicht - 29.03.2010

Quote:
Originally Posted by Noredine
add in the commands : If gteam = COPS... this just an example
and then?


Re: Report - jamesbond007 - 29.03.2010

Quote:
Originally Posted by MaNiii
Quote:
Originally Posted by Noredine
add in the commands : If gteam = COPS... this just an example
and then?
if you really scripted all this you should know how to do this