[Include] Traffic Lights - controllable traffic lights
#1

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:
  • TLC_GREEN
  • TLC_AMBER
  • TLC_RED
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.
Reply
#2

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

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

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

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

well done! amazing.
Reply
#7

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

OT: Well done.
Reply
#8

Pretty decent, some great potential with this.
Reply
#9

Good job, I will use!
Reply
#10

Good job, great.
Reply
#11

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

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

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

Great job i going to test this.
Reply
#15

Cool, thank you.
Reply
#16

Cool!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)