/reports command +REP
#1

Hello,so how do i make /reports command that reads the reports from a file (By File.inc) and sends a messages that it is showing the current reports,how can i do that?
Reply
#2

anyone?
Reply
#3

Learn to do it yourself
atleast try it if u face any prob during making it then ask
don't ask us to script whole thing for you
this is not right section for it

but here i am giving an example for it
try making it our self
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

stock Name(playerid)//stock to get player name
{
new name[24];
GetPlayerName(playerid, name, 24);
return name;
}


CMD:reprot(playerid, params[])
{
//first here do the checks if the player who playerid wants to report is connected or not

//now suppose that you store the playerid who is being reported in "targetid" and reason in "reason"

new str[128];
format(str,128,"%s|%s|%s",Name(playerid),Name(targetid),reason);
new File:file=fopen("Reports.txt", io_append);
fwrite(file, str);
fwrite(file, "\n\r");//this is to leave a line after writing
fclose(file);
return1;
}

CMD:checkreport(playerid params[])//comand to read the reports
{
//first check that the playerid is admin or not

new reporter[24],reported[24],reason[80],line[128],str[1000],temp[130];
new File:file=fopen("Reports.txt", io_read);
while(fread(file, line);
{
sscanf(line, "p<|>sss"reporter, reported, reason);//to split the line
format(temp, 130, "Reporter: %s || Player Reported: %s || reason: %s\n",reporter,reported,reason);
strcat(str, temp, 130);
}
fclose(file);
//now the reports have been stored in variable "str" show it using ShowPlayerDialog
return 1;
}
Reply
#4

i didn't mean to ask,i just don't know how to make one.
Reply
#5

When i put Checkreport Command, The PAWN Compiler Stops Working, help please.
Reply
#6

nvm fixed by myself
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)