SA-MP Forums Archive
[Include] gangzones.inc - Add border and numbers to your gangzone - 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] gangzones.inc - Add border and numbers to your gangzone (/showthread.php?tid=649230)



gangzones.inc - Add border and numbers to your gangzone - Gammix - 05.02.2018



Just include this and your gangzones will have numbers and borders to them automatically. You don't need to touch/change anything in your script.

Though, you can modify and do stuff with gangzones, borders and numbers separately.

Credits to beijind for the gangzone number making algorithm, thread link.
His include is a bit untidy and bad, and the main thing is, this library auto converts gangzones to new ones!


Functions:
PHP код:
/*
** HOOKED FUNCTIONS
*/
GangZoneCreate(Float:minxFloat:minyFloat:maxxFloat:maxynumber = -1Float:bordersize GANGZONE_DEFAULT_BORDER_SIZEFloat:numbersize GANGZONE_DEFAULT_NUMBER_SIZE);
GangZoneDestroy(gangzone);
GangZoneShowForPlayer(playeridgangzonecolorbordercolor GANGZONE_DEFAULT_BORDER_COLORnumbercolor GANGZONE_DEFAULT_NUMBER_COLOR);
GangZoneShowForAll(gangzonecolorbordercolor GANGZONE_DEFAULT_BORDER_COLORnumbercolor GANGZONE_DEFAULT_NUMBER_COLOR);
GangZoneHideForPlayer(playeridgangzone);
GangZoneHideForAll(gangzone);
GangZoneFlashForPlayer(playeridgangzoneflashcolorborderflashcolor 0x00numberflashcolor 0x00);
GangZoneFlashForAll(gangzoneflashcolorborderflashcolor 0x00numberflashcolor 0x00);
GangZoneStopFlashForPlayer(playeridgangzonebool:mainzone truebool:border truebool:number true);
GangZoneStopFlashForAll(gangzonebool:mainzone truebool:border truebool:number true
If you are using low level functions to just create borders/numbers, you cannot use "GangZoneDestroy" on them because its hooked with the system. But i made a simple OLD_GangZoneDestroy native, which is default SAMP's native, just use it!

Macros:
You can pre-define these before inclusion with your own values.
PHP код:
#define GANGZONE_DEFAULT_BORDER_SIZE 2.0 // default thickness of borders
#define GANGZONE_DEFAULT_NUMBER_SIZE 1.0 // default thickness of numbers
#define GANGZONE_DEFAULT_BORDER_COLOR 0xAA // default color of borders (applied when using GangZoneShowFor(Player/All) function
#define GANGZONE_DEFAULT_NUMBER_COLOR 0xAA // default color of numbers (applied when using GangZoneShowFor(Player/All) function 
Download:
https://github.com/Agneese-Saini/SA-.../gangzones.inc


Re: gangzones.inc - Add border and numbers to your gangzone - DonaldDuck - 05.02.2018

Great work


Re: gangzones.inc - Add border and numbers to your gangzone - PepsiCola23 - 05.02.2018

i`ll use this,good job !


Re: gangzones.inc - Add border and numbers to your gangzone - RogueDrifter - 05.02.2018

I like how you updated that cuz the old one was kinda confusing and had weird things but good job!


Re: gangzones.inc - Add border and numbers to your gangzone - rfr - 05.02.2018

goodjob man


Re: gangzones.inc - Add border and numbers to your gangzone - HeroDR22 - 05.02.2018

Great Work!


Re: gangzones.inc - Add border and numbers to your gangzone - Gammix - 07.02.2018

Update v2.1:

- Fix: I forgot to add "numbersize" check in "GangZoneCreate".


Re: gangzones.inc - Add border and numbers to your gangzone - StRaphael - 09.02.2018

Gonna use it, ur a kind of masterpiece of scripting in samp


Re: gangzones.inc - Add border and numbers to your gangzone - kingmk - 05.03.2018

I think i found a bug.
The gang zone will show up with GangZoneShowForPlayer(), but won't get the color i want, it will take the default color. This it's happends just for the first GangZoneCreate() created.

Edit: nvm, i fixed it myself.


Re: gangzones.inc - Add border and numbers to your gangzone - Gammix - 28.04.2018

Update v2.2:

- Some minor tweaks/changes to GangZoneCreate. I also tested it for the bug reported in previous post, and so far its working, i am not sure if the bug was there in source code in first place. But anyways give this a try and let me know if it's still persists.


Re: gangzones.inc - Add border and numbers to your gangzone - Kar - 16.05.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Update v2.2:

- Some minor tweaks/changes to GangZoneCreate. I also tested it for the bug reported in previous post, and so far its working, i am not sure if the bug was there in source code in first place. But anyways give this a try and let me know if it's still persists.
Here's a little improvement to initialising the data and tabbing fixes and other little details. If u want it.

https://www.diffchecker.com/Rz1MRdZO


Re: gangzones.inc - Add border and numbers to your gangzone - oghabanjb - 22.06.2018

great!


Re: gangzones.inc - Add border and numbers to your gangzone - kingmk - 07.09.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Update v2.2:

- Some minor tweaks/changes to GangZoneCreate. I also tested it for the bug reported in previous post, and so far its working, i am not sure if the bug was there in source code in first place. But anyways give this a try and let me know if it's still persists.
I tested it and now it's work perfect. Sorry for the late response.