SA-MP Forums Archive
exactly time shower on timeleft.. - 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: exactly time shower on timeleft.. (/showthread.php?tid=140103)



exactly time shower on timeleft.. - FujiNNN - 07.04.2010

hey again..

sorry about the 2 posts in 10 min.. lol.. no really sorry..

ok.. what i wanna do is when player is finishing his job it will tell him "you finished please come back in (*XX Minutes*)"

and always if the player will try to do the job again it will tell him the exactly time that he need to wait.

like "you need to wait more 26 minutes"

yeah.. like a countdown.

thank you very mach!


Re: exactly time shower on timeleft.. - Hiddos - 07.04.2010

Use SetTimerEx

https://sampwiki.blast.hk/wiki/SetTimerEx


Re: exactly time shower on timeleft.. - Jeffry - 07.04.2010

Check this:

I use it too.

http://forum.sa-mp.com/index.php?top...9227#msg949227


Re: exactly time shower on timeleft.. - Hiddos - 07.04.2010

Thanks Jeff, never thought about something like that. I'll sure use it ^^


Re: exactly time shower on timeleft.. - Khelif - 07.04.2010

you could create one simple timer just like that...

pawn Код:
new jobTime[MAX_PLAYERS];
pawn Код:
public OnGameModeInit()
{
  SetTimer("UpdateJob", 60000, 1);
  return 1;
}
pawn Код:
forward UpdateJob();
public UpdateJob()
{
  for(new i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
  {
    if(jobTime[i] > 0) jobTime[i]--;
  }
}
pawn Код:
//When a player finishes his job set jobTime to whatever you want
jobTime[playerid] = 30; // Next job available in 30 minutes

new str[128];

if(jobTime[playerid] > 0)
{
  format(str, sizeof(str), "Please come back in %d minutes...", jobTime[playerid]);
  SendClientMessage(playerid, WHITE);
}



Re: exactly time shower on timeleft.. - FujiNNN - 07.04.2010

⒮⒠⒱⒠⒩⒮⒯⒜⒭ dude you helped me twice and i already love ya! thanks man!