[Help] How to ban..
#1

Hello, I have this command :

pawn Код:
if(strcmp(cmd,"/changename",true)==0)
    {
        tmp = strtok(cmdtext, idx);
        if(strlen(tmp)==0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Syntax: /ChangeName <Player ID/Part of Name> <New Name>");
        giveplayerid = ReturnUser(tmp);
        if(giveplayerid != INVALID_PLAYER_ID)
        {
            if(PlayerInfo[playerid][pAdmin] >= 1338)
        {
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[80];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                GetPlayerName(giveplayerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "/users/%s.ini", sendername);
                frename(sendername,(result));
                SetPlayerName(giveplayerid,(result));
                fremove(string);
                format(string, sizeof(string), "Your name has been changed from %s to %s.", sendername, (result));
                SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);

            }
            else return SendClientMessage(playerid, COLOR_RED, "(Error): You are not an administrator.");
        }
        else return SendClientMessage(playerid, COLOR_RED, "(Error): Player does not exist.");
        return 1;
    }
I want when I do this command this will lock the old account, just PlayerInfo[sendername][pLocked] = 1;
but if I do that, he gets ban in his new account aswell.
Reply
#2

Hey, but another way to do it would be if you just rename player and delete old file?
It looks like you have system that has all variables in it so, when he exits server would use all variables what should be right and write to his new names file?
Maybe try it, it would work for GF registration system.

Al thought, it maybe harder if there is required to keep old file with task to block this name.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)