Jump to content
  • 0

Problema jobgoal


Question

Posted (edited)

Am si eu o problema la jobgoal, cand cineva face job nu pune banii castigati de acel player in jobgoal

function GiveJobSalary(playerid) {
	// var
	new string[128], skill = GetPlayerSkill(playerid), money, bonus;
	
	// ++
	switch(PlayerInfo[playerid][pJob]) {
		case 1: money = skill*100*KG[playerid] + 18000 + random(1000);
		case 2: {
			new category = GetPVarInt(playerid, "Category");
			switch(category) {
				case 0: money = skill*3000 + 28000 + random(1000);
				case 1: money = skill*3000 + 28000 + random(2000);
				case 2: money = skill*3000 + 28000 + random(3000);
				case 3: money = skill*3000 + 28000 + random(4000);
				case 4: money = skill*3000 + 28000 + random(5000);				
				case 5: money = skill*3000 + 28000 + random(6000);
			}
		}
		case 3: money = skill*5000 + 30000 + random(1000);
		case 4: money = skill*1000 + 25000 + random(1000);
		case 5: money = skill*1500 + 25000 + random(1000);
		//case 6: money = 10000 + random(200) + GetPlayerSkill(playerid)*4000;
		case 9: money = skill*1000 + 10000 + random(10000);
		case 10: money = skill*2000 + 28000 + random(1000);
		case 12: money = skill*4000 + 27000 + random(1000);
		case 13: money = skill*100 + 2000 + random(1000);
	}
	giveserverjobgoal(money+bonus);
	if(WorkingTime[playerid] < 60 && PlayerInfo[playerid][pJob] != 13) money -= 10000;
	//if(PlayerInfo[playerid][pPremiumAccount] == 1) bonus = money/2;
	
	// info
	JobDeelay[playerid][PlayerInfo[playerid][pJob]] = 180;
	
	MoneyEarned[playerid] += money+bonus;
	CurseFacute[playerid] ++;
	format(string, sizeof(string), "%s a primit $%s pentru munca efectuata la job-ul %s.", GetName(playerid), FormatNumber(money+bonus), JobInfo[PlayerInfo[playerid][pJob]][jName]);
	InsertLog(playerid, string, LOG_MONEY);		
			
	format(string, sizeof(string), "Castig: $%s", FormatNumber(money));
	SCM(playerid, COLOR_GRAD2, string);
	format(string, sizeof(string), "Castig total: $%s", FormatNumber(money+bonus));
	SCM(playerid, COLOR_GRAD2, string);	
	format(string, sizeof(string), "Timp job: %s", CalculeazaTimp2(WorkingTime[playerid]));
	SCM(playerid, COLOR_GRAD2, string);		
	
	GivePlayerCash(playerid, money+bonus);
	Update(playerid, pCashx);
	
	WorkingTime[playerid] = 0;
	if(JobPoints(playerid) == GetNeedPoints4(playerid, PlayerInfo[playerid][pJob])) {
		format(string, sizeof(string), "* Felicitari! Noul tau skill la acest job este %d.", GetPlayerSkill(playerid));
		SCM(playerid, COLOR_YELLOW, string);
	}	
	else {
		if(togjob[playerid] == 0) JobProgress(playerid);	
	}	
	if(GetPlayerSkill(playerid) == 5) finishAchievement(playerid, 0);	
	UpdateProgress(playerid, 1);
	return 1;
}
function giveserverjobgoal(money) {
	server_jobgoal += money;
	foreach(new i : Player) {
		if(showserverjobgoal[i] == 1) {
			new koqs[64];
			format(koqs, 64, "~g~$%s~n~~w~out_of~n~$xx.xxx.xxx", FormatNumber(server_jobgoal));
			TextDrawSetString(jobgoaltextdraw[1], koqs);
			TextDrawShowForPlayer(i, jobgoaltextdraw[0]);
			TextDrawShowForPlayer(i, jobgoaltextdraw[1]);
		}
	}
	if(server_jobgoal >= 70000000) {
		new string[128], koqsadv = 1000000 + random(2000000), pp = 1 + random(4);
		foreach(new x : Player) {
			GivePlayerCash(x, koqsadv);
			PlayerInfo[x][pExp] += 3; Update(x, pRP);
			PlayerInfo[x][pPremiumPoints] += pp; Update(x, pPremiumPoints);
		}
		SendClientMessageToAll(-1, "");
		SendClientMessageToAll(-1, "");
		SendClientMessageToAll(-1, "");
		SendClientMessageToAll(0x26e01dFF, "JOB GOAL: {ffffff}Goal-ul a fost completat si toti jucatorii online au primit:");
		format(string, sizeof(string), "- $%s", FormatNumber(koqsadv));
		SendClientMessageToAll(-1, string);
		format(string, sizeof(string), "- %d puncte premium", pp);
		SendClientMessageToAll(-1, string);
		SendClientMessageToAll(-1, "- 3 puncte de respect");
		server_jobgoal = 0;
		foreach(new koqsnab : Player) {
			if(showserverjobgoal[koqsnab] == 1) {
				new koqs[64];
				format(koqs, 64, "~g~$%s~n~~w~out_of~n~$xx.xxx.xxx", FormatNumber(server_jobgoal));
				TextDrawSetString(jobgoaltextdraw[1], koqs);
				TextDrawShowForPlayer(koqsnab, jobgoaltextdraw[0]);
				TextDrawShowForPlayer(koqsnab, jobgoaltextdraw[1]);
			}
		}
	}
	return true; }

Cineva stie, daca mai e nevoie de ceva cod spuneti-mi.

Gamemode-ul este burned

Edited by Koqs

3 answers to this question

Recommended Posts

  • 0
Posted

@Mister T/C - problema rezolvata

                     

  Serverul meu de Discord: Click aici       a7DfKP7.gif                                                                      FGIfknL.gif

k35T5Nb.png                                                                                                                                                                                                                                                                                                I0aS856.gif

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.