/jailtime Problem
#2

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.)
Reply


Messages In This Thread
/jailtime Problem - by Erkan - 30.08.2009, 09:17
Re: /jailtime Problem - by DeathOnaStick - 30.08.2009, 15:58
Re: /jailtime Problem - by JR ! - 30.08.2009, 22:57
Re: /jailtime Problem - by Erkan - 31.08.2009, 02:12
Re: /jailtime Problem - by Erkan - 31.08.2009, 06:49
Re: /jailtime Problem - by JR ! - 31.08.2009, 10:59
Re: /jailtime Problem - by Erkan - 01.09.2009, 08:36
Re: /jailtime Problem - by Erkan - 01.09.2009, 19:27
Re: /jailtime Problem - by Erkan - 02.09.2009, 14:47

Forum Jump:


Users browsing this thread: 1 Guest(s)