SendRconCommand - 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: SendRconCommand (
/showthread.php?tid=301944)
SendRconCommand -
MaTrIx4057 - 06.12.2011
Whenever i use SendRconCommand("reloadfs nameofscript"); in any of server command it just closes my server. If i type in manually /rcon reloadfs nameofscript then it works fine. Is it sa-mp problem or i just don't get something?
For example, i type /panel, it shows me dialog with reload script button, i press it and it closes/crashes my server. Anyone got any solutions?
Re: SendRconCommand -
Ash. - 06.12.2011
Could you show us the code where you actually send the command? There may be a small error (though it should silently exit, rather than crashing).
Re: SendRconCommand -
MaTrIx4057 - 06.12.2011
Код:
new PNAME[MAX_PLAYER_NAME];
GetPlayerName(playerid, PNAME, sizeof (PNAME));
format(chatSTRING, sizeof (chatSTRING), ""BLUE"[AdmCmd] "GREEN"%s "BLUE"has reloaded the script!", PNAME);
SendClientMessageToAll(COLOR_BLUE, chatSTRING);
PlayerPlaySound(playerid, 1057, 0, 0, 0);
gettime(LogHour, LogMinute, LogSecond);
getdate(LogYear, LogMonth, LogDay);
new File:pos=fopen("admin.log", io_append);
if (pos)
{
format(FILESTRING, 256, "[%02d/%02d/%d - %02d:%02d:%02d] [AdmCmd] %s has reloaded the script!\r\n", LogDay, LogMonth, LogYear, LogHour, LogMinute, LogSecond, PNAME);
}
fwrite(pos, FILESTRING);
fclose(pos);
SendRconCommand("reloadfs matrixadmin");
Re: SendRconCommand -
Ash. - 06.12.2011
Try adding prints (see
https://sampwiki.blast.hk/wiki/Debugging) to see where the server actually crashes. It may be something to do with your file handling, rather than the SendRconCommand() native.
Re: SendRconCommand -
MaTrIx4057 - 06.12.2011
Nevermind, i fixed it, was some problem with dialogs. Thanks for help anyway.
Re: SendRconCommand -
Ash. - 06.12.2011
No problem
Re: SendRconCommand -
TheArcher - 06.12.2011
****** is right that what's happened to me with " SendRconCommand("unloadfs"); " so you can't call those functions in a FilterScript.