strcmp to check cmdtext
#1

Hey guys,

I am doing this to check if /pm command is used. But it is not working (i.e. on using /pm I am getting the same result as when I am not using /pm). Am I comparing the string the right way? :
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "Incorrect command, type /cmds to find out available commands");
    if(success)
    {
        if(strcmp(cmdtext, "/pm") == 1)
        {
            print("");
        }
    }
    return 1;
}
Regards.
Reply
#2

Use ZCMD and don't do that lol.
Reply
#3

Dude I already made the pm command using zcmd. Here I am checking if the player is using the command or not using the function.
And nvm I solved it.
pawn Код:
if(strcmp(cmdtext, "/pm") != 1) print("1");
            else
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)