Aller au contenu principal

UseGangZoneCheck

attention

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.

NameDescription
zoneidThe ID of the zone to enable area detection for.
bool:enableShould 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;
}

The following callbacks might be useful, as they're related to this function in one way or another.

The following functions might be useful, as they're related to this function in one way or another.