Custom RCON Commands - 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: Custom RCON Commands (
/showthread.php?tid=127749)
Custom RCON Commands -
VWOer - 14.02.2010
Hey all,
I would like to know whether there's a faster way of processing custom RCON commands, except strcmp/strtok.
If so, could you give an example?
Thanks in advance,
VW
Re: Custom RCON Commands -
Daren_Jacobson - 15.02.2010
search for rcmd, I made it a while back.
Re: Custom RCON Commands -
VWOer - 16.02.2010
Thanks, I didn't find anything (it isn't in English :P). Nice function!
Re: Custom RCON Commands -
iron_war_lord - 16.02.2010
Try searching for dcmd. I use it for my custom RCON commands, I use dcmd for everything.
Link:
https://sampwiki.blast.hk/wiki/Fast_Commands
Re: Custom RCON Commands -
VWOer - 16.02.2010
I'm using DCMD already, but point is that the OnRconCommand doesn't have the playerid-parameter (because the Remote Console isn't a player, of course). That results in an "undefined symbol
playerid" warning.
I'm wondering how you made that possible then?
Re: Custom RCON Commands -
GforceNL - 16.02.2010
Quote:
Originally Posted by VWOer
I'm using DCMD already, but point is that the OnRconCommand doesn't have the playerid-parameter (because the Remote Console isn't a player, of course). That results in an "undefined symbol playerid" warning.
I'm wondering how you made that possible then?
|
Use
i instead of playerid
Re: Custom RCON Commands -
iron_war_lord - 16.02.2010
Lol, you got me to write a tutorial for this:
http://forum.sa-mp.com/index.php?topic=153273.0
Re: Custom RCON Commands -
VWOer - 16.02.2010
I know that way, but it isn't possible to make it both an RCON command and a normal command with the same function? For example..
pawn Code:
dcmd_cmd(playerid,params[])
{
// code
}
is both an RCON and a normal command (executable in the server itself and the RCON window)?
Re: Custom RCON Commands -
HB - 16.02.2010
As far as I know you shouldn't use OnRconCommand. Just use OnPlayerCommandText. dcmd_rcon would be the correct define, and in that function you should use strcmp combinated with sscanf (or something else) to check the real 'command' he wants to execute. Nice example: /rcon kickall
Re: Custom RCON Commands -
iron_war_lord - 16.02.2010
Yeah you can if they are both in the gamemode so:
public OnRconCommand(cmd[])
Code:
dcmd(command,7,cmd);
and
public OnPlayerCommandText(playerid, cmdtext[])
Code:
dcmd(command,7,cmd);
Then
Code:
dcmd_kill(params[])
{
//Code
}