note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
UseGangZoneCheck
warning
This function was added in omp v1.1.0.2612 and will not work in earlier versions!
Description
Enables the callback when a player enters/leaves this zone.
Name | Description |
---|---|
zoneid | The ID of the zone to enable area detection for. |
bool:enable | Should entry detection be started or stopped? (true /false ) |
Returns
1: The function executed successfully.
0: The function failed to execute. The gangzone specified does not exist.
Examples
new gGangZoneID = INVALID_GANG_ZONE;
public OnGameModeInit()
{
gGangZoneID = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
// Enabled the callback when a player enters/leaves this zone
UseGangZoneCheck(gGangZoneID, true);
}
public OnPlayerEnterGangZone(playerid, zoneid)
{
if (zoneid == gGangZoneID)
{
new string[64];
format(string, sizeof(string), "You are entering gangzone %i", zoneid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
return 1;
}
public OnPlayerLeaveGangZone(playerid, zoneid)
{
if (zoneid == gGangZoneID)
{
new string[64];
format(string, sizeof(string), "You are leaving gangzone %i", zoneid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
return 1;
}
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerEnterGangZone: This callback is called when a player enters a gangzone.
- OnPlayerLeaveGangZone: This callback is called when a player exited a gangzone.
Related Functions
The following functions might be useful, as they're related to this function in one way or another.
- GangZoneCreate: Create a gangzone.
- GangZoneDestroy: Destroy a gangzone.
- GangZoneShowForPlayer: Show a gangzone for a player.
- GangZoneShowForAll: Show a gangzone for all players.
- GangZoneHideForPlayer: Hide a gangzone for a player.
- GangZoneHideForAll: Hide a gangzone for all players.
- GangZoneFlashForPlayer: Make a gangzone flash for a player.
- GangZoneFlashForAll: Make a gangzone flash for all players.
- GangZoneStopFlashForPlayer: Stop a gangzone flashing for a player.
- GangZoneStopFlashForAll: Stop a gangzone flashing for all players.
- IsValidGangZone: Check if the gangzone valid.
- IsPlayerInGangZone: Check if the player in gangzone.
- IsGangZoneVisibleForPlayer: Check if the gangzone is visible for player.