Adding a parameter to a command, and if that is right...
#5

An example using ZCMD.

pawn Код:
CMD:secretthing(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, -1, "USAGE: /secretthing [password]");
        return 1;  
    }
   
    if(!strcmp(params, "secretpassword"))
    {
        // if they typed "secret password"
        // this section will be ran.
        SendClientMessage(playerid, -1, "Right password!");
        return 1;
    }
   
    else
    {
        // the password was wrong
        SendClientMessage(playerid, -1, "Wrong password!");
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)