/changename
#1

My problem is I can change name even the name is already taken So I can get his stats and messed everything.

Anyone know how to fix this? if Player is already registered with the same name im going to change name, and I do "/changename Samplename"

SendClientMessage "The name is already taken"

pawn Код:
dcmd_changename(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new Index;
        new tmp[256];  tmp  = strtok(params, Index);
        if(!strlen(tmp)) return
        SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /changename [NewName]") &&
        SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Function: Will change your name to new name");
        new length = strlen(tmp);
        if(length < 3 || length > MAX_PLAYER_NAME) return SendClientMessage(playerid, 0xFFFFFFFF,"{FF0000}ERROR: Incorrect Name Length");
        new string[64];
        SendCommandToAdmins(playerid,"ChangeName");
        format(string,sizeof(string),"You have set your Name to %s", tmp);
        SendClientMessage(playerid, LIGHTGREEN, string);
        OnPlayerDisconnect(playerid, -1);
        udb_RenameUser(pName(playerid),tmp);
        SetPlayerName(playerid, tmp);
        return OnPlayerConnect(playerid);
    }
    else return ErrorMessages(playerid, 1);
}
Reply


Messages In This Thread
/changename - by kbalor - 12.08.2012, 15:24
Re: /changename - by kickerbat - 12.08.2012, 15:28
Re: /changename - by kbalor - 12.08.2012, 15:41
Re : /changename - by BigBaws - 12.08.2012, 15:43
Re: Re : /changename - by kbalor - 12.08.2012, 16:00
Re: /changename - by phillip875 - 12.08.2012, 16:12

Forum Jump:


Users browsing this thread: 2 Guest(s)