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:minx, Float:miny, Float:maxx, Float:maxy, number = -1, Float:bordersize = GANGZONE_DEFAULT_BORDER_SIZE, Float:numbersize = GANGZONE_DEFAULT_NUMBER_SIZE);
GangZoneDestroy(gangzone);
GangZoneShowForPlayer(playerid, gangzone, color, bordercolor = GANGZONE_DEFAULT_BORDER_COLOR, numbercolor = GANGZONE_DEFAULT_NUMBER_COLOR);
GangZoneShowForAll(gangzone, color, bordercolor = GANGZONE_DEFAULT_BORDER_COLOR, numbercolor = GANGZONE_DEFAULT_NUMBER_COLOR);
GangZoneHideForPlayer(playerid, gangzone);
GangZoneHideForAll(gangzone);
GangZoneFlashForPlayer(playerid, gangzone, flashcolor, borderflashcolor = 0x00, numberflashcolor = 0x00);
GangZoneFlashForAll(gangzone, flashcolor, borderflashcolor = 0x00, numberflashcolor = 0x00);
GangZoneStopFlashForPlayer(playerid, gangzone, bool:mainzone = true, bool:border = true, bool:number = true);
GangZoneStopFlashForAll(gangzone, bool:mainzone = true, bool:border = true, bool: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.