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

Not sure. It might, but let me fix one simple thing up for you:

pawn Код:
dcmd_secret(playerid, params[])
{
    new result[128];
    if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "...");
    if(!strcmp(result,"..",true) == 0 && IsPlayerInRangeOfPoint(playerid, 5.0, ...))
    {
         ...
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD2, "Wrong password.");
        return 1;
    }
    return 1;
}
I made it so its using result instead of params, considering you are using at first, why not again.

Plus, you made it an integer, meaning it MUST be numbers (no decimals either), so I changed it to a string so you can have numbers AND letters in it.

PS: change 128 to the largest thing string size you want the password, meaning if the string will ONLY be test, just lower it down to 4 characters.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)