Create a new Id
#1

When ever a new player registers the Id of new one is replaced in the old one

this is my register cmd, I want a new Id to be created when a new player is registered.


Код:
 MySQLregister(playerid, params[])
{
	new password[130];
	mysql_escape_string(params,password);
	new str[128];
    mysql_format(mysql,str,sizeof(str),"INSERT INTO `users` (`Name`, `Pass`, `ID`) VALUES ('%s', '%s', '%s')",PlayerName(playerid),password, NewFieldID[playerid]);
	mysql_query(mysql,str);
	//--------------------------------------------------
	SendLangMessage(playerid, _COLOR_YELLOW, "Account wurde erstellt:","Account was created:","Tu cuenta ha sido creada:");
	switch(Sprache[playerid])
	{
		case 0: format(str, sizeof(str), "Passwort: \"%s\"",password);
		case 1: format(str, sizeof(str), "Password: \"%s\"",password);
		case 2: format(str, sizeof(str), "Contrasena: \"%s\"",password);
	}
	SendClientMessage(playerid, _COLOR_GREEN, str);
	SendLangMessage(playerid, _COLOR_GREEN, "Du wurdest eingeloggt!","You are logged in!","Has iniciado sesi鏮!");
	GivePlayerCash(playerid,10000);
	GiveClanCash(playerid,10000);
	LoggedIn[playerid] = 1;
	mysql_format(mysql,str, sizeof(str), "SELECT * FROM `users` WHERE Name = '%s'",PlayerName(playerid));
	mysql_query(mysql,str);
    NewFieldID[playerid] = cache_insert_id();
    return 1;
}
The mysql have the Id field
Reply


Messages In This Thread
Create a new Id - by DetoNater - 06.06.2015, 10:12
Re: Create a new Id - by DetoNater - 06.06.2015, 20:29
Re: Create a new Id - by Kitten - 06.06.2015, 20:34
Re: Create a new Id - by CodeStyle175 - 06.06.2015, 20:37
Re: Create a new Id - by DetoNater - 06.06.2015, 21:09
Re: Create a new Id - by Konstantinos - 06.06.2015, 21:34

Forum Jump:


Users browsing this thread: 2 Guest(s)