SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/02/2018, 03:25 AM   #1
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,816
Reputation: 831
Default gangzones.inc - Add border and numbers to your gangzone



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 Code:
/*
** 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 Code:
#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
__________________

My GitHub:


Last edited by Gammix; 29/04/2018 at 12:51 AM.
Gammix is offline   Reply With Quote
Old 05/02/2018, 06:32 AM   #2
DonaldDuck
Banned
 
Join Date: Jun 2017
Location: Phillipines
Posts: 361
Reputation: 91
Default Re: gangzones.inc - Add border and numbers to your gangzone

Great work
DonaldDuck is offline   Reply With Quote
Old 05/02/2018, 11:01 AM   #3
PepsiCola23
Gangsta
 
Join Date: May 2015
Posts: 681
Reputation: 3
Default Re: gangzones.inc - Add border and numbers to your gangzone

i`ll use this,good job !
PepsiCola23 is offline   Reply With Quote
Old 05/02/2018, 05:09 PM   #4
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,174
Reputation: 353
Default Re: gangzones.inc - Add border and numbers to your gangzone

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

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link


RogueDrifter is offline   Reply With Quote
Old 05/02/2018, 06:01 PM   #5
rfr
Banned
 
Join Date: Nov 2017
Posts: 278
Reputation: 43
Default Re: gangzones.inc - Add border and numbers to your gangzone

goodjob man
rfr is offline   Reply With Quote
Old 05/02/2018, 06:15 PM   #6
HeroDR22
Little Clucker
 
HeroDR22's Avatar
 
Join Date: Jan 2018
Posts: 37
Reputation: 19
Default Re: gangzones.inc - Add border and numbers to your gangzone

Great Work!
__________________
REP ME AND I WILL REP YOU
HeroDR22 is offline   Reply With Quote
Old 07/02/2018, 09:02 PM   #7
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,816
Reputation: 831
Default Re: gangzones.inc - Add border and numbers to your gangzone

Update v2.1:

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

My GitHub:

Gammix is offline   Reply With Quote
Old 09/02/2018, 06:53 PM   #8
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 87
Reputation: 0
Default Re: gangzones.inc - Add border and numbers to your gangzone

Gonna use it, ur a kind of masterpiece of scripting in samp
StRaphael is offline   Reply With Quote
Old 05/03/2018, 01:49 PM   #9
kingmk
Big Clucker
 
kingmk's Avatar
 
Join Date: Sep 2014
Location: Romania
Posts: 104
Reputation: 22
Default Re: gangzones.inc - Add border and numbers to your gangzone

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.
__________________
Follow me on YouTube:
Click
If u need help don't hesitate to PM me.
X-BURN COMMUNITY


Last edited by kingmk; 05/03/2018 at 06:48 PM.
kingmk is offline   Reply With Quote
Old 28/04/2018, 10:32 PM   #10
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,816
Reputation: 831
Default Re: gangzones.inc - Add border and numbers to your gangzone

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

My GitHub:

Gammix 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
Only border - gangzone Chipardeur Scripting Help 3 15/10/2017 10:28 AM
[Include] [UNIQUE]beaZone - GangZone Numbers & Borders [1.0] beaz Includes 30 20/03/2014 11:19 AM
Convert string with numbers into numbers only? The_Moddler Help Archive 6 17/10/2010 10:20 AM
Storing Player Numbers In MYSQL Without Two Numbers Being The Same Kenny990 Help Archive 3 29/06/2009 03:10 AM


All times are GMT. The time now is 06:04 PM.


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