Change Name Cmd
#9

Above is for Y_ini
there goes for Dini
Code:
CMD:changename(playerid, params[])
{
        if(PlayerInfo[playerid][LoggedIn] == 1)	{
		if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /changename [new Name]");
		if(strlen(params) < 4) return SendClientMessage(playerid,red,"ACCOUNT: Incorrect password length");
		if (udb_Exists(params)) return SendClientMessage(playerid,red,"This User Name Is Taken!");
		if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, red,"[ERROR]: You need $50000 to change your name!");
		new nameee[24];  GetPlayerName(playerid, nameee, 16);
		new OldName[24],str[128];
		GetPlayerName(playerid,OldName,sizeof(OldName));
		format(str,sizeof(str),"ladmin/users/%s.sav",OldName);
		udb_RenameUser(OldName,params);
		format(str,sizeof(str),"ladmin/users/%s.sav",params);
		SetPlayerName(playerid,params);
		PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
		GivePlayerMoney(playerid, -50000);
		new string[128];
        format(string, sizeof(string),"ACCOUNT: You have successfully changed your Name to \"%s\"",params);
		return SendClientMessage(playerid,yellow,string);
	} else return SendClientMessage(playerid,red, "ERROR: You must have an account to use this command");
}
More examples will help you more..
Reply


Messages In This Thread
Change Name Cmd - by Blackazur - 16.10.2012, 19:10
Re: Change Name Cmd - by Shockey HD - 16.10.2012, 20:12
AW: Change Name Cmd - by Blackazur - 17.10.2012, 15:39
Re: Change Name Cmd - by Anthony © - 17.10.2012, 16:28
AW: Change Name Cmd - by Blackazur - 17.10.2012, 20:09
Re : Change Name Cmd - by yusei - 17.10.2012, 20:33
AW: Change Name Cmd - by Blackazur - 18.10.2012, 13:47
Re: Change Name Cmd - by gtakillerIV - 18.10.2012, 14:02
Re: Change Name Cmd - by Jarnu - 18.10.2012, 14:10
AW: Re: Change Name Cmd - by Blackazur - 18.10.2012, 17:37

Forum Jump:


Users browsing this thread: 1 Guest(s)