Ham_Touch spam issue
im new to scripting
i have a simple code that prints a message when you're touching player. problem is its spamming the message like crazy when touching. how can i get it to print only one message and not lag the server? code: PHP Code:
|
Re: Ham_Touch spam issue
Of course it will be spaming. You are touching the player all the time. Add a simple timer and send the message only if X seconds have passed since the last message.
|
Re: Ham_Touch spam issue
Quote:
|
Re: Ham_Touch spam issue
Then search. There are approximately 644628 examples of how to do it out there.
|
Re: Ham_Touch spam issue
like that:
PHP Code:
|
Re: Ham_Touch spam issue
Quote:
PHP Code:
|
Re: Ham_Touch spam issue
@Craxor what is the purpose of using rounded time? Rounded time in your code gives not 10 secs, but from 9.5 to 10.5 secs.
So: PHP Code:
|
Re: Ham_Touch spam issue
Instead of putting a timer on the touch, you can track the last player that was touched and not register a touch again until a different player is touched.
1 touches 2 [touch fires] 1 touches 2 [nothing happens] 1 touches 2 [nothing happens] 1 touches 4 [touch fires] 1 touches 4 [nothing happens] 1 touches 2 [touch fires] PHP Code:
|
Re: Ham_Touch spam issue
@Bugsy:
1 touch 2 1 stop touching 2 1 touch 2 again |
Re: Ham_Touch spam issue
Prostet. i don't understand what are you saying, is working as is supposed to work..
|
All times are GMT -4. The time now is 01:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.