[Include] dzones.inc - Dynamic Zones
#1

MOVED TO GITHUB
Github

Description
* This include contains functions to manage gang zones,
* Also contains two callbacks to check when a player enters
* or leaves a zone.

Native list
pawn Код:
native GetDynamicZoneArea(zoneid, &Float:minx, &Float:miny, &Float:maxx, &Float:maxy);
native SetDynamicZoneArea(zoneid, Float:minx, Float:miny, Float:maxx, Float:maxy);
native CreateDynamicZone(Float:minx, Float:miny, Float:maxx, Float:maxy, color);
native FlashDynamicZoneForPlayer(playerid, zoneid, color);
native IsDynamicZoneFlashingForPlayer(playerid, zoneid);
native IsDynamicZoneVisibleForPlayer(playerid, zoneid);
native StopFlashDynamicZoneForPlayer(playerid, zoneid);
native ShowDynamicZoneForPlayer(playerid, zoneid);
native HideDynamicZoneForPlayer(playerid, zoneid);
native IsPlayerInDynamicZone(playerid, zoneid);
native FlashDynamicZoneForAll(zoneid, color);
native SetDynamicZoneColor(zoneid, color);
native StopFlashDynamicZoneForAll(zoneid);
native ShowDynamicZoneForAll(zoneid);
native HideDynamicZoneForAll(zoneid);
native GetDynamicZoneColor(zoneid);
native DestroyDynamicZone(zoneid);
native zexist(zoneid);
Current Version
* 1.0

Functions info
NameFunctionParams
StopFlashDynamicZoneForPlayerStops a zone of flashing for a player.(playerid, zoneid)
IsDynamicZoneFlashingForPlayerChecks if a zone is flashing for a player.(playerid, zoneid)
IsDynamicZoneVisibleForPlayerChecks if a zone is visible for a player.(playerid, zoneid)
StopFlashDynamicZoneForAllStops a zone of flashing for all.(zoneid)
ShowDynamicZoneForPlayerShow a zone for a player.(playerid, zoneid)
FlashDynamicZoneForPlayerFlashes a zone for a player.(playerid, zoneid)
HideDynamicZoneForPlayerHides a zone for a player.(playerid, zoneid)
ShowDynamicZoneForAllFlashes a zone for all.(zoneid)
FlashDynamicZoneForAllFlashes a zone for all.(zoneid)
HideDynamicZoneForAllFlashes a zone for all.(zoneid)
IsPlayerInDynamicZoneChecks if a player is in a zone.(playerid, zoneid)
SetDynamicZoneColorSet the color of a zone.(zoneid, color)
GetDynamicZoneColorGet the color of a zone.(zoneid)
SetDynamicZoneAreaChange the zone position.(zoneid, Float:minx, Float:miny, Float:maxx, Float:maxy)
GetDynamicZoneAreaStore the zone position, passed by reference.(zoneid, Float:minx, Float:miny, Float:maxx, Float:maxy)
DestroyDynamicZoneDestroys a Dynamic Zone(zoneid)
CreateDynamicZoneCreates a Dynamic Zone.(Float:minx, Float:miny, Float:maxx, Float:maxy, color)
zexistCheck if a zone exist.(zoneid)
Atention
* If you're using the include in a filterscript you must #define FILTERSCRIPT before including the inc file.

Callbacks info
NameInfoParams
OnPlayerEnterDynamicZoneCalled when a player enters a zone(playerid, zoneid)
OnPlayerExitDynamicZoneCalled when a player exits a zone(playerid, zoneid)
Example
pawn Код:
public OnPlayerEnterDynamicZone( playerid, zoneid )
{
    if(zoneid == 1 && IsPlayerAdmin(playerid)) SendClientMessage( playerid, 0xFFFFFFFF, "Welcome to the zone, admin." );
    return 1;
}

public OnPlayerExitDynamicZone( playerid, zoneid )
{
    if(zoneid == 1 && IsPlayerAdmin(playerid)) SendClientMessage( playerid, 0xFFFFFFFF, "Good bye, admin." );
    return 1;
}
Download
Github

Thanks
* ******
* SA-MP Team.
Reply


Messages In This Thread
dzones.inc - Dynamic Zones - by Larceny - 02.08.2012, 22:42
Re: dzones.inc - Dynamic Zones - by FireCat - 02.08.2012, 22:44
Re: dzones.inc - Dynamic Zones - by Larceny - 02.08.2012, 22:46
Re: dzones.inc - Dynamic Zones - by Maxips2 - 03.08.2012, 00:02
Re: dzones.inc - Dynamic Zones - by Kaperstone - 03.08.2012, 00:08
Re: dzones.inc - Dynamic Zones - by Larceny - 03.08.2012, 00:13
Re: dzones.inc - Dynamic Zones - by misho1 - 03.08.2012, 00:43
Re: dzones.inc - Dynamic Zones - by dPlaYer_ - 03.08.2012, 04:12
Re: dzones.inc - Dynamic Zones - by Ballu Miaa - 07.08.2012, 13:48
Re: dzones.inc - Dynamic Zones - by Phil_Cutcliffe - 30.11.2013, 22:12

Forum Jump:


Users browsing this thread: 1 Guest(s)