SA-MP Forums Archive
[Solved] OnRconCommand help needed.. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Solved] OnRconCommand help needed.. (/showthread.php?tid=82642)



[Solved] OnRconCommand help needed.. - SiJ - 19.06.2009

Why this doesn't work?
pawn Код:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd,"gmx",true)==0)
    {
      print("RCON command gmx has been used. Player stats saved.");
     
    }
  return 1;
}
When I type gmx into console... it doesn't print text...

EDIT:
Isn't this bug fixed yet:
Quote:
a_samp.inc

OnRconCommand - Only works in filterscripts



Re: OnRconCommand help needed.. - MenaceX^ - 19.06.2009

gmx already exists without making a custom command.


Re: OnRconCommand help needed.. - SiJ - 19.06.2009

Quote:
Originally Posted by MenaceX^
gmx already exists without making a custom command.
I thought that public OnRconCommand(cmd[]) is for existing RCON commands....

Quote:
OnRconCommand
This callback is called when a player types things into the RCON console.
So it's for existing and custom rcon commands, isn't it?

I still need help with this.. reply... I say REPLY to me!


Re: OnRconCommand help needed.. - SiJ - 20.06.2009

Here is what I want to do:
When admin uses /rcon gmx, I want to save player stats cause if they aren't saved, player spawns with 0 health on restart...


Re: OnRconCommand help needed.. - Joe Staff - 20.06.2009

then OnGameModeExit you script it to save.


Re: OnRconCommand help needed.. - SiJ - 20.06.2009

Ok, I'll try... I didn't thought about that..
EDIT:
But I have to do function like this: SaveStats(playerid);
But public OnGameModeInit() doesn't have playerid...
EDIT2: I know.. I'll make my own command which will save stats and SendRconCommand(gmx)