Need help with something.
#8

so my command is like this:

pawn Код:
if(strcmp(cmd, "/blacklist", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /BlackList [Nume] [Motiv");
                return 1;
            }
            giveplayerid = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /BlackList [Nume] [Motiv");
                    return 1;
                }
                new playername3[MAX_PLAYER_NAME];
                new string3[64];
                GetPlayerName(giveplayerid, playername3, sizeof(playername3));
                format(string3, sizeof(string3), "users/%s.ini", playername3);
                new File: hFile = fopen(playername3, io_write);
                if (hFile)
                {
                   PlayerInfo[playerid][pBlackList] = 1;
                   format(string, sizeof(string), "AdmCmd: %s a fost adaugat in BlackList de catre %s, Motiv: %s", giveplayer, sendername, (result));
                   BlackListLog(string);
                   format(string, sizeof(string), "AdmCmd: %s a fost adaugat in BlackList de catre %s, Motiv: %s", giveplayer, sendername, (result));
                   SendClientMessageToAll(COLOR_LIGHTRED, string);
                   fclose(hFile);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, " Doar adminii pot folosi aceasta comanda!!!");
                return 1;
            }
        }
        return 1;
    }
but is baning myself /blacklist myname non-rp name. = Im_BanK was added in the BlackList by Im_BanK , reason: non-rp name.

why is that happening>?

What can i do to ban the writed name.?
Reply


Messages In This Thread
Need help with something. - by Im_BanK - 17.05.2011, 08:12
Re: Need help with something. - by Biesmen - 17.05.2011, 08:14
Re: Need help with something. - by Im_BanK - 17.05.2011, 08:15
Re: Need help with something. - by Elka_Blazer - 17.05.2011, 08:51
Re: Need help with something. - by DeadAhead - 17.05.2011, 09:51
Re: Need help with something. - by Elka_Blazer - 17.05.2011, 10:50
Re: Need help with something. - by Biesmen - 17.05.2011, 10:55
Re: Need help with something. - by Im_BanK - 17.05.2011, 11:43
Re: Need help with something. - by Im_BanK - 17.05.2011, 15:52

Forum Jump:


Users browsing this thread: 2 Guest(s)