07.11.2017, 23:48
(
Последний раз редактировалось RIDE2DAY; 11.03.2019 в 02:52.
)
GZ Shapes v0.01
[*] Introduction
Hello, this is a little include I scripted some weeks ago in order to help a friend to create circles on the game's map, after messing around a little bit I came out with this. Circles are not as cool as those from GTA IV but you might accomplish some nice things with this, for example: zones for mini-missions, zones where something spawns randomly, etc.
[*] Screenshots
Circles | Empty Circles | Circumferences |
[*] Video
Here you can find a video.
[*] Download
Get it now from GitHub!
ALS and YSI versions available. If you don't know what YSI is, get the ALS version.
[*] Documentation
I must write the documentation, meanwhile here you have some info about the functions:
Код:
GZ_ShapeCreate(GZ_SHAPE_TYPES:type, Float:x, Float:y, Float:radius, squares = -1, Float:square_size = 5.0, Float:min_ang = 0.0, Float:max_ang = 360.0) type -> the shape's form (CIRCLE, EMPTY_CIRCLE, CIRCUMFERENCE). Float:x -> the X position of the shape's center. Float:y -> the Y position of the shape's center. Float:radius -> the radius of the shape. squares -> the amount of gang zones used for the shape (-1 for auto amount). Float:square_size -> represents how big are going to be the gang zones created for the circumference (5.0 looks smooth). min_angle -> represents the angle where the draw of the shape will start (by default 0.0). max_angle -> represents the angle where the draw of the shape will finish (by default 360.0). Returns: a gang zone shape ID or INVALID_GZ_SHAPE_ID.
Код:
GZ_ShapeDestroy(shapeid) GZ_ShapeDestroyAll() GZ_ShapeShowForPlayer(playerid, shapeid, color) GZ_ShapeHideForPlayer(playerid, shapeid) GZ_ShapeShowForAll(shapeid, color) GZ_ShapeHideForAll(shapeid) GZ_ShapeFlashForPlayer(playerid, shapeid, flashcolor) GZ_ShapeStopFlashForPlayer(playerid, shapeid) GZ_ShapeFlashForAll(shapeid, flashcolor) GZ_ShapeStopFlashForAll(shapeid)
I'm aware about the SA-MP limits, as you know gang zones cannot be streamed, so watch out! By default this include allows a max. of 10 shapes created at once (MAX_GZ_SHAPES). That doesn't mean you can create 10 huge circles with an automatic amount of squares, that would exceed the gang zones limit. A circle might use all the gang zones available if you wish (1024) but you won't be able to create more.
This include counts how many gang zones have been created with it and when the limit is reached it won't allow you to create new circles. But be careful, if you create simple gang zones on filterscripts or in your gamemode the include won't count them!
These notes might help you out when creating shapes:
- If you specify the amount of squares you want to use for a circumference and the radio is relatively large you'll get spaces between squares (dashed line).
- The min_angle and max_angle parameters allow you to create semicircumferences or other curves.
- If the square_size parameter is too high the circumference gets a "pixelated" effect, smaller values produce smoother drawings, 5.0 looks fine to me.
- If you want to create a circumference with a continuous draw line and you use a low value for the square_size parameter, it will require more gang zones, so you must increase the squares parameter.
Thank you for reading my thread, if you want to support what I do you might buy me a coffe! Join to my Discord server if you want to follow the development of my gamemode.
If you find any bug, please let me know.
Best regards.