Posts: 3,934
Threads: 353
Joined: Jan 2010
Reputation:
0
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
Posts: 4,878
Threads: 85
Joined: Jun 2007
Reputation:
0
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,...
Posts: 3,934
Threads: 353
Joined: Jan 2010
Reputation:
0
I suck at timers but i'll try it out tomorrow
Posts: 900
Threads: 21
Joined: Jan 2007
Reputation:
0
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.