Rcon command not working -
Swimor - 01.10.2012
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?
Re: Rcon command not working -
TheBlackKnight - 01.10.2012
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");"
Re: Rcon command not working -
Swimor - 01.10.2012
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.
Re: Rcon command not working -
TheBlackKnight - 01.10.2012
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"
Re: Rcon command not working -
Swimor - 01.10.2012
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?
Re: Rcon command not working -
trapstar2020 - 01.10.2012
lol dude just type the command no need for rcon xgmx soz
Re: Rcon command not working -
ReneG - 01.10.2012
Try typing "xgmx" in the server console.
Re: Rcon command not working -
Extremo - 01.10.2012
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!
Re: Rcon command not working -
Swimor - 01.10.2012
Quote:
Originally Posted by Extremo
|
Just add
Код:
//==============================================================================
public OnRconCommand(cmd[])
{
return 1;
}
//==============================================================================
In FilterScript?
Re: Rcon command not working -
Extremo - 01.10.2012
Yeah, make a filterscript with that callback and then load it with the server when starting it up.
Afterwards it should work fine.