[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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)