Skip to content

Commit

Permalink
Documentation gangzone. (#803)
Browse files Browse the repository at this point in the history
* Add OnPlayerEnterGangZone.md

* Add OnPlayerLeaveGangZone.md

* Add OnPlayerEnterPlayerGangZone.md and fixs previous commits

* Add OnPlayerLeavePlayerGangZone.md

* Update OnPlayerEnterPlayerGangZone.md and OnPlayerEnterGangZone.md

* Add OnPlayerClickGangZone.md

* Fixs tabulation in recently added files

* Add OnPlayerClickPlayerGangZone.md

* Add CreatePlayerGangZone.md

* Add PlayerGangZoneDestroy.md

* Add PlayerGangZoneShow.md

* Add PlayerGangZoneHide.md and fixs recently added files

* Add PlayerGangZoneFlash.md

* Add PlayerGangZoneStopFlash.md

* Add PlayerGangZoneGetColour.md

* Add PlayerGangZoneGetFlashColour.md

* Fix PlayerGangZoneGetFlashColour.md

* Add PlayerGangZoneGetPos.md

* Add IsValidPlayerGangZone.md

* Add IsPlayerInPlayerGangZone.md

* Add IsPlayerGangZoneVisible.md

* Add IsPlayerGangZoneFlashing.md

* Add UsePlayerGangZoneCheck.md

* Fixs descriptions in gangzone docs

* Add IsValidGangZone.md

* Update CreatePlayerGangZone.md

* Add IsPlayerInGangZone.md

* Add IsGangZoneVisibleForPlayer.md

* Add GangZoneGetColourForPlayer.md

* Add GangZoneGetFlashColourForPlayer.md

* Add IsGangZoneFlashingForPlayer.md

* Add GangZoneGetPos.md

* Update CreatePlayerGangZone.md

* Update docs/scripting/functions/CreatePlayerGangZone.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/GangZoneGetColourForPlayer.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/GangZoneGetFlashColourForPlayer.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/PlayerGangZoneGetColour.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/PlayerGangZoneGetFlashColour.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/PlayerGangZoneDestroy.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/PlayerGangZoneHide.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/PlayerGangZoneStopFlash.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/PlayerGangZoneDestroy.md

Co-authored-by: Adib <[email protected]>

* Add UseGangZoneCheck.md

* Update player gangzone related functions

* Update UseGangZoneCheck.md

* Update UsePlayerGangZoneCheck.md

* Update docs/scripting/functions/PlayerGangZoneHide.md

Co-authored-by: Adib <[email protected]>

* Update docs/scripting/functions/PlayerGangZoneStopFlash.md

Co-authored-by: Adib <[email protected]>

---------

Co-authored-by: Adib <[email protected]>
  • Loading branch information
shierru and adib-yg authored Jan 2, 2024
1 parent 0b87c9d commit e9977e2
Show file tree
Hide file tree
Showing 28 changed files with 1,311 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/scripting/callbacks/OnPlayerClickGangZone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: OnPlayerClickGangZone
description: This callback is called when a player clicked a gangzone on the pause menu map (by right-clicking).
tags: ["player", "gangzone"]
---

## Description

This callback is called when a player clicked a gangzone on the pause menu map (by right-clicking).

| Name | Description |
| -------- | ----------------------------------------------------------------------------- |
| playerid | The ID of the player that clicked a gangzone |
| zoneid | The ID of the gangzone the player clicked |

## Returns

This callback does not handle returns.
It is always called first in gamemode.

## Examples

```c
public OnPlayerClickGangZone(playerid, zoneid)
{
new string[128];
format(string, sizeof(string), "You are click gangzone %i", zoneid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
```
## Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- [GangZoneCreate](../functions/GangZoneCreate): Create a gangzone (colored radar area).
- [GangZoneDestroy](../functions/GangZoneDestroy): Destroy a gangzone.
38 changes: 38 additions & 0 deletions docs/scripting/callbacks/OnPlayerClickPlayerGangZone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: OnPlayerClickPlayerGangZone
description: This callback is called when a player clicked a player gangzone on the pause menu map (by right-clicking).
tags: ["player", "gangzone"]
---

## Description

This callback is called when a player clicked a player gangzone on the pause menu map (by right-clicking).

| Name | Description |
| -------- | ------------------------------------------------------------------------------------ |
| playerid | The ID of the player that clicked a player gangzone |
| zoneid | The ID of the player gangzone the player clicked |

## Returns

This callback does not handle returns.
It is always called first in gamemode.

## Examples

```c
public OnPlayerClickPlayerGangZone(playerid, zoneid)
{
new string[128];
format(string, sizeof(string), "You are click player gangzone %i", zoneid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
```
## Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- [CreatePlayerGangZone](../functions/CreatePlayerGangZone): Create a player gangzone.
- [PlayerGangZoneDestroy](../functions/PlayerGangZoneDestroy): Destroy a player gangzone.
44 changes: 44 additions & 0 deletions docs/scripting/callbacks/OnPlayerEnterGangZone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: OnPlayerEnterGangZone
description: This callback is called when a player enters a gangzone
tags: ["player", "gangzone"]
---

## Description

This callback is called when a player enters a gangzone

| Name | Description |
| -------- | ----------------------------------------------- |
| playerid | The ID of the player that entered the gangzone. |
| zoneid | The ID of the gangzone the player entered. |

## Returns

It is always called first in gamemode.

## Examples

```c
public OnPlayerEnterGangZone(playerid, zoneid)
{
new string[128];
format(string, sizeof(string), "You are entering gangzone %i", zoneid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
```
## Related Callbacks
The following callbacks might be useful, as they're related to this callback in one way or another.
- [OnPlayerLeaveGangZone](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 callback in one way or another.
- [GangZoneCreate](../functions/GangZoneCreate): Create a gangzone (colored radar area).
- [GangZoneDestroy](../functions/GangZoneDestroy): Destroy a gangzone.
- [UseGangZoneCheck](../functions/UseGangZoneCheck): Enables the callback when a player entered this zone.
44 changes: 44 additions & 0 deletions docs/scripting/callbacks/OnPlayerEnterPlayerGangZone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: OnPlayerEnterPlayerGangZone
description: This callback is called when a player enters a player gangzone
tags: ["player", "gangzone"]
---

## Description

This callback is called when a player enters a player gangzone.

| Name | Description |
| -------- | ------------------------------------------------------ |
| playerid | The ID of the player that entered the player gangzone. |
| zoneid | The ID of the player gangzone the player entered. |

## Returns

It is always called first in gamemode.

## Examples

```c
public OnPlayerEnterPlayerGangZone(playerid, zoneid)
{
new string[128];
format(string, sizeof(string), "You are entering player gangzone %i", zoneid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
```
## Related Callbacks
The following callbacks might be useful, as they're related to this callback in one way or another.
- [OnPlayerLeavePlayerGangZone](OnPlayerLeavePlayerGangZone): This callback is called when a player exited a player gangzone.
## Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- [CreatePlayerGangZone](../functions/CreatePlayerGangZone): Create player gangzone.
- [PlayerGangZoneDestroy](../functions/PlayerGangZoneDestroy): Destroy player gangzone.
- [UsePlayerGangZoneCheck](../functions/UsePlayerGangZoneCheck): Enables the callback when a player entered this zone.
43 changes: 43 additions & 0 deletions docs/scripting/callbacks/OnPlayerLeaveGangZone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: OnPlayerLeaveGangZone
description: This callback is called when a player exited a gangzone
tags: ["player", "gangzone"]
---

## Description

This callback is called when a player exited a gangzone

| Name | Description |
| -------- | ---------------------------------------------- |
| playerid | The ID of the player that exited the gangzone. |
| zoneid | The ID of the gangzone the player exited. |

## Returns

It is always called first in gamemode.

## Examples

```c
public OnPlayerLeaveGangZone(playerid, zoneid)
{
new string[128];
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 callback in one way or another.
- [OnPlayerEnterGangZone](OnPlayerEnterGangZone): This callback is called when a player enters a gangzone.
## Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- [GangZoneCreate](../functions/GangZoneCreate): Create a gangzone (colored radar area).
- [GangZoneDestroy](../functions/GangZoneDestroy): Destroy a gangzone.
44 changes: 44 additions & 0 deletions docs/scripting/callbacks/OnPlayerLeavePlayerGangZone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: OnPlayerLeavePlayerGangZone
description: This callback is called when a player exited a player gangzone
tags: ["player", "gangzone"]
---

## Description

This callback is called when a player exited a player gangzone.

| Name | Description |
| -------- | ----------------------------------------------------- |
| playerid | The ID of the player that exited the player gangzone. |
| zoneid | The ID of the player gangzone the player exited. |

## Returns

It is always called first in gamemode.

## Examples

```c
public OnPlayerLeavePlayerGangZone(playerid, zoneid)
{
new string[128];
format(string, sizeof(string), "You are leaving player gangzone %i", zoneid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
```
## Related Callbacks
The following callbacks might be useful, as they're related to this callback in one way or another.
- [OnPlayerEnterPlayerGangZone](OnPlayerEnterPlayerGangZone): This callback is called when a player exited a player gangzone.
## Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- [CreatePlayerGangZone](../functions/CreatePlayerGangZone): Create player gangzone.
- [PlayerGangZoneDestroy](../functions/PlayerGangZoneDestroy): Destroy player gangzone.
- [UsePlayerGangZoneCheck](../functions/UsePlayerGangZoneCheck): Enables the callback when a player exited this zone.
79 changes: 79 additions & 0 deletions docs/scripting/functions/CreatePlayerGangZone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: CreatePlayerGangZone
description: Create player gangzone
tags: ["player", "gangzone", "playergangzone"]
---

## Description

Create player gangzone. This can be used as a way around the global gangzone limit.

| Name | Description |
| ----------- | ----------------------------------------------------------------- |
| playerid | The ID of the player to whom the player gangzone will be created. |
| Float:minX | The X coordinate for the west side of the player gangzone. |
| Float:minY | The Y coordinate for the south side of the player gangzone. |
| Float:maxX | The X coordinate for the east side of the player gangzone. |
| Float:maxY | The Y coordinate for the north side of the player gangzone. |

## Returns

The ID of the created player gangzone, returns -1 if not created

## Examples

```c
// This variable is used to store the id of the gangzone
// so that we can use it throught the script
new gGangZoneID[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
// Create the gangzone
gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348);
}
```
```
MaxY
v
-------------* < MaxX
| |
| gangzone |
| center |
| |
MinX > *-------------
^
MinY
```
## Notes
:::tip
This function merely CREATES the gangzone, you must use [PlayerGangZoneShow](PlayerGangZoneShow) to show it.
:::
:::warning
* There is a limit of 1024 gangzones.
* Putting the parameters in the wrong order results in glitchy behavior.
:::
## Related Functions
- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): Destroy player gangzone.
- [PlayerGangZoneShow](PlayerGangZoneShow): Show player gangzone in a color.
- [PlayerGangZoneHide](PlayerGangZoneHide): Hide player gangzone.
- [PlayerGangZoneFlash](PlayerGangZoneFlash): Start player gangzone flash.
- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): Stop player gangzone flash.
- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): Get the colour of a player gangzone.
- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): Get the flashing colour of a player gangzone.
- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): Get the position of a gangzone, represented by minX, minY, maxX, maxY coordinates.
- [IsValidPlayerGangZone](IsValidPlayerGangZone): Check if the player gangzone valid.
- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): Check if the player in player gangzone.
- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): Check if the player gangzone is visible.
- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): Check if the player gangzone is flashing.
- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): Enables the callback when a player enters/leaves this zone.
35 changes: 35 additions & 0 deletions docs/scripting/functions/GangZoneGetColourForPlayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: GangZoneGetColourForPlayer
description: Get the colour of a gangzone for player
tags: ["player", "gangzone"]
---

## Description

Get the colour of a gangzone for player.

| Name | Description |
| ----------- | ----------------------------------------- |
| playerid | The ID of the player you need to get. |
| zoneid | The ID of the gangzone. |

## Returns

Color of gangzone for player.

0: Failed to execute the function. The gangzone is not shown for the player.

## Related Functions

- [GangZoneDestroy](GangZoneDestroy): Destroy a gangzone.
- [GangZoneShowForPlayer](GangZoneShowForPlayer): Show a gangzone for a player.
- [GangZoneShowForAll](GangZoneShowForAll): Show a gangzone for all players.
- [GangZoneHideForPlayer](GangZoneHideForPlayer): Hide a gangzone for a player.
- [GangZoneHideForAll](GangZoneHideForAll): Hide a gangzone for all players.
- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Make a gangzone flash for a player.
- [GangZoneFlashForAll](GangZoneFlashForAll): Make a gangzone flash for all players.
- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Stop a gangzone flashing for a player.
- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Stop a gangzone flashing for all players.
- [IsValidGangZone](IsValidGangZone): Check if the gangzone valid.
- [IsPlayerInGangZone](IsPlayerInGangZone): Check if the player in gangzone.
- [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): Check if the gangzone is visible for player.
Loading

0 comments on commit e9977e2

Please sign in to comment.