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
#2

Which line is "4735"?
Reply
#3

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

https://sampwiki.blast.hk/wiki/MySQL/R40..._get_row_count
Reply
#5

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)