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(playerid, params[])
{
new nick[50], query[128], str[150];
if(sscanf(params,"s[50]",nick)) return SendClientMessage(playerid, COLOR_YELLOW,"USAGE: /changename [New nick]");
format(query, sizeof(query), "SELECT Username FROM players WHERE Username ='%s'", nick);
if(cache_get_row_count(mysql))
{
new oldname[24];
GetPlayerName(playerid, oldname, sizeof(oldname));
format(query, sizeof(query), "UPDATE players SET Username='%s' WHERE ID=%d", nick, pData[playerid][ID]);
mysql_query(mysql, query);
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(playerid, nick);
}
else
{
format(str, sizeof(str), "Name %s is already in the database/used, please use onther name!", nick);
SendClientMessage(playerid, COLOR_RED, str);
}
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(playerid, params[])
{
new nick[50], query[128], str[150];
if(sscanf(params,"s[50]",nick)) return SendClientMessage(playerid, COLOR_YELLOW,"USAGE: /changename [New nick]");
format(query, sizeof(query), "SELECT Username FROM players WHERE Username ='%s'", nick);
if(!cache_get_row_count(query))
{
new oldname[24];
GetPlayerName(playerid, oldname, sizeof(oldname));
format(query, sizeof(query), "UPDATE players SET Username='%s' WHERE ID=%d", nick, pData[playerid][ID]);
mysql_query(mysql, query);
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(playerid, nick);
}
else
{
format(str, sizeof(str), "Name %s is already in the database/used, please use onther name!", nick);
SendClientMessage(playerid, COLOR_RED, str);
}
return 1;
}
so?
Код:
error 035: argument type mismatch (argument 1)