something like this here: (i think when u use exacly my code it wont work, but i just want to show you
)
Код:
if(strcmp("/jail",cmdtext,true) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);
new tmp2[128];
tmp2 = strtok(cmdtext, idx);
//<----Then here the timer......
new JHour, JMin, JSec;
gettime(JHour, JMin, JSec);
SetPlayerPos(strval(tmp), JAIL X, JAIL Y, JAIL Z);
return JHour, JMin, JSec;
}
if(strcmp("/jailtime",cmdtext,true) == 0)
{
new Hour, Min, Sec;
new Rhour, Rmin, Rsec;
gettime(Hour, Min, Sec);
Rhour=JHour-Hour;
Rmin=JMin-Min;
Rsec=JSec-Sec;
new string[128];
format(string,sizeof(string)," %i Hours, %i Minutes and %i Seconds left!",Rhour, Rmin, Rsec);
SendClientMessage(playerid,WHITE,string);
}
.....
I'm not sure if it works, i hope so, but i cannot check, cuz my compiler is broken at the moment XD... it could be that it gives you at Rsec and Rmin a negative value, but i guess you will be able to solve that by urself within using "<" and ">"... I hope my code is not tooooo broken for you to use :S... But i did my best and hope it helped you out a bit.
Best wishes, DeathOnaStick
(by the way, im not even sure if you can use gettime for that, if not, you have to set a timer, which counts every second, which is passed during the server is online, and work on this basic, like i did with gettime.)