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



/reports - KamalBa - 22.06.2015

I have this command but when someone report someone, i need to check /reports!

/reports say there is no reports yet, when the player has reported! like!




Код:
CMD:reports(playerid,params[])
{
    #pragma unused params
    if(adlvl[playerid] >= 1) {
        new ReportCount;
		for(new i; i < MAX_REPORTS; i++) if(strcmp(Reports[i], "<none>", true)) {
			ReportCount++;
			SendClientMessage(playerid, COLOR_WHITE, Reports[i]);
		}
		if(ReportCount == 0)
			SendClientMessage(playerid, COLOR_WHITE, "There have been no reports");
    }
	else
		SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be level 1/Help moderator to use this command");
	return 1;
}



Re: /reports - Prokill911 - 22.06.2015

Uh, You're showing us the /reports command...
you need to show the /report && /reports command

Otherwise 1 is useless without the other


Re: /reports - KamalBa - 22.06.2015

Код:
CMD:report(playerid, params[])
{
	new sstring[256], giveplayerid, reason[128], playername[25], giveplayer[25], string[128];
	if (sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /report [playerid] [reason]");
	if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive player id!");
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
	format(sstring, sizeof(sstring), "%s reported player %s(%d) for %s.\r\n", playername, giveplayer, giveplayerid, reason);
	SendMessageToAdmins(COLOR_ORANGE, sstring);
	format(string, 128, "Your report regarding %s(%d) has been sent to server admins.", giveplayer, giveplayerid);
	SendClientMessage(playerid, COLOR_YELLOW, string);
	return 1;
}



Re: /reports - KamalBa - 22.06.2015

BUMP!


Re: /reports - rappy93 - 22.06.2015

Quote:
Originally Posted by Prokill911
Посмотреть сообщение
Uh, You're showing us the /reports command...
you need to show the /report && /reports command

Otherwise 1 is useless without the other
Why are you bumping when you haven't even read all the replies ? Look what this guy asked for!


Re: /reports - KamalBa - 22.06.2015

Yes, he told me he need to see /report i've show you /reports and and i've post /report!

So both is here!


Re: /reports - Pottus - 22.06.2015

You don't even have any code that adds the report to a list there isn't anything wrong with your system it is simply not even coded. This is definitely some downloaded gamemode because you don't have the knowledge to even see the simplest of issues as this is read some tutorials.


Re: /reports - KamalBa - 22.06.2015

I didn't download anything, I just made it myself!

Ok i will try to fix this ty


Re: /reports - Prokill911 - 22.06.2015

Quote:
Originally Posted by Pottus
Посмотреть сообщение
You don't even have any code that adds the report to a list there isn't anything wrong with your system it is simply not even coded. This is definitely some downloaded gamemode because you don't have the knowledge to even see the simplest of issues as this is read some tutorials.
Pretty much what he said..
All you're doing is giving the player params to send a report..

Once they fufill those params all it does is send them 2 messages..
1 With the report text
1 Saying it has been sent...
You're not storing the reports anywhere..

You'd be better off making your reports into Enum arrays.

Example
PHP код:
Reports[] = {
     
ReportID[MAX_REPORTS];
     
PlayerReported[MAX_PLAYER_NAME],
     
ReportedPlayer[MAX_PLAYER_NAME],
     
ReportReason[128],
}; 
Then just make it so when ever someone reports...
It counts +1 To the ID for each outstanding report.
An adds into each field per that ID.


Re : /reports - KillerDVX - 22.06.2015

Try this :

PHP код:
CMD:reports(playerid,params[])
{
    
#pragma unused params
    
if(adlvl[playerid] >= 1) {
        new 
ReportCount;
        for(new 
iMAX_REPORTSi++) if(strcmp(Reports[i], "<none>"true)) {
            
ReportCount =1;
            
SendClientMessage(playeridCOLOR_WHITEReports[i]);
        }
        if(
ReportCount == 0)
            
SendClientMessage(playeridCOLOR_WHITE"There have been no reports");
    }
    else
        
SendClientMessage(playeridCOLOR_RED"ERROR: You need to be level 1/Help moderator to use this command");
    return 
1;