Author Topic: Question  (Read 2695 times)

0 Members and 1 Guest are viewing this topic.

Offline Tonys

  • Street Thug
  • *
  • Posts: 19
    • View Profile
Question
« on: January 15, 2010, 09:23:26 am »
Ok so uh how do you create commands in pawn using /c !commandhere and not just !commandhere.

Offline Boss

  • VC:MP Beta Tester (inactive)
  • Made Man
  • *
  • Posts: 229
  • Boss
    • View Profile
    • TDH Clan Site
Re: Question
« Reply #1 on: January 15, 2010, 12:10:28 pm »
Ok so uh how do you create commands in pawn using /c !commandhere and not just !commandhere.
Pretty much like a usual command:
Code: [Select]
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    if (strcmp(cmd, "!commandhere", true) == 0)
    {
        // Do stuff.
        return 1;
    }
    return 0;
}

Why would you want to use both "/c " and "!" anyway?