SA-MP Forums Archive
Changename - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Changename (/showthread.php?tid=634530)



Changename - Loinal - 20.05.2017

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



Re: Changename - IFilip - 20.05.2017

Which line is "4735"?


Re: Changename - Loinal - 21.05.2017

Quote:
Originally Posted by IFilip
Посмотреть сообщение
Which line is "4735"?
if(!cache_get_row_count(mysql))


Re: Changename - SyS - 21.05.2017

https://sampwiki.blast.hk/wiki/MySQL/R40..._get_row_count


Re: Changename - Loinal - 21.05.2017

Quote:
Originally Posted by SyS
Посмотреть сообщение
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(query))
    {
        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;

so?

Код:
error 035: argument type mismatch (argument 1)