SA-MP Forums Archive
[Include] Traffic Lights - controllable traffic lights - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Traffic Lights - controllable traffic lights (/showthread.php?tid=646429)



Traffic Lights - controllable traffic lights - RIDE2DAY - 17.12.2017

Traffic Lights v0.01


[*] Introduction
Hello guys, this is something I've been working during the past hours. I scripted this specially for my racing gamemode, to use it with the "Red Light" races. Would you like to know what a "Red Light" race is? Alright:
Quote:

Red Light races are one-on-one, point-to-point races starting at the nearest red light and ending at a point across town. After completing a Red Light race, players can choose to race back to the starting point.

[*] Video
Watch the video here.


[*] Download
Get it now from GitHub!

Currently only the YSI version is available, as I extracted this piece of code from my gamemode. Feel free to convert it to the ALS hooking method.


[*] Documentation
Here you have all the functions available, I think you don't need documentation for them at all since their names are clear enough.
Код:
CreateTrafficLight(type, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, init_color = TLC_GREEN)
SetTrafficLightColor(idx, color)
GetTrafficLightColor(idx)
DisableTrafficLight(idx)
RemoveTrafficLight(idx)
RemoveAllTrafficLights()
Colors available:You might define TL_USE_STREAMER before including this script if you wish to use dynamic objects, but keep in mind that Incognito's streamer requires YSF in order to make use of the attachable objects.


[*] Posts supported
These are all the posts supported currently, I hope I didn't miss any. All these custom objects are defined inside the include, maybe you want to check the SA-MP model ids used in order to avoid mixing them up with your own models.

TL_TYPE_1 (based on 1283)
TL_TYPE_2 (based on 1352)
TL_TYPE_3 (based on 3855)
TL_TYPE_4 (based on 1315)
TL_TYPE_5 (based on 3516)
TL_TYPE_6 (based on 1351)
TL_TYPE_7 (based on 1350)
TL_TYPE_8 (based on 1284)

[*] Bugs
Seems pedestrian traffic lights stopped working, I'm not really sure about why or how do they work. Probably the game handles them internally for specific model ids, I don't know. Feel free to collaborate if you think you can fix them.

On the other hand, I might say the same thing happend for posts type 3, 6 and 7; the upper light stopped working but I've added SA-MP light objects instead. You might check this on the video above, in my opinion the new light fits pretty well.


[*] Credits
Thanks to Southclaws and |stuntman| for some Discord productive conversations, to mschnitzer because I used his generator as script base for creating the amber light, and to prineside.com for providing the object images you can see above.


[*] Other
Thank you for reading my thread, if you want to support what I do you might buy me a coffe! Subscribe to my ******* channel if you wish to follow the development of my gamemode.

If you find any bug, please, let me know.

Best regards.


Re: Traffic Lights - controllable traffic lights - Dignity - 17.12.2017

Good job! I was hoping you’d release this.


Re: Traffic Lights - controllable traffic lights - RogueDrifter - 17.12.2017

great i'm gonna give this a go, well done r2d.


Re: Traffic Lights - controllable traffic lights - Eoussama - 17.12.2017

Just woke up pretty early, and this is the first thing I see today, amazing.


Re: Traffic Lights - controllable traffic lights - Whyd - 17.12.2017

The best script release at the moment for the 0.3.8, and there are still many ideas to do, it's great.


Re: Traffic Lights - controllable traffic lights - Xeon™ - 17.12.2017

well done! amazing.


Re: Traffic Lights - controllable traffic lights - cuber - 17.12.2017

Quote:
Originally Posted by Dignity
Посмотреть сообщение
Good job! I was hoping you’d release this.
Same.

OT: Well done.


Re: Traffic Lights - controllable traffic lights - Luis- - 17.12.2017

Pretty decent, some great potential with this.


Re: Traffic Lights - controllable traffic lights - adri1 - 17.12.2017

Good job, I will use!


Re: Traffic Lights - controllable traffic lights - IlanZ - 17.12.2017

Good job, great.


Re: Traffic Lights - controllable traffic lights - Chaprnks - 03.02.2018

This thread should be moved to the SA-MP DL releases section.


Re: Traffic Lights - controllable traffic lights - RIDE2DAY - 03.02.2018

Quote:
Originally Posted by Chaprnks
Посмотреть сообщение
This thread should be moved to the SA-MP DL releases section.
Thy will be done.


Re: Traffic Lights - controllable traffic lights - PepsiCola23 - 19.02.2018

this is unique and i like it,
i dont know how i didnt see this before.
good job !


Re: Traffic Lights - controllable traffic lights - N0FeaR - 21.02.2018

Great job i going to test this.


Re: Traffic Lights - controllable traffic lights - X337 - 21.02.2018

Cool, thank you.


Re: Traffic Lights - controllable traffic lights - Nizarh - 21.02.2018

Cool!