[Include] Advanced Gang Zones (Draw Numbers and Borders on the map)
#1

Advanced Gang Zones
Draw numbers and borders on the map.
Note: This is an updated version of my old project beaZone - GangZone Numbers & Borders [1.0]





Example how you can make it look like by tweaking some colors and font sizes (image from old NoV gang wars server)




What's new?
  • New: v2.2.1
  • Fixed number 0 and 1.
  • v2.2
  • Fixed number 7 top part.
  • Attempt to make numbers more sexy by tweaking some old settings and adding new ones.
  • ShowZoneForPlayer and ShowZoneForAll now have 2 more optional arguments which allow borders and numbers
    to be shown in different colors easily without editing the source code.
  • v2.1
  • New functions to make zone, numbers and borders flash.
  • New functions to hide zone for players.
  • Fixed minor bugs.

  • v2.0
  • New functions for more flexible approach.
  • Fixed borders collision.


Код:
CreateZone(Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
DestroyZone(zoneid)
ShowZoneForPlayer(playerid,zoneid,color,ncolor = ZCOLOR_NUMBER,bcolor = ZCOLOR_BORDER) // ncolor and bcolor are optional
ShowZoneForAll(zoneid,color,ncolor = ZCOLOR_NUMBER,bcolor = ZCOLOR_BORDER) // ncolor and bcolor are optional
CreateZoneNumber(zoneid,number,Float:numsize = 0.7) // numsize is optional
DestroyZoneNumber(zoneid)
CreateZoneBorders(zoneid)
DestroyZoneBorders(zoneid)

// Added in v2.1
HideZoneForPlayer(playerid,zoneid)
HideZoneForAll(zoneid)
ZoneFlashForPlayer(playerid,zoneid,color)
ZoneStopFlashForPlayer(playerid,zoneid)
ZoneFlashForAll(zoneid,color)
ZoneStopFlashForAll(zoneid)
ZoneBordersFlashForPlayer(playerid,zoneid,color)
ZoneBordersStopFlashForPlayer(playerid,zoneid)
ZoneBordersFlashForAll(zoneid,color)
ZoneBordersStopFlashForAll(zoneid)
ZoneNumberFlashForPlayer(playerid,zoneid,color)
ZoneNumberStopFlashForPlayer(playerid,zoneid)
ZoneNumberFlashForAll(zoneid,color)
ZoneNumberStopFlashForAll(zoneid)


Example Usage
Код:
new zone;

public OnGameModeInit()
{
    zone = CreateZone(1795.871093, 1264.255004, 2035.871093, 1472.255004);
    CreateZoneBorders(zone); 
    return 1;
}

public OnPlayerConnect(playerid)
{
    CreateZoneNumber(zone,playerid); // this will create player id number on a gangzone
    ShowZoneForPlayer(playerid,zone,0xFF000070);
    ZoneNumberFlashForPlayer(playerid,zoneid,0xFF00FF70); // starts to flash zone number for player
    return 1;
}

public OnPlayerDisconnect(playerid,reason)
{
    DestroyZoneNumber(zone);
    return 1;
}
Код:
// This code example is the first picture on the top of the page.
new zone,zone2,zone3,zone4;

public OnGameModeInit()
{
        // This will create 4 zones in Las Venturas.
	zone = CreateZone(1513.242919, 1299.813476, 1761.242919, 1587.813476);
	zone2 = CreateZone(1786.495727, 1447.214843, 2034.495727, 1711.214843);
	zone3 = CreateZone(1485.881958, 1591.029663, 1781.881958, 1911.029663);
	zone4 = CreateZone(1794.625854, 1727.273193, 2042.625854, 1951.273193);

	CreateZoneNumber(zone,16);
	CreateZoneNumber(zone2,89);
	CreateZoneNumber(zone3,32);
	CreateZoneNumber(zone4,54);

        CreateZoneBorders(zone);
	CreateZoneBorders(zone2);
	CreateZoneBorders(zone3);
	CreateZoneBorders(zone4);
	return 1;
}

public OnPlayerConnect(playerid)
{
        ShowZoneForPlayer(playerid,zone,0xd25e00AA,0xff0000aa,0xffe400aa);
	ShowZoneForPlayer(playerid,zone2,0xff5252AA,0xff0000aa,0xff00f0aa);
	ShowZoneForPlayer(playerid,zone3,0x686868aa,0xffffffaa,0xffffffaa);
	ShowZoneForPlayer(playerid,zone4,0x8a00ffaa,0x0090ffaa,0xffffffaa);
	return 1;
}

Links
Github Link




____________________________
Reply
#2

Looks alright, good release
Reply
#3

good +rep
Reply
#4

New version with missing functions that I forgot to add before:

v2.1
Код:
HideZoneForPlayer(playerid,zoneid)
HideZoneForAll(zoneid)
ZoneFlashForPlayer(playerid,zoneid,color)
ZoneStopFlashForPlayer(playerid,zoneid)
ZoneFlashForAll(zoneid,color)
ZoneStopFlashForAll(zoneid)
ZoneBordersFlashForPlayer(playerid,zoneid,color)
ZoneBordersStopFlashForPlayer(playerid,zoneid)
ZoneBordersFlashForAll(zoneid,color)
ZoneBordersStopFlashForAll(zoneid)
ZoneNumberFlashForPlayer(playerid,zoneid,color)
ZoneNumberStopFlashForPlayer(playerid,zoneid)
ZoneNumberFlashForAll(zoneid,color)
ZoneNumberStopFlashForAll(zoneid)
Reply
#5

nice nice!
Reply
#6

Awsome I was waiting for this. thanks I will try it soon
+rep for now
Reply
#7

I am definately releasing updates too fast...

v2.2
- Fixes number 7.
- Attempt to make numbers more sexy by tweaking some old settings and adding new ones.
- ShowZoneForPlayer and ShowZoneForAll now have 2 more optional arguments which allow borders and numbers
to be shown in different colors easily without editing the source code.

Код:
ShowZoneForPlayer(playerid,zoneid,color,ncolor = ZCOLOR_NUMBER,bcolor = ZCOLOR_BORDER)
ShowZoneForAll(zoneid,color,ncolor = ZCOLOR_NUMBER,bcolor = ZCOLOR_BORDER)
CreateZoneNumber(zoneid,number,Float:numsize = 0.7)// default numsize is now 0.7
Reply
#8

The numbers are dope! What if a zone is pretty tiny? Does it support 3 digit numbers?

+8 rep!
Reply
#9

3 digit numbers not yet,
if zone is very tiny, with CreateZoneNumber(zoneid,number,numsize) you can set numsize to something like 0.1 or even less and it should be fine I guess, haven't tested tho
Reply
#10

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
The numbers are dope! What if a zone is pretty tiny? Does it support 3 digit numbers?

+8 rep!
I tested it with a tiny zone like you said and it doesnt seem to be an issue because you can decide the size of the numbers!
Код:
CreateZoneNumber(zoneid,number,Float:numsize = 0.7)// default numsize is now 0.7
So it isn't a huge issue.


OT: Awesome release man!
Reply
#11

Alright, this should be the last one for a while...


v2.2.1
- Fixed number 0 and 1.
Reply
#12

Sorry for the bump but, is this even still working?
Reply
#13

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Sorry for the bump but, is this even still working?
Yes, working
Reply
#14

Can I have all your zones?
Reply
#15

The numbers are really messed up...any fixes please?
Reply
#16

Please send me all your zones
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)