20.02.2015, 15:52
i make a CMD change player name but i got 2 problems
the name doesn't change ingame and doesn't save in mysql DB plz help
sorry for my bad english
thanks
the name doesn't change ingame and doesn't save in mysql DB plz help
pawn Код:
CMD:setname(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new id, name[24], str[130], query[1200], newname[24];
if(sscanf(params, "ds", id,newname)) return SendClientMessage(playerid,COLOR_WHITE,"/SetName [Playerid] [New Name]");
{
GetPlayerName(id,name,24);
format(str,130,"You Changed %s (%d)'s Name to %s",name,id,newname);
SendClientMessage(playerid,COLOR_BLUE,str);
format(str,130, "Admin Changed Your Name to %s",newname);
format(query, sizeof(query), "UPDATE 'players' SET Username='%s' WHERE Username='%s'",newname,name);
mysql_tquery(mysql, query);
SendClientMessage(playerid,COLOR_BLUE,str);
SetPlayerName(id,newname,24);
}
} else return SendClientMessage(playerid,COLOR_RED,"Your Level Is Not High Enough To Use This Command");
return 1;
}
sorry for my bad english
thanks