Job Contract - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Job Contract (
/showthread.php?tid=119189)
Job Contract -
Oi! - 07.01.2010
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.
Код:
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?
Re: Job Contract -
michael2572 - 07.01.2010
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.