[Include] gangzones.inc - Add border and numbers to your gangzone
#1



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
Reply
#2

Great work
Reply
#3

i`ll use this,good job !
Reply
#4

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

goodjob man
Reply
#6

Great Work!
Reply
#7

Update v2.1:

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

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

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.
Reply
#10

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.
Reply
#11

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
Reply
#12

great!
Reply
#13

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)