SA-MP Forums Archive
[Include] Traffic signs (RP) (No custom objects) - 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 signs (RP) (No custom objects) (/showthread.php?tid=493325)

Pages: 1 2


Traffic signs (RP) (No custom objects) - adri1 - 08.02.2014

Features
- Unlimited signs *
- 23 traffic signs
- Ideal for RP server
- There aren't custom objects, ie, all players in the server can see them.

* MAX_SIGNS = 500 (can be changed)


Functions
pawn Code:
CreateTrafficSign(signid, Float:x, Float:y, Float:z, Float:rz, Float:viewdistance = 200.0, string[] = "")

signid - Sign id
Float:x - Position X
Float:y - Position Y
Float:z - Position Z
Float:rz - Angle
Float:viewdistance - The draw distance signal
string[] - Served for some particular signals. (maximum speed, minimum speed and maximum tons)

returns the ID of the signal (to be destroyed later)
pawn Code:
DestroyTrafficSign(signid)

signid - The signal (the ID, not the type of signal)
pawn Code:
IsValidTrafficSign(signid)

signid - The signal (the ID, not the type of signal)

Signs
Code:
#define SIGN_STOP   		0
#define SIGN_YIELD  		1
#define SIGN_PROHIBITED   	2
#define SIGN_PROHIBITED2    3
#define SIGN_CROSSWALK    	4
#define SIGN_MAXVELOCITY    5
#define SIGN_MINVELOCITY    6
#define SIGN_MAXTONNE	    7
#define SIGN_WALKERONLY     8
#define SIGN_BIKEONLY       9
#define SIGN_BIKEPROHIBITED 10
#define SIGN_PROHIBITEDDIR1 11
#define SIGN_PROHIBITEDDIR2 12
#define SIGN_PROHIBITEDDIR3 13
#define SIGN_PROHIBITEDDIR4 14
#define SIGN_GODIR1 		15
#define SIGN_GODIR2 		16
#define SIGN_GODIR3 		17
#define SIGN_GODIR4 		18
#define SIGN_TAXI	 		19
#define SIGN_BUS	 		20
#define SIGN_PARKING1 		21
#define SIGN_PARKING2 		22



Credits
adri1
Incognito (streamer)

Download
Streamer


Re: Traffic signs (RP) (No custom objects) - [FSaF]Jarno - 08.02.2014

#if defined _trafficlights_included
#endinput
#endif
#define _trafficlights_included

to the top of this script to prevent double-including. Also, to get around the fact that you have to add #include <streamer> before this include, you can put this to the top of the script:

#if !defined STREAMER_TYPE_OBJECT
#include <streamer>
#endif

Looks awesome, by the way. Might even use it, even tho i don't have a RolePlay server :3


Re: Traffic signs (RP) (No custom objects) - Sublime - 08.02.2014

Quote:
Originally Posted by [FSaF]Jarno
View Post
-snip-

Also, to get around the fact that you have to add #include <streamer> before this include, you can put this to the top of the script:

#if !defined STREAMER_TYPE_OBJECT
#include <streamer>
#endif
Um.. wouldn't that be a logical mistake? Most (if not, all) scripters use #include <streamer> before the custom include in their main script. So, eg I created this include. I added your suggestion, but wups I forgot to notify the players.. From the user's side, I (as the user who downloaded the include) included streamer again (without any knowledge on the include) before the custom include and script shows bonkers!


Re: Traffic signs (RP) (No custom objects) - Misiur - 08.02.2014

@[FSaF]Jarno - default pawn compiler has built-in include guards. Though, for Zeex compiler users that'd be nice.


Re: Traffic signs (RP) (No custom objects) - [FSaF]Jarno - 08.02.2014

Quote:
Originally Posted by Sublime
View Post
Um.. wouldn't that be a logical mistake? Most (if not, all) scripters use #include <streamer> before the custom include in their main script. So, eg I created this include. I added your suggestion, but wups I forgot to notify the players.. From the user's side, I (as the user who downloaded the include) included streamer again (without any knowledge on the include) before the custom include and script shows bonkers!
That's what the "#if !defined STREAMER_TYPE_OBJECT" does! It checks if "STREAMER_TYPE_OBJECT" has been defined, in other words, if streamer has already been included (streamer.inc defines this definition). If it HASN'T been defined (!defined), the include will include it automatically. It's just good practise and nothing too too important.


Respuesta: Traffic signs (RP) (No custom objects) - OTACON - 08.02.2014

nice, good job.


Respuesta: Traffic signs (RP) (No custom objects) - MillerUTL - 08.02.2014

Excelent job, never thought you was going to release it


Re: Traffic signs (RP) (No custom objects) - Michael@Belgium - 09.02.2014

Good work, although you have
pawn Code:
SignCounter++;
return SignCounter;
... in every case. I think it would save some typing if you just put "SignCounter++;" before the "switch(signid)" and "return SignCounter;" on the bottom of the stock. (I stead of "return -1;")


Respuesta: Re: Traffic signs (RP) (No custom objects) - adri1 - 09.02.2014

Quote:
Originally Posted by Michael@Belgium
View Post
Good work, although you have
pawn Code:
SignCounter++;
return SignCounter;
... in every case. I think it would save some typing if you just put "SignCounter++;" before the "switch(signid)" and "return SignCounter;" on the bottom of the stock. (I stead of "return -1;")
pawn Code:
SignCounter++;
                        TrafficSign[SignCounter][M1] = trafficsign_id;
                        TrafficSign[SignCounter][M2] = trafficsign_id+1;
                        TrafficSign[SignCounter][M3] = trafficsign_id+2;
                        return SignCounter;



Re: Traffic signs (RP) (No custom objects) - PT - 09.02.2014

Nice Job.


Re: Traffic signs (RP) (No custom objects) - Abagail - 09.02.2014

Wow.... One of the best includes I've ever seen for roleplay, and for that you have gotten one REP from me. Keep up the good work mate.


Re: Traffic signs (RP) (No custom objects) - Yves - 10.02.2014

will be using this thanks alot.


Re: Traffic signs (RP) (No custom objects) - Scenario - 10.02.2014

Nice job so far. You should expand and make the system dynamic so administrators can add/remove/edit the traffic signs while in-game.


Re: Traffic signs (RP) (No custom objects) - Ballu Miaa - 10.02.2014

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Nice job so far. You should expand and make the system dynamic so administrators can add/remove/edit the traffic signs while in-game.
Yup! Thats not that hard and even very useful. I like the signs man! Useful include. Thanks.


Re: Traffic signs (RP) (No custom objects) - Kirollos - 10.02.2014

Nice job


Re: Traffic signs (RP) (No custom objects) - DerickClark - 10.02.2014

Seeing nice.


Re: Respuesta: Re: Traffic signs (RP) (No custom objects) - Michael@Belgium - 10.02.2014

Quote:
Originally Posted by adri1
View Post
pawn Code:
SignCounter++;
                        TrafficSign[SignCounter][M1] = trafficsign_id;
                        TrafficSign[SignCounter][M2] = trafficsign_id+1;
                        TrafficSign[SignCounter][M3] = trafficsign_id+2;
                        return SignCounter;
I know Adri - Signcounter doesn't depend on each case right ?


Re: Traffic signs (RP) (No custom objects) - seanny - 11.02.2014

Nice include, but is it possible to make a version with american signs?

Maybe checkout here if you need a reference? http://apps.dmv.ca.gov/pubs/hdbk/ped_sig_traf_sgns.htm


Re: Traffic signs (RP) (No custom objects) - wups - 16.02.2014

A little logical mistake with destroying signs:
Say you create 2 signs(#1 and #2), thus SignCounter = 2.
then you decide to destroy sign #1; SignCounter becomes 1.
Then if you add another sign(#3), SignCounter becomes 2 again, but the array slot is already used by #2.

Also, the arrow signs show a weird hand symbol and I'm pretty sure I don't have any mods.


Re: Traffic signs (RP) (No custom objects) - dimitri8 - 24.02.2014

Well, how should I install and use it I didnt get it?