Custom RCON Commands
#1

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

search for rcmd, I made it a while back.
Reply
#3

Thanks, I didn't find anything (it isn't in English :P). Nice function!
Reply
#4

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

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

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

Lol, you got me to write a tutorial for this: http://forum.sa-mp.com/index.php?topic=153273.0
Reply
#8

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)?
Reply
#9

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
Reply
#10

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
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)