RCON command with SSCANF not working
#1

It works when I type PM, it says Incorrect usage of RCON command, but when I add parameters it says:
Код:
Unknown command or variable:
  pm
Код:
if(strcmp(cmd, "pm", true) == 0)
    {
        new command, id, msg, string[128];
        if(sscanf(cmd, "sus", command, id, msg)) print("Incorrect usage of RCON command!");
        else if(id == INVALID_PLAYER_ID) print("Player not found!");
        else
        {
			format(string, sizeof(string), "[RCON PM] (( %s ))", msg);
			SendClientMessage(id, 0x00FF00AA, string);
			print("Your PM was sent to the player!");
        }
        return 1;
Reply
#2

The variables command and msg are supposed to be strings right?
Reply
#3

It works now, I needed to add a length:
if(strcmp(cmd, "pm", true, 2) == 0)
Thanks for your help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)