SA-MP Forums Archive
Time - 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: Time (/showthread.php?tid=658336)



Time - SapMan - 02.09.2018

Hi guys I want to make an identifier with gettime to know if 90 seconds have passed.

I only have this that identifies if 6 minutes have not passed, but I want to detect if 90 seconds have already passed

PHP код:
if(gettime() < PLAYER[playerid][TIME] + 360) return SendClientMessage(playerid, -1"You can only use this command every 6 minutes");
PLAYER[playerid][TIME] = gettime(); 
How could I make it detect if 90 seconds have already passed?


Re: Time - Sew_Sumi - 02.09.2018

6 * 60 = 360.

90 = 90.

PHP код:
if(gettime() < PLAYER[playerid][TIME] + 360)//<< 



Re: Time - Shinja - 02.09.2018

PHP код:
if(gettime() < PLAYER[playerid][TIME] + 90) return SendClientMessage(playerid, -1"You can only use this command every 3 minutes");
PLAYER[playerid][TIME] = gettime(); 



Re: Time - NeXTGoD - 02.09.2018

Код HTML:
#define Is90SecondsHavePassed(%1) GetTickCount() > (CountTimer[%1]+90000)
new CountTimer[MAX_PLAYERS];

Starting counter:
CountTimer[playerid] = GetTickCount();

Function:
Is90SecondsHavePassed(playerid)// 90 Seconds have been passed



Re: Time - SapMan - 02.09.2018

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
6 * 60 = 360.

90 = 90.

PHP код:
if(gettime() < PLAYER[playerid][TIME] + 360)//<< 
I put that command to give an example of what I want to do. But what I want is for a message to appear that 90 seconds have already gone off, for example: "90 seconds have passed, you can not use this command.

"if(gettime() < PLAYER[playerid][TIME] + 360)" This only tells me that I can use the command every 6 minutes.


Re: Time - Shinja - 02.09.2018

PHP код:
if(gettime() < PLAYER[playerid][TIME] + 90) return SendClientMessage(playerid, -1"You can only use this command every 3 minutes");
PLAYER[playerid][TIME] = gettime(); 



Re: Time - SapMan - 02.09.2018

Quote:
Originally Posted by Shinja
Посмотреть сообщение
PHP код:
if(gettime() < PLAYER[playerid][TIME] + 90) return SendClientMessage(playerid, -1"You can only use this command every 3 minutes");
PLAYER[playerid][TIME] = gettime(); 
No, this function only detects that you can use that command every 3 minutes and I want it to be 90 seconds after I can not use that command ...


Re: Time - Shinja - 02.09.2018

Just change the time
PHP код:
if(gettime() < PLAYER[playerid][TIME] + 90) return SendClientMessage(playerid, -1"You can only use this command every 90 seconds");
PLAYER[playerid][TIME] = gettime();