SA-MP Forums Archive
Money start - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Money start (/showthread.php?tid=551166)



Money start - Sn4ke2 - 17.12.2014

Hi guys,
i want to change money when a player register, server give 1.000.000$, i want the server give 10.000$
The server is MYSQL


Re: Money start - JeaSon - 17.12.2014

show the code where player register
something like public OnPlayerRegister ? ! whatever you have post that code here or search for it then there will be GivePlayerMoney(playerid, 1000000); change it to whatever money you want to give


Re: Money start - Sn4ke2 - 17.12.2014

This is Public OnPlayerRegister
Код:
public OnPlayerRegister(playerid, password[]) // 
{
	if(IsPlayerConnected(playerid))
	{
		MySQLCheckConnection();
		new playername3[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playername3, sizeof(playername3));
		new newaccountsqlid = MySQLCreateAccount(playername3, password, playerid);
		if (newaccountsqlid != 0)
		{
			new loginstring[128];
			PlayerData[playerid][pSQLID] = newaccountsqlid;
			strmid(PlayerData[playerid][pKey], password, 0, strlen(password), 255);
			OnPlayerUpdateEx(playerid);
            format(loginstring,sizeof(loginstring),"Bine ai venit, %s\nAcest nick este inregistrat.\nTe rog logheaza-te:",playername3);
			ShowPlayerDialog(playerid,12346,DIALOG_STYLE_PASSWORD,"{1E90FF}L{FFFFFF}ogheaza-te",loginstring,"Login","Exit");
			return 1;
		}
		else
		{
			gPlayerAccount[playerid] = 0;
 			new regstring[128];
			new regname[64];
			GetPlayerName(playerid,regname,sizeof(regname));
			format(regstring,sizeof(regstring),"Bine ai venit, %s\nNu ai cont.\nTe rog inregistreaza-te:",regname);
			ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD,"{1E90FF}I{FFFFFF}nregistreaza-te",regstring,"Register","Exit");
		}
	}
	return 0;
}