Making a cmd that only a X name can use.
#1

Hello. I am trying to make a cmd, that only me and my friend can open, so only our names can.
If someone can help me... I am using ZCMD as cmd processor.

THANK YOU.
Reply
#2

Get the player name, compare it with Strcmp, then process the command. then return 0 for all other names.
Reply
#3

/\ in words

pawn Код:
CMD:command(playerid, params[]) {
    new
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof name);
    if(!strcmp(name, "recardo178", false) || !strcmp(name, "yourfriend", false)) {
        return true;
    }
    return false;
}
Reply
#4

It works. Thank you very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)