Command help
#1

Removed
Reply
#2

You have to make a check for the player name.
Reply
#3

pawn Код:
COMMAND:hello(playerid, params[])
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    if(!strcmp(pname,"Fernado"))
    {
        //Your Code goes here, what is this doing if your name is Fernado
    }
    else SendClientMessage(playerid, 0xFFFFFFFF, "You are not allowed to use this command!");
    return 1;
}
Reply
#4

You could always do the casual strcmp

pawn Код:
CMD:mycommand(playerid, params)
{
    new pname[24];
    GetPlayerName(playerid, pname, 24);
    if(strcmp(pname, "Fernando", true)) return SendClientMessage(playerid, -1, "Only Fernando can use this command!");
    //Command
    return 1;
}
EDIT: Looks like RACGaming beat me to it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)