Changename
#1

PHP код:
CMD:changename(playeridparams[])
{
    new 
nick[50], query[128], str[150];
    if(
sscanf(params,"s[50]",nick)) return SendClientMessage(playeridCOLOR_YELLOW,"USAGE: /changename [New nick]");
    
format(querysizeof(query), "SELECT Username FROM players WHERE Username ='%s'"nick);
     if(
cache_get_row_count(mysql))
    {
        new 
oldname[24];
        
GetPlayerName(playeridoldnamesizeof(oldname));
        
format(querysizeof(query), "UPDATE players SET Username='%s' WHERE ID=%d"nickpData[playerid][ID]);
        
mysql_query(mysqlquery);
        
format(str,sizeof(str),"* You have changed your name to %s Don't forget to login with that name when you relog"nick);
        
SendClientMessage(playerid,COLOR_YELLOW,str);
        
SetPlayerName(playeridnick);
    }
    else
    {
        
format(strsizeof(str), "Name %s is already in the database/used, please use onther name!"nick);
        
SendClientMessage(playeridCOLOR_REDstr);
    }
    return 
1;

Iam getting warning

Код:
D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(4735) : warning 213: tag mismatch
Reply


Messages In This Thread
Changename - by Loinal - 20.05.2017, 19:44
Re: Changename - by IFilip - 20.05.2017, 20:51
Re: Changename - by Loinal - 21.05.2017, 08:01
Re: Changename - by SyS - 21.05.2017, 08:58
Re: Changename - by Loinal - 21.05.2017, 09:59

Forum Jump:


Users browsing this thread: 1 Guest(s)