17.12.2017, 04:08
(
Последний раз редактировалось RIDE2DAY; 17.12.2017 в 15:22.
)
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. |
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()
- TLC_GREEN
- TLC_AMBER
- TLC_RED
[*] 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.