[Question] Command only for one playerid.
#1

I have tryed to make this command to work only for one nick like "GBL" . But tryed it from me not work, tryed from other nick work ??.


pawn Код:
if(strcmp(cmd, "/makeblackfamily", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /makeblackfamily [ID Igraca/Dio Imena]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            new PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
            if(strcmp(PlayerName,"GBLTeam",true))
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pBlackFamily] = level;
                        format(string, sizeof(string), "   Dali/oduzeli ste %s-u BlackFamily clenstvo .", giveplayer,level);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "[GRESKA] Niste ovlasteni da koristite tu komandu!");
            }
        }
        return 1;
    }
Reply
#2

if(!strcmp(PlayerName,"GBLTeam",true))
Reply
#3

Quote:
Originally Posted by Macluawn
Посмотреть сообщение
if(!strcmp(PlayerName,"GBLTeam",true))
Oh what i was wrong "!" Thanks for help, fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)