Need help with rename CMD
#1

Hey, I have a little problem in Rename CMD , it changes name and all stats and everything but it create new account and move all stats to it like
OLDname: Test
NewName: Test123
Both of them are now on database, i want to rename Test to Test123 without creating New Account file

Код:
CMD:setname(playerid, params[])
{
        new string[128], tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
		if(isnull(tmp) || isnull(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setname [playerid] [new name]");
		if (udb_Exists(tmp2)) return SendClientMessage(playerid,red,"This User Name Is Taken!");
		new player1 = strval(tmp);

		new OldName[24],str[128];
		GetPlayerName(player1,OldName,sizeof(OldName));
		format(str,sizeof(str),"admin/users/%s.sav",OldName);
		udb_RenameUser(OldName,tmp2);
		format(str,sizeof(str),"admin/users/%s.sav",params);
		SetPlayerName(player1,tmp2);
        format(string, sizeof(string),"Admin ''%s'' Has Changed Your Name To '%s'",PlayerName2(playerid), tmp2);
		return SendClientMessage(player1,yellow,string);
}
Reply


Messages In This Thread
Need help with rename CMD - by Rockyyy - 22.04.2015, 18:19
Re: Need help with rename CMD - by Karan007 - 22.04.2015, 18:21
Re: Need help with rename CMD - by Rockyyy - 23.04.2015, 20:09
Re: Need help with rename CMD - by AberKane - 23.04.2015, 20:37
Re: Need help with rename CMD - by Rockyyy - 23.04.2015, 20:53
Re: Need help with rename CMD - by Eth - 23.04.2015, 21:28
Re: Need help with rename CMD - by Rockyyy - 23.04.2015, 21:47
Re: Need help with rename CMD - by Eth - 23.04.2015, 21:51
Re: Need help with rename CMD - by Rockyyy - 23.04.2015, 21:56
Re: Need help with rename CMD - by Rockyyy - 24.04.2015, 14:35

Forum Jump:


Users browsing this thread: 1 Guest(s)