[HELP] Changename with MySQL +REP1
#5

This my script :

pawn Код:
CMD:changename(playerid,params[])
{
    new newname[24];
    new query[128],query1[128];
    new mess[128];
   
    if(pInfo[playerid][Login] == 0) return Kick(playerid);
    if(sscanf(params,"s[24]",newname)) return SCM(playerid,-1,"**Usage : /changename [Name]");

    mysql_format(mysql, query, sizeof(query),"SELECT `players` WHERE Username = '%e' LIMIT 1", GetName(playerid));

    if(cache_get_row_count())
    {
        SCM(playerid,-1,"** The name already exists!");
    }
    else
    {
        mysql_format(mysql, query1, sizeof(query1), "UPDATE `players` SET `Username`= '%e' WHERE `ID`= '%d'",newname,pInfo[playerid][ID]);
        mysql_tquery(mysql, query1, "", "");
       
        format(mess,128,"** Your name has changed too : %s",newname);
        printf("**CHANGE-NAME : %s has change name to %s",GetName(playerid),newname);
        SCM(playerid,-1,mess);
        pKick(playerid);
    }
    return 1;
}
Still can use already name exists !
How to fix that ?
Reply


Messages In This Thread
[HELP] Changename with MySQL +REP1 - by VenomMancer - 02.02.2015, 10:35
Re: [HELP] Changename with MySQL +REP1 - by BroZeus - 02.02.2015, 11:22
Re: [HELP] Changename with MySQL +REP1 - by VenomMancer - 02.02.2015, 12:30
Re : [HELP] Changename with MySQL +REP1 - by Dutheil - 02.02.2015, 12:40
Re: [HELP] Changename with MySQL +REP1 - by VenomMancer - 02.02.2015, 14:14
Re: [HELP] Changename with MySQL +REP1 - by VenomMancer - 02.02.2015, 22:57
Re: [HELP] Changename with MySQL +REP1 - by Sime30 - 02.02.2015, 23:08
Re: [HELP] Changename with MySQL +REP1 - by VenomMancer - 02.02.2015, 23:38
Re: [HELP] Changename with MySQL +REP1 - by zPain - 03.02.2015, 01:31
Re: [HELP] Changename with MySQL +REP1 - by VenomMancer - 03.02.2015, 12:55

Forum Jump:


Users browsing this thread: 2 Guest(s)