Job Contract
#1

I'm trying to make a job contact that will show up in your stats as 25 minutes when you type /stats

Well I've made a job contract before, but the problem I have is that the contract won't count down.

Код:
pJobCont,
Код:
PlayerInfo[playerid][pJobCont] = 0;
Код:
new jcont = PlayerInfo[targetid][pJobCont]/60;
Код:
Job contract time left:[%d min]
Код:
format(var, 32, "JobContract=%d\n",PlayerInfo[playerid][pJobCont]);fwrite(hFile, var);
Код:
			  if(GettingJob[playerid] > 0)
			  {
			    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Congratulations with your new Job, type /help to see your new command.");
			    PlayerInfo[playerid][pJob] = GettingJob[playerid];
					//PlayerInfo[playerid][pJobCont] = 1500000;
					GettingJob[playerid] = 0;
			    return 1;
			  }
Код:
  	/*if(PlayerInfo[playerid][pJobCont] > 0)
  	{
  			new seconds = PlayerInfo[playerid][pJobCont]/60;
			format(string, sizeof(string), "* You must complete your %d minute contract before quitting your job.", seconds);
			SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
  		return 1;
  	}*/
How can I make this Job Contract count down when the player is logged in? Can somebody please help me out?
Reply
#2

Have a 1 second repeating timer that decrements PlayerInfo[playerid][pJobCont] as long as it's greater than 0. Then, to start it, just assign it a value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)