Radiation System
#1

So. I want to make a radiation system where if the player is in a certain area for 15 seconds he will lose health in that amount of time, and when he exits he is okay, any ideas how to do this?
Reply
#2

Make it with:
pawn Код:
IsPlayerInRangeOfPoint
Then make a timer so it will drain like 10hp every 10 seconds or so.

Good luck.
Reply
#3

Quote:
Originally Posted by arjanforgames
Посмотреть сообщение
Make it with:
pawn Код:
IsPlayerInRangeOfPoint
Then make a timer so it will drain like 10hp every 10 seconds or so.

Good luck.
No, just no.

Use the area natives that come with Incognito's streamer plugin/include. You can check using "OnPlayerEnterDynamicArea" if they entered that specific area and THEN you can use a repeating timer (every 10000ms (or 10 seconds)) to deplete their health. Then you can use "OnPlayerLeaveDynamicArea" to stop the timer.

Using the method that arjanforgames mentioned above would require you running a repeating timer every 1 second or something (maybe even less to make it accurate)- which is extremely inefficient.
Reply
#4

RealCop228 is totally right.
I forgot about the DynamicArea. My fault!

So don't use IsPlayerInRangeOfPoint.
Reply
#5

IsPlayerInRangeOfPoint() is constantly used where it doesn't have to be used the best option almost always is dynamic areas. It's exactly the same concept as comparing dcmd to zcmd as well as the same persistence for people to use inferior methods.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)