SA-MP Forums Archive
[Include] GZ Shapes - gang zone shapes on the map - 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] GZ Shapes - gang zone shapes on the map (/showthread.php?tid=644449)

Pages: 1 2


GZ Shapes - gang zone shapes on the map - RIDE2DAY - 07.11.2017

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.
The remaining functions are similar to the default gang zones functions and can be used with any shape form:
Код:
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)
[*] Limits
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: [*] Other
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.


Re: GZ Circles - gang zones circles on the map - RogerCosta - 08.11.2017

Very nice!

I put gz circles in my future pubg gamemode, too.




Re: GZ Circles - gang zones circles on the map - JustMe.77 - 08.11.2017

Quote:
Originally Posted by RogerCosta
Посмотреть сообщение
Very nice!

I put gz circles in my future pubg gamemode, too.

Nice include. Can you show me the code how you made everything red except the area in the circle?


Re: GZ Circles - gang zones circles on the map - cuber - 08.11.2017

Looks good. I was about to make a comment about PUBG too but PatrickGTR already made that lol.


Re: GZ Circles - gang zones circles on the map - Zeth - 08.11.2017

Nice release!


Re: GZ Circles - gang zones circles on the map - Escobabe - 08.11.2017

Waiting for PUBG servers.


Re: GZ Circles - gang zones circles on the map - cuber - 08.11.2017

Quote:
Originally Posted by Escobabe
Посмотреть сообщение
Waiting for PUBG servers.
There is a PUBG server named "San Andreas Battlegrounds" already, but it's in the Russian language. It's pretty easy to manage to get in-game though.


Re: GZ Circles - gang zones circles on the map - JustMe.77 - 08.11.2017

Quote:
Originally Posted by cuber
Посмотреть сообщение
There is a PUBG server named "San Andreas Battlegrounds" already, but it's in the Russian language. It's pretty easy to manage to get in-game though.
Would you be so kind and send me the IP via pm?


Re: GZ Circles - gang zones circles on the map - cuber - 08.11.2017

Quote:
Originally Posted by JustMe.77
Посмотреть сообщение
Would you be so kind and send me the IP via pm?
Sure.


Re: GZ Circles - gang zones circles on the map - RIDE2DAY - 08.11.2017

Quote:
Originally Posted by ******
Посмотреть сообщение
Nice. But:



Why? I assume by this you mean y_hooks, which is only one part of YSI. However, y_hooks code is entirely compatible with ALS, so if you already have an ALS version there is no need at all for a y_hooks version - even YSI uses a combination of both internally (though most of those ALS hooks are ensuring y_hooks works).

The point of y_hooks is to write less code than ALS (it's also faster). If you've already gone to the trouble of writing all the ALS boilerplate, there's no point using y_hooks. You will end up writing more code to use y_hooks than you would if you just stuck with the single long version.
Yes, y_hooks is one of the reasons, but I'd like just to add iterators to iter throught all the gang zones a shape has, when showing/hiding/destroying them. I guess this way I don't have to check valid (or not) array cells.


Re: GZ Circles - gang zones circles on the map - StrikerZ - 09.11.2017

nice


Re: GZ Circles - gang zones circles on the map - IlanZ - 09.11.2017

Very cool.


Re: GZ Circles - gang zones circles on the map - ohmy - 13.12.2017

Quote:
Originally Posted by RogerCosta
Посмотреть сообщение
Very nice!

I put gz circles in my future pubg gamemode, too.

Can you tell me how to make everything red except in the middle?


Re: GZ Circles - gang zones circles on the map - chneubeul - 13.12.2017

Awesome ! nice works guys !


Re: GZ Circles - gang zones circles on the map - UserUnk0wn - 15.12.2017

Nice bro, thanks

+REP


Re: GZ Circles - gang zones circles on the map - Kaperstone - 16.12.2017

Quote:
Originally Posted by ohmy
Посмотреть сообщение
Can you tell me how to make everything red except in the middle?
There is a picture and a function right under it.

For this you'll need EMPTY_CIRCLE as the first parameter
Код:
GZ_ShapeCreate(EMPTY_CIRCLE, Float:x, Float:y, Float:radius, squares = -1, Float:square_size = 5.0, Float:min_ang = 0.0, Float:max_ang = 360.0)



Re: GZ Shapes - gang zone shapes on the map - JaKe Elite - 19.05.2018

Is there any possible way to detect if the player is outside those zones or detecting them if they are inside those?


Re: GZ Shapes - gang zone shapes on the map - CodeStyle175 - 19.05.2018

yes you take center point of this circle and if player distance is bigger then circle radius, player is out of circle and when same or smaller then inside circle.


Re: GZ Shapes - gang zone shapes on the map - Logic_ - 19.05.2018

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
Is there any possible way to detect if the player is outside those zones or detecting them if they are inside those?
Yes.

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
yes you take center point of this circle and if player distance is bigger then circle radius, player is out of circle and when same or smaller then inside circle.
That's not the greatest idea when you can use Streamer.


Re: GZ Shapes - gang zone shapes on the map - JaKe Elite - 19.05.2018

Alright, I have created a gang-shape zone for safe zone (Circumferences Type), a gang-shape zone for radiation (empty circle type) and a safe zone (Dyanmic Circle created by Streamer to detect if player is inside/outside the safe zone).

Now how do I detect if the player is inside/outside the radiation?