SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 17/12/2017, 04:08 AM   #1
RIDE2DAY
Huge Clucker
 
RIDE2DAY's Avatar
 
Join Date: Jul 2015
Location: Modena, Italy
Posts: 212
Reputation: 381
Default Traffic Lights - controllable traffic lights

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.
Code:
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 YouTube channel if you wish to follow the development of my gamemode.

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

Best regards.

Last edited by RIDE2DAY; 17/12/2017 at 03:22 PM.
RIDE2DAY is offline   Reply With Quote
Old 17/12/2017, 04:12 AM   #2
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,661
Reputation: 1211
Default Re: Traffic Lights - controllable traffic lights

Good job! I was hoping you’d release this.
Dignity is offline   Reply With Quote
Old 17/12/2017, 04:19 AM   #3
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,192
Reputation: 420
Default Re: Traffic Lights - controllable traffic lights

great i'm gonna give this a go, well done r2d.
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 17/12/2017, 05:00 AM   #4
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,076
Reputation: 283
Default Re: Traffic Lights - controllable traffic lights

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

|===[Web taxi]===|
List of my work
Github
Pastebin

|===[Interesting topics]===|
Semantic Versioning
Eoussama is offline   Reply With Quote
Old 17/12/2017, 11:20 AM   #5
Whyd
Huge Clucker
 
Whyd's Avatar
 
Join Date: Sep 2012
Location: /
Posts: 415
Reputation: 30
Default Re: Traffic Lights - controllable traffic lights

The best script release at the moment for the 0.3.8, and there are still many ideas to do, it's great.
Whyd is offline   Reply With Quote
Old 17/12/2017, 11:27 AM   #6
Xeon™
Banned
 
Join Date: Jul 2017
Location: Earth
Posts: 457
Reputation: 96
Default Re: Traffic Lights - controllable traffic lights

well done! amazing.
Xeon™ is offline   Reply With Quote
Old 17/12/2017, 11:40 AM   #7
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 849
Reputation: 213
Default Re: Traffic Lights - controllable traffic lights

Quote:
Originally Posted by Dignity View Post
Good job! I was hoping you’d release this.
Same.

OT: Well done.
__________________


A new Heavy Roleplay server.

Forums | Discord

cuber is offline   Reply With Quote
Old 17/12/2017, 11:55 AM   #8
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 3,933
Reputation: 420
Default Re: Traffic Lights - controllable traffic lights

Pretty decent, some great potential with this.
__________________
Luis- is online now   Reply With Quote
Old 17/12/2017, 12:25 PM   #9
adri1
Banned
 
Join Date: Oct 2010
Posts: 1,779
Reputation: 965
Default Re: Traffic Lights - controllable traffic lights

Good job, I will use!
adri1 is offline   Reply With Quote
Old 17/12/2017, 05:54 PM   #10
IlanZ
High-roller
 
Join Date: Jul 2016
Location: Brasil
Posts: 1,348
Reputation: 75
Default Re: Traffic Lights - controllable traffic lights

Good job, great.
IlanZ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
About Traffic Lights BobbMarley Scripting Help 1 23/10/2016 10:32 PM
Scripting - Traffic Lights. Visualbr Help Archive 8 29/05/2010 12:57 AM
traffic lights smuf_albert95 Help Archive 2 11/01/2010 07:21 PM
Traffic Lights Jbosh123 Help Archive 11 21/10/2009 12:09 PM


All times are GMT. The time now is 11:18 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.