Speed Cameras?
#1

Hello, I am wondering how I can make a Speed Camera so when a player passes it at a speed of say 120 MP/H the Camera will flash and show this "%s has been caught speeding at %d in a 70mp/h area"

If someone could make me a template I will be really great full.

Thank you, Regards Luis
Reply
#2

rough template:

Create a timer/area

In the timer func:
loop through players
check if they are in the area
get their speed with getcehiclevelocity
calculate the speed to mph/kmh (search the forum on what values you need)
if speed is greater: call OnPlayerExceedSpeedLimit or so

This all can be done well with an array for all areas and an enum in it, that stores the stuff like the are pos, speed limit, timer id,...
Reply
#3

I suck at timers but i'll try it out tomorrow
Reply
#4

You could give a try to Incognito's streamer plugin, it includes some area functions. They will save you a lot of work, and they are very efficient. Then, you would just need to do the speed checks, etc inside OnPlayerEnterArea.
Reply
#5

Quote:
Originally Posted by Zamaroht
Посмотреть сообщение
You could give a try to Incognito's streamer plugin, it includes some area functions. They will save you a lot of work, and they are very efficient. Then, you would just need to do the speed checks, etc inside OnPlayerEnterArea.
I just got the Plugin now I'ma try it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)