Help Needed ASAP -
Mr.1337 - 16.06.2012
There's few commands, when I type them in-game the game restarts. (Server turns off)
How to fix?..
Re: Help Needed ASAP -
Jonny5 - 16.06.2012
edit your code and fix errors....
i know that sounds generic but with the info you give
this is about the only help/advice that can be giving.
Re: Help Needed ASAP -
Mr.1337 - 16.06.2012
Here's the code btw..
Код:
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;
}
Re: Help Needed ASAP -
Jonny5 - 16.06.2012
i dont see anything right away
maybe try adding a bunch of
print("step X");
then run the command and open the server.log when
it crashes and see what the last step was.
this will get you closer to your error.
Re: Help Needed ASAP -
Mr.1337 - 16.06.2012
Well, also.. When I try the script on local host, server doesn't crash. but when I use the script on a hosted server, it crashs
Re: Help Needed ASAP -
judothijs - 16.06.2012
Do you use any plugins?
Make sure you enable the plugins on the server, as it will crash if you don't.
I see you're using sscanf, so check that plugin.
Re: Help Needed ASAP -
Mr.1337 - 16.06.2012
Enable them? You mean to write them in server.cfg in plugins?
Re: Help Needed ASAP -
judothijs - 16.06.2012
Yes, depending on what server host you're using you either have to put them into server.cfg, or you can simply tick them on a control panel.