rcmd, like dcmd but for rcon commands!
#1

the define:
pawn Код:
#define rcmd(%1,%2,%3) if (!strcmp((%3)[0], #%1, true, (%2)) && ((((%3)[(%2)] == '\0') && (rcmd_%1(""))) || (((%3)[(%2)] == ' ') && (rcmd_%1((%3)[(%2) + 1]))))) return 1
the usage:
pawn Код:
public OnRconCommand(cmd[])
{
   rcmd(cmdnamenoslash, 14, cmd); //14 is the length, cmd is the param passed by OnRconCommand
   return 1;
}
the usage:
pawn Код:
rcmd_cmdnamenoslash(params[])
{
   new Float:x, Float:y;
   if (sscanf(params, "ff", x, y)) print("USAGE: /cmdnamenoslash [x] [y]");
   else
   {      
          printf("%f", AngleToPoint(0.0, 0.0, x, y));
   }
   return 1;
}
if you call it by using /rcon cmdnamenoslash then any prints in the code will print to your in-game screen.
Reply


Messages In This Thread
rcmd, like dcmd but for rcon commands! - by Daren_Jacobson - 02.03.2009, 00:47
Re: rcmd, like dcmd but for rcon commands! - by Daren_Jacobson - 02.03.2009, 14:12
Re: rcmd, like dcmd but for rcon commands! - by Daren_Jacobson - 02.03.2009, 21:02

Forum Jump:


Users browsing this thread: 1 Guest(s)