SendRconCommand
#1

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?
Reply
#2

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).
Reply
#3

Код:
        	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");
Reply
#4

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.
Reply
#5

Nevermind, i fixed it, was some problem with dialogs. Thanks for help anyway.
Reply
#6

No problem
Reply
#7

****** is right that what's happened to me with " SendRconCommand("unloadfs"); " so you can't call those functions in a FilterScript.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)