command
#1

well how can i use strcmp or w/e? like for a zcmd command i would like it to work if their name is "Tan"
Reply
#2

pawn Код:
CMD:yourcmd(playerid, params[])
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName,sizeof(PlayerName));

    if (strcmp(PlayerName,"Tan",true) == 0)
    {
    //Name is "Tan"
    }
    else
    {
    //Name is not "Tan"
    }

    return 1;
}
Reply
#3

well is there something shorter than that? would
pawn Код:
if(!strcmp(Nam,"Tan",true) == 0 && !IsPlayerAdmin(playerid)) return 0;
work? (i put return 0 so it return's 0 when their name is not that.)
Reply
#4

pawn Код:
if (strcmp(PlayerName,"Tan",true) != 0) return 0;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)