Mysql Change Name HElp Pleaasee
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
SQL is nothing like file systems that renaming a file requires to delete the current and create a new one. All you have to do is execute a query:
pawn Код:
// an example (in mysql_format):
"UPDATE users SET name='%e' WHERE name='%e' LIMIT 1", new_name, old_name
// or better yet "... WHERE ID=%i LIMIT 1" if you have a unique ID per-player.
Of course, you should check if the name is valid before updating the table.
This Is My Ban System Please GIve Me CHange Name Systeem On /Changename I Realy Need It And I Cant MAke It TNX
Код HTML:
{
	if(!adminLevel(playerid, 4))
		return 0;
			
	new otherID, time, reason[26];
	if(sscanf(params, "uds[26]", otherID, time, reason))
	{
		Usage(playerid, "ban <playerid> <day> <reason>");
	}
	else
	{
		if(time < 1 || time > 30)
		{
			Server(playerid, "Please input between 1 - 30.");
			return 1;
		}
		
		if(isMe(playerid, otherID))
		{
			Server(playerid, "You can't use this command to yourself.");
			return 1;
		}
		
		if(!isConnected(otherID))
		{
			Server(playerid, "That player isn't logged in!");
			return 1;
		}
		
		if(isHigher(playerid, otherID))
		{
			Server(playerid, "You can't use this command to that player.");
			return 1;
		}
		
		time = time * 1440;
		ban(playerid, otherID, reason, time);
	}
	return 1;
}
Reply


Messages In This Thread
Mysql Change Name HElp Pleaasee - by alishvasis - 18.07.2016, 11:43
Re: Mysql Change Name HElp Pleaasee - by Konstantinos - 18.07.2016, 11:48
Re: Mysql Change Name HElp Pleaasee - by alishvasis - 18.07.2016, 11:51
Re: Mysql Change Name HElp Pleaasee - by GangstaSunny - 18.07.2016, 11:52
Re: Mysql Change Name HElp Pleaasee - by Konstantinos - 18.07.2016, 12:09
Re: Mysql Change Name HElp Pleaasee - by alishvasis - 18.07.2016, 12:25
Re: Mysql Change Name HElp Pleaasee - by alishvasis - 18.07.2016, 13:05

Forum Jump:


Users browsing this thread: 1 Guest(s)