[Include] Traffic signs (RP) (No custom objects)
#1

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
Reply
#2

#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
Reply
#3

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!
Reply
#4

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

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.
Reply
#6

nice, good job.
Reply
#7

Excelent job, never thought you was going to release it
Reply
#8

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;")
Reply
#9

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;
Reply
#10

Nice Job.
Reply
#11

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.
Reply
#12

will be using this thanks alot.
Reply
#13

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

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.
Reply
#15

Nice job
Reply
#16

Seeing nice.
Reply
#17

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 ?
Reply
#18

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
Reply
#19

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.
Reply
#20

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


Forum Jump:


Users browsing this thread: 1 Guest(s)