SA-MP Forums Archive
Adding business payout at payday. [MySQL] - 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: Adding business payout at payday. [MySQL] (/showthread.php?tid=467482)



Adding business payout at payday. [MySQL] - Fez - 03.10.2013

I recently noticed that I simply forgot to add the business payout when a player signs their check and for some reason I am now having some difficulty figuring out how to add the business payout to the payday from the MySQL database. Any help would be appreciated!

Код:
stock PayDayCheck(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    SendClientMessage(playerid, ORANGE, "-----------------------------------------------");
		new string[256], rand = 1 + random(599);
		new rand1 = 1 + random(199);
		format(string, sizeof(string), "Payout: $%d", rand);
		SendClientMessage(playerid, WHITE, string);
		format(string, sizeof(string), "Tax deduction: $%d", rand1);
		SendClientMessage(playerid, WHITE, string);
		Player[playerid][ExperiencePoints] += 1;
		format(string, sizeof(string), "Experience points: 1 added - Total: %d", Player[playerid][ExperiencePoints]);
		SendClientMessage(playerid, WHITE, string);
		Player[playerid][Money] -= rand1;
		Player[playerid][Money] += rand;
		SendClientMessage(playerid, ORANGE, "-----------------------------------------------");
		SaveStats(playerid);
	}
	return 1;
}