#1

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?
Reply
#2

6 * 60 = 360.

90 = 90.

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

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

Код 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
Reply
#5

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.
Reply
#6

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

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 ...
Reply
#8

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(); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)