Timer time left - 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: Timer time left (
/showthread.php?tid=636139)
Timer time left -
Logan0147 - 20.06.2017
Hi
I've made a /jail command with a timer, and the jail time is saved in "playerinfo[playerid][jtime]" also i can load it
but i would like to make a /time cmd so the player can see how much time left before he quit the jail how can i do it?
Re: Timer time left -
StR_MaRy - 20.06.2017
something like ...
Код HTML:
CMD:timeleft(playerid)
{
new string[120];
if(gLogged == 0) return 1; // Check if he is logged put your variable.
if(IsPlayerJailed == 1) // Your variable that calls if a player is or not in jail.
{
format(string, sizeof(string), "Your jail time: %d", playerinfo[playerid][jtime]); // This %d is for secconds only
SCM(playerid, -1, string);
}
}
Re: Timer time left -
GSFBart - 20.06.2017
Is the remaining time counted in seconds or milliseconds?
Re: Timer time left -
Eoussama - 21.06.2017
Quote:
Originally Posted by StR_MaRy
something like ...
Код HTML:
CMD:timeleft(playerid)
{
new string[120];
if(gLogged == 0) return 1; // Check if he is logged put your variable.
if(IsPlayerJailed == 1) // Your variable that calls if a player is or not in jail.
{
format(string, sizeof(string), "Your jail time: %d", playerinfo[playerid][jtime]); // This %d is for secconds only
SCM(playerid, -1, string);
}
}
|
the guy wanted to know the remaining time, not the jail time iteself,
PHP код:
#define JAIL_TIRE 30000 //30 seconds
format(string, sizeof(string), "Your jail time: %d", JAIL_TIME - playerinfo[playerid][jtime]);
,
It's in milliseconds,
Re: Timer time left -
StR_MaRy - 21.06.2017
Quote:
Originally Posted by Eoussama
the guy wanted to know the remaining time, not the jail time iteself,
PHP код:
#define JAIL_TIRE 30000 //30 seconds
format(string, sizeof(string), "Your jail time: %d", JAIL_TIME - playerinfo[playerid][jtime]);
,
It's in milliseconds,
|
ok budy thx

but my script is the same and for me it works fine with timers from gangs WAr