/report{HOW} - 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)
+--- Thread: /report{HOW} (
/showthread.php?tid=308924)
/report{HOW} -
geerdinho8 - 05.01.2012
I cant get it right, im till so far:
pawn Код:
if(strcmp(cmd, "/report", true) == 0)
{
tmp = strtok(cmdtext,idx), tmp2 = strtok(cmdtext,idx);
new player1, Reason;
player1 = strval(tmp);
Reason = strval(tmp2);
if(!strlen(tmp) && !strlen(tmp2))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /report [playerid] [reason]");
}
else
{
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,sizeof(string),"Thank you for your report, the online admins will check it!", playername, Reason);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string,sizeof(string),"%s reported %s (Reason: %i)",adminname, playername, Reason);
printf("%s has reported %s !(Reason: %i)",adminname, playername, Reason);
}
return 1;
}
Re: /report{HOW} -
[ABK]Antonio - 05.01.2012
reason would be %s, %i = integer %s = string. reason would be a string in this case
Also;
format(string,sizeof(string),"Thank you for your report, the online admins will check it!", playername, Reason);
can be;
SendClientMessage(playerid, COLOR_GREEN, "Thank you for your report, the online admins will check it!");
Re: /report{HOW} -
geerdinho8 - 06.01.2012
Thanks but how to send it to online admins?
Re: /report{HOW} -
sabretur - 06.01.2012
pawn Код:
format(string,sizeof(string),"%s has reported %s !(Reason: %i)",adminname, playername, Reason);
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && pInfo[i][Admin] > 0) SendClientMessage(i,COLOR_GREEN,string);
}