Rcon command not working
#1

Hello,

I'am trying to make a rcon command that names in xgmx.
the command used to reset the server and save the vehicles & players stats(they saved on a enum var).

this is my public:
Код:
public OnRconCommand(cmd[])
{
    if(strcmp("xgmx", cmd, true) == 0)
    {
        printf("-=-=-=- Saving player stats -=-=-=-");
        ForEach(i, GetMaxPlayers()) {
            SavePlayerInfo(i);
			SendClientMessage(i, -1, "Server is restarting.... Your Stats is Saved!! please Wait!");
			printf("Saving \"%s\" Stats...", GetName(i));
        }
        printf("-=-=-=- All players stats saved! -=-=-=-");

        printf("-=-=-=- Saving vehicle stats -=-=-=-");
		//save the vehicle
        printf("-=-=-=- All vehicles saved! -=-=-=-");
        
		SendRconCommand("gmx");
        return 1;
    }
    return 1;
}
I'm trying to do /rcon xgmx but nothing happend, but when i'm typing /rcon gmx it's works!
What to do?
Reply
#2

Why you want "/rcon xgmx" instead of "/rcon gmx"?? "/rcon gmx" is the original so it will work.
Did you tryed to change the "SendRconCommand("gmx");" to= "SendRconCommand("xgmx");"
Reply
#3

Quote:
Originally Posted by TheBlackKnight
Посмотреть сообщение
Why you want "/rcon xgmx" instead of "/rcon gmx"?? "/rcon gmx" is the original so it will work.
Did you tryed to change the "SendRconCommand("gmx");" to= "SendRconCommand("xgmx");"
You must read all the text that i wrote!
this command is saving the stats and reseting the server, if i doing /rcon gmx the file system is not so fast to save the stats & vehicles.

SendRconCommand("gmx"); - reseting the server, if you dont know scripting please dont commant again.
Reply
#4

Next time make the question clear: "I'm trying to do /rcon xgmx but nothing happend, but when i'm typing /rcon gmx it's works!
What to do?"

You said after you using "/rcon xgmx" "nothing happend"
Reply
#5

Quote:
Originally Posted by TheBlackKnight
Посмотреть сообщение
Next time make the question clear: "I'm trying to do /rcon xgmx but nothing happend, but when i'm typing /rcon gmx it's works!
What to do?"

You said after you using "/rcon xgmx" "nothing happend"
Right, I using /rcon xgmx and nothing happend, the server is not saving stats and not restarting!
Why?
Reply
#6

Код:
 /xgmx
lol dude just type the command no need for rcon xgmx soz
Reply
#7

Try typing "xgmx" in the server console.
Reply
#8

https://sampwiki.blast.hk/wiki/OnRconCommand

Notice:

Important Note: You will need to include this callback in a loaded filterscript for it to work in the gamemode!
Reply
#9

Quote:
Originally Posted by Extremo
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnRconCommand

Notice:

Important Note: You will need to include this callback in a loaded filterscript for it to work in the gamemode!
Just add
Код:
//==============================================================================
public OnRconCommand(cmd[])
{
	return 1;
}
//==============================================================================
In FilterScript?
Reply
#10

Yeah, make a filterscript with that callback and then load it with the server when starting it up.

Afterwards it should work fine.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)