In range for 5 sec
#1

Hello Internet,

I was trying to make some sort of a function, but i wasnt able to. I hope you guys can help me
What it must do:

Each 750 ms the function checks the distance from a player to a point.
The player has to try and stay in range of that point for 5 sec.
When he succeeds he gets a message for example.
but whenever the player leaves the range, the timer resets to 5 sec.

Thx for help,

MrCong
Reply
#2

You need to use Timer with function OnPlayerRangeOn i thing is function.I forgot but you need to use them to make your function.But if you need more help check http://wiki.sa-mp.com
Reply
#3

This is a job for Incognito's streamer and dynamic areas there is absolutely no need for using range checking here is what you do.

Create a area.
Player enters area set a timer
Player leaves area kill timer

It's really simple no need for checking if the player is still in the area, no need for a repeating timer, no need for range checking.

I built this include specifically for making features like this.

https://sampforum.blast.hk/showthread.php?tid=423622
Reply
#4

+1 Pottus

Areas are great! I use them for my dynamic gas station and dynamic toll system for my RP script.
Reply
#5

I agree RC whats the point of using range checking it's completely counter intuitive when dynamic areas handle all of the overhead effectively, efficiently and of course dynamically. However I should really update the sub-streamer to use a custom iterator even though I reckon the improvement would be marginal.
Reply
#6

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
I agree RC whats the point of using range checking it's completely counter intuitive when dynamic areas handle all of the overhead effectively, efficiently and of course dynamically. However I should really update the sub-streamer to use a custom iterator even though I reckon the improvement would be marginal.
Nearly everything in my script is dynamic. Why not make the areas, too?

If it wouldn't take long to update the sub-streamer, you might as well.
Reply
#7

Ya I'll probably do it up in the next week or so, it's probably best to have it function as fast as possible especially considering how useful it has been for me
Reply
#8

Why don't you use a simple checkpoint? Also Pottus, I really don't want to tear down your script but the Streamer plugin has had this functionality for a very long time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)