Jump to content
  • 0

How do I add 20 seconds before I can send a message again in this code?


Question

Posted

How can I add 20 seconds before I can send a message again in this code?

-    script    map    -1,{

OnWhisperglobal:
if( getgroupid() < 5 ) end;
announce ""+strcharinfo(0)+": "+@whispervar0$,bc_map;

end;

}

-    script    global    -1,{

OnWhisperglobal:
if( getgroupid() < 5 ) end;
announce ""+strcharinfo(0)+": "+@whispervar0$,bc_all;

end;

}

 

2 answers to this question

Recommended Posts

  • 0
Posted
-    script    GLOBAL    -1,{
	OnWhisperglobal:
		if(getgroupid() < 5 || MESSAGE_COOLDOWN > gettimetick(2)) end;

		announce(strcharinfo(0) + ": " + @whispervar0$, bc_all);

		MESSAGE_COOLDOWN = gettimetick(2) + 20;
}

 

  • Love 1
  • 0
Posted
2 hours ago, Winterfox said:
-    script    GLOBAL    -1,{
	OnWhisperglobal:
		if(getgroupid() < 5 || MESSAGE_COOLDOWN > gettimetick(2)) end;

		announce(strcharinfo(0) + ": " + @whispervar0$, bc_all);

		MESSAGE_COOLDOWN = gettimetick(2) + 20;
}

 

Thanks guy, it's working.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...