SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/11/2017, 11:48 PM   #1
RIDE2DAY
Huge Clucker
 
RIDE2DAY's Avatar
 
Join Date: Jul 2015
Location: Modena, Italy
Posts: 222
Reputation: 375
Default GZ Shapes - gang zone shapes on the map

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
Click here to watch this include in action!


[*] Download
Get it now from GitHub!

Currently you can download the ALS version only, I'll add a YSI one soon. If you don't know what YSI is, just ignore this comment.


[*] Documentation
I must write the documentation, meanwhile here you have some info about the functions:
Code:
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.
NOTE: the EMPTY_CIRCLE shape doesn't support min_ang/max_ang, just leave the default values.

The remaining functions are similar to the default gang zones functions and can be used with any shape form:
Code:
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:
  • 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.

[*] Other
Thank you for reading my thread, if you want to support what I do you might buy me a coffe! Subscribe to my ******* 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:17 PM.
RIDE2DAY is offline   Reply With Quote
Old 08/11/2017, 12:58 AM   #2
RogerCosta
Huge Clucker
 
RogerCosta's Avatar
 
Join Date: Aug 2014
Location: Santos, Brazil.
Posts: 326
Reputation: 91
Default Re: GZ Circles - gang zones circles on the map

Very nice!

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

RogerCosta is offline   Reply With Quote
Old 08/11/2017, 10:14 AM   #3
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 269
Reputation: 63
Default Re: GZ Circles - gang zones circles on the map

Quote:
Originally Posted by RogerCosta View Post
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?
JustMe.77 is offline   Reply With Quote
Old 08/11/2017, 02:33 PM   #4
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Location: KS.
Posts: 775
Reputation: 137
Default Re: GZ Circles - gang zones circles on the map

Looks good. I was about to make a comment about PUBG too but PatrickGTR already made that lol.
cuber is offline   Reply With Quote
Old 08/11/2017, 02:35 PM   #5
Zeth
Huge Clucker
 
Zeth's Avatar
 
Join Date: Feb 2017
Location: India
Posts: 480
Reputation: 90
Default Re: GZ Circles - gang zones circles on the map

Nice release!
__________________
Zeth is offline   Reply With Quote
Old 08/11/2017, 02:44 PM   #6
Escobabe
Banned
 
Join Date: Apr 2017
Location: Valhalla
Posts: 290
Reputation: 70
Default Re: GZ Circles - gang zones circles on the map

Waiting for PUBG servers.
Escobabe is offline   Reply With Quote
Old 08/11/2017, 02:47 PM   #7
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Location: KS.
Posts: 775
Reputation: 137
Default Re: GZ Circles - gang zones circles on the map

Quote:
Originally Posted by Escobabe View Post
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.
cuber is offline   Reply With Quote
Old 08/11/2017, 03:38 PM   #8
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 269
Reputation: 63
Default Re: GZ Circles - gang zones circles on the map

Quote:
Originally Posted by cuber View Post
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?
JustMe.77 is offline   Reply With Quote
Old 08/11/2017, 04:06 PM   #9
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Location: KS.
Posts: 775
Reputation: 137
Default Re: GZ Circles - gang zones circles on the map

Quote:
Originally Posted by JustMe.77 View Post
Would you be so kind and send me the IP via pm?
Sure.
cuber is offline   Reply With Quote
Old 08/11/2017, 04:26 PM   #10
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,899
Reputation: 3126
Default Re: GZ Circles - gang zones circles on the map

Nice. But:

Quote:
Originally Posted by RIDE2DAY View Post
Currently you can download the ALS version only, I'll add a YSI one soon. If you don't know what YSI is, just ignore this comment.
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.
Y_Less 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
How to make a gang zone. No zone wars and capture MarkNelson Scripting Help 2 08/07/2016 03:46 AM
Objects shapes, forms, sizes ScIrUsna Scripting Help 1 20/05/2016 10:38 AM
[AJUDA]Gang Zone DOminaveis ( o meu possui /gang criar) rene20 PortuguÍs/Portuguese 2 22/09/2010 05:55 PM
Textdraws with certain shapes? FreeSoul Help Archive 2 22/12/2009 04:19 PM


All times are GMT. The time now is 11:30 PM.


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