Viewing past reports. - 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: Viewing past reports. (
/showthread.php?tid=549181)
Viewing past reports. -
Beckett - 05.12.2014
Howdy, well let me get straight into it, I am trying to create a viewing your past reports command I've figured it out then I've thought of someone what I am doing is.
pawn Код:
CMD:pending(playerid,params[])
{
if(!Logged[playerid]) return 0;
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new string[320];
foreach(new i : Player)
{
if(PlayerInfo[i][Pending] == 1)
{
format(string,sizeof(string),"Pending Report - %s(%i)",sendername(i),i);
}
}
ShowPlayerDialog(playerid,DIALOG_PENDING,DIALOG_STYLE_MSGBOX,"Pending Assistance/Reports",string,"Close","");
}
return 1;
}
In this code it will only format one player, means only one report. Do I need to create an array that has around 10 player ids(average max reports) or is there any other way?
Hope you understood, thanks.
Re: Viewing past reports. -
xCrazyMonkey - 05.12.2014
the reports made by the players should be saved somewhere temporarily. An Array should be a good place to save those reports untill someone uses /pending. If the command has been called in, the script can get all the "reports" from that variable/array and show that to you.
Have you tried to work like that?
Re: Viewing past reports. -
Kyance - 05.12.2014
pawn Код:
CMD:pending(playerid,params[])
{
if(!Logged[playerid]) return 0;
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new string[256]; //decreased the size for now
foreach(new i : Player)
{
if(PlayerInfo[i][Pending] == 1)
{
format(string,sizeof(string),"%sPending Report - %s(%i)\n",string, sendername(i),i);
}
}
ShowPlayerDialog(playerid,DIALOG_PENDING,DIALOG_STYLE_MSGBOX,"Pending Assistance/Reports",string,"Close","");
}
return 1;
}
You weren't "re-formatting" the string, you basically just 'overwrote' it, thus it didn't show all the reported players.
Re: Viewing past reports. -
Beckett - 05.12.2014
Quote:
Originally Posted by Kyance
pawn Код:
CMD:pending(playerid,params[]) { if(!Logged[playerid]) return 0; if(PlayerInfo[playerid][pAdmin] >= 1) { new string[256]; //decreased the size for now foreach(new i : Player) { if(PlayerInfo[i][Pending] == 1) { format(string,sizeof(string),"%sPending Report - %s(%i)\n",string, sendername(i),i); } } ShowPlayerDialog(playerid,DIALOG_PENDING,DIALOG_STYLE_MSGBOX,"Pending Assistance/Reports",string,"Close",""); } return 1; }
You weren't "re-formatting" the string, you basically just 'overwrote' it, thus it didn't show all the reported players.
|
Thanks!