Report problem -
WG Chinn - 17.08.2011
well in my server we are running lunix from volt-host and when i /ar [report ID] it works 1 time then if i try again it stp[s the server and my server even has a auto restart i have a crash log and nothing shows up on it and it report sytem works just fine on windows... i have tryed mylitple things i tryed changing my server verstion to R5 and i have tried a few diffrent sscanf.so's and i just stick to the newst one Y-Less posted so im asking people what could cause this i have tryed everything i could think of.. if anyone wants to help out please do i need it! scripts pretty buggy and a few things i dont understand so tell me what you think! i can post the CMD if u want me to i dont see that helping though.
Re: Report problem -
mprofitt - 17.08.2011
Yes, you are right, we are remote viewers and can see your script without it being posted....
Re: Report problem -
dowster - 17.08.2011
Please post the command, we can't do anything without it, make sure to include every thing in this command, ie: custom stocks/forwards that pertain to it, variables. that stuff
Re: Report problem -
WG Chinn - 17.08.2011
pawn Код:
CMD:report(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdmin] < 1338)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You can't submit reports as an administrator.");
return 1;
}
if(PlayerInfo[playerid][pRMuted] != 0)
{
ShowPlayerDialog(playerid,7955,DIALOG_STYLE_MSGBOX,"Report blocked","You are blocked from submitting any reports!\n\nTips when reporting:\n- Report what you need, not who you need.\n- Be specific, report exactly what you need.\n- Do not make false reports.\n- Do not flame admins.\n- Report only for in-game items.\n- For shop orders use the /shoporder command","Close", "");
return 1;
}
if(JustReported[playerid] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "Wait 25 seconds before sending another report!");
return 1;
}
if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /report [text]");
JustReported[playerid]=25;
SendReportToQue(playerid, params);
SendClientMessageEx(playerid, COLOR_YELLOW, "Your report message was sent to the Admins.");
return 1;
pawn Код:
CMD:ar(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128], reportid;
if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ar [reportid]");
if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, " Report ID not below 0 or above 999!"); return 1; }
if(Reports[reportid][BeingUsed] == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!");
return 1;
}
if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
{
SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !");
Reports[reportid][ReportFrom] = 999;
Reports[reportid][BeingUsed] = 0;
return 1;
}
format(string, sizeof(string), "AdmCmd: %s has accepted the report from %s (ID: %i, RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]),Reports[reportid][ReportFrom],reportid);
ABroadCast(COLOR_ORANGE, string, 2);
AddReportToken(playerid); // Report Tokens
format(string, sizeof(string), "%s has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.", GetPlayerNameEx(playerid));
SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
PlayerInfo[playerid][pAcceptReport]++;
Reports[reportid][ReplyTimerr] = SetTimerEx("ReplyTimer", 30000, 0, "d", reportid);
Reports[reportid][CheckingReport] = playerid;
Reports[reportid][BeingUsed] = 0;
Reports[reportid][TimeToExpire] = 0;
strmid(Reports[reportid][Report], "None", 0, 4, 4);
}
return 1;
}
CMD:tr(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128], reportid;
if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE,"USAGE: /tr [reportid]");
if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, " Report ID not below 0 or above 999!"); return 1; }
if(Reports[reportid][BeingUsed] == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!");
return 1;
}
if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
{
SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !");
Reports[reportid][ReportFrom] = 999;
Reports[reportid][BeingUsed] = 0;
return 1;
}
format(string, sizeof(string), "AdmCmd: %s has trashed the report from %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]));
ABroadCast(COLOR_ORANGE, string, 2);
format(string, sizeof(string), "%s has marked your report invalid. It will not be reviewed. Please check /reporttips", GetPlayerNameEx(playerid));
SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
PlayerInfo[playerid][pTrashReport]++;
Reports[reportid][ReportFrom] = 999;
Reports[reportid][BeingUsed] = 0;
Reports[reportid][TimeToExpire] = 0;
strmid(Reports[reportid][Report], "None", 0, 4, 4);
}
return 1;
}
Re: Report problem -
farris - 17.08.2011
it looks like you havent made anything to put the justreported back to 0 thus the player cant report a secodn time though thats probobly not why you have a crashing server
Re: Report problem -
WG Chinn - 17.08.2011
my players can report i second time.. they have to wait 25 sec to make another.. everything works just fine other then /ar as soon as i do it a second time it just crashes the server nothing like i just stoped it no logs or anything /tr work perfect! not a thing wrong thats what we have to do with all reports
Re: Report problem -
farris - 17.08.2011
explain to me wut
Reports[reportid][CheckingReport] = playerid;
does
Re: Report problem -
WG Chinn - 17.08.2011
i dont have a clue im not s scripter! lol thats why im asking SAMP! lol
Re: Report problem -
ElieJabbour - 17.08.2011
This is an NGG Edit..
Re: Report problem -
dowster - 17.08.2011
pawn Код:
CMD:ar(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
print("Creating Variables");
new string[128], reportid;
print("Executing SSCANF");
if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ar [reportid]");
print("Checking Report ID");
if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, " Report ID not below 0 or above 999!"); return 1; }
print("Checking report id for usage");
if(Reports[reportid][BeingUsed] == 0)
{
print("Sending report unused message");
SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!");
return 1;
}
print("Checking if player is connected");
if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
{
print("Sending player not connected message");
SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !");
print("Setting reportfrom to 999");
Reports[reportid][ReportFrom] = 999;
print("Setting BeingUsed to 0');
Reports[reportid][BeingUsed] = 0;
return 1;
}
print("formatting admin accepted message");
format(string, sizeof(string), "AdmCmd: %s has accepted the report from %s (ID: %i, RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]),Reports[reportid][ReportFrom],reportid);
print("Sending Admin Accepted Message to ABroadCast");
ABroadCast(COLOR_ORANGE, string, 2);
print("adding report token");
AddReportToken(playerid); // Report Tokens
print("formatting accepted messsage for player");
format(string, sizeof(string), "%s has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.", GetPlayerNameEx(playerid));
print("Sending The accepted message to the player");
SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
print("Setting pAcceptReport ++");
PlayerInfo[playerid][pAcceptReport]++;
print("Setting Reply Timer");
Reports[reportid][ReplyTimerr] = SetTimerEx("ReplyTimer", 30000, 0, "d", reportid);
print("Setting CheckingReport to the admins id");
Reports[reportid][CheckingReport] = playerid;
print("Setting BeingUsed to 0");
Reports[reportid][BeingUsed] = 0;
print("Setting time to expire to 0");
Reports[reportid][TimeToExpire] = 0;
print("Executing strmid");
strmid(Reports[reportid][Report], "None", 0, 4, 4);
}
return 1;
}
replace the /ar with that and then post the log after the server crashes
Re: Report problem -
WG Chinn - 17.08.2011
hi dowster i replaced the /AR with what u told me to and i got this...:
http://gyazo.com/8273bde356d842921a7f4ac56f910f07
Re: Report problem -
WG Chinn - 17.08.2011
well i got ti to compile with some help and uploaded it to the server worked 1 time as usal and 2nd time bam just crashed so here is the server log (what u should need anyways0
Re: Report problem -
dowster - 17.08.2011
Okay the problem is in you add report token function, can you please post that
?
Re: Report problem -
WG Chinn - 17.08.2011
pawn Код:
public AddReportToken(playerid) {
new
sz_FileStr[32 + MAX_PLAYER_NAME],
sz_playerName[MAX_PLAYER_NAME],
i_timestamp[3],
File: fPointer;
GetPlayerName(playerid, sz_playerName, MAX_PLAYER_NAME);
getdate(i_timestamp[0], i_timestamp[1], i_timestamp[2]);
format(sz_FileStr, sizeof(sz_FileStr), "admins/rtokens/%s[%d'%d'%d]", sz_playerName, i_timestamp[1], i_timestamp[2], i_timestamp[0]);
if(fexist(sz_FileStr))
{
fPointer = fopen(sz_FileStr, io_read);
fread(fPointer, sz_playerName), fclose(fPointer);
new
i_tokenVal = strval(sz_playerName);
format(sz_playerName, sizeof(sz_playerName), "%i", i_tokenVal + 1);
fPointer = fopen(sz_FileStr, io_write);
fwrite(fPointer, sz_playerName);
fclose(fPointer);
}
else {
fPointer = fopen(sz_FileStr, io_write);
fwrite(fPointer, "1");
}
return fclose(fPointer);
}
i missed one but now i got it!
pawn Код:
public SeeReportToken(playerid,name[],month,day,year)
{
new string[128], rtoken;
new strFromFile[128];
format(string,sizeof(string),"admins/rtokens/%s[%d'%d'%d]",name,month,day,year);
if(fexist(string))
{
new File: file = fopen(string, io_read);
if(file)
{
fread(file, strFromFile);
fclose(file);
rtoken = strval(strFromFile);
format(string,sizeof(string),"Admin has %d report tokens on [%d/%d/%d].",rtoken,month,day,year);
SendClientMessageEx(playerid, COLOR_YELLOW, string);
}
}
else
{
SendClientMessageEx(playerid, COLOR_YELLOW, "Admin does not have any logged report tokens for this date.");
return 0;
}
return 1;
}
i think thats what you need!
Re: Report problem -
WG Chinn - 17.08.2011
did u miss anything im pretty sure i didnt?
Re: Report problem -
dowster - 17.08.2011
I missed the part where you said this was an NG-RP edit and i do not believe it would be right to help you fix a stolen script, i hope you understand. Thanks.