-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove unimplemented functions and callbacks"
- Loading branch information
Showing
40 changed files
with
889 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: OnScriptCash | ||
description: This callback is called when something in-game like casinos give the player money. | ||
tags: ["player"] | ||
--- | ||
|
||
:::warning | ||
|
||
This callback is currently NOT working. | ||
|
||
::: | ||
|
||
## Description | ||
|
||
This callback is called when something in-game like casinos give the player money. | ||
|
||
| Name | Description | | ||
|----------|-------------------------------------------------| | ||
| playerid | The ID of the player who got cash from the game | | ||
| amount | The amount of cash given or taken | | ||
| source | Where the money came from | | ||
|
||
## Returns | ||
|
||
Unknown as this function does not currently work. | ||
|
||
## Examples | ||
|
||
```c | ||
// Imaginary: | ||
|
||
public OnScriptCash(playerid, amount, source) | ||
{ | ||
if (source == SCRIPT_CASH_CASINO) | ||
{ | ||
SendClientMessage(playerid, -1, "You have won $%d from the casino!", amount); | ||
} | ||
else if (source == SCRIPT_CASH_VENDING_MACHINE) | ||
{ | ||
SendClientMessage(playerid, -1, "You buyed a coke from vending machine for $%d", amount); | ||
} | ||
return 1; | ||
} | ||
``` | ||
## Related Functions | ||
The following functions might be useful, as they're related to this callback in one way or another. | ||
- [GetPlayerMoney](../functions/GetPlayerMoney): Retrieves the amount of money a player has. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: GetPlayerLastSyncedTrailerID | ||
description: Gets the player's last synced trailer ID. | ||
tags: ["player", "vehicle"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
:::warning | ||
|
||
This function has not yet been implemented. | ||
|
||
::: | ||
|
||
## Description | ||
|
||
Gets the player's last synced trailer ID. | ||
|
||
## Parameters | ||
|
||
| Name | Description | | ||
|----------|-----------------------| | ||
| playerid | The ID of the player. | | ||
|
||
## Return Values | ||
|
||
Returns the last synced trailer ID. | ||
|
||
## Examples | ||
|
||
```c | ||
new trailerid = GetPlayerLastSyncedTrailerID(playerid); | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [GetPlayerLastSyncedVehicleID](GetPlayerLastSyncedVehicleID): Gets the player's last synced vehicle ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: GetPlayerLastSyncedVehicleID | ||
description: Gets the player's last synced vehicle ID. | ||
tags: ["player", "vehicle"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
:::warning | ||
|
||
This function has not yet been implemented. | ||
|
||
::: | ||
|
||
## Description | ||
|
||
Gets the player's last synced vehicle ID. | ||
|
||
## Parameters | ||
|
||
| Name | Description | | ||
|----------|-----------------------| | ||
| playerid | The ID of the player. | | ||
|
||
## Return Values | ||
|
||
Returns the last synced vehicle ID. | ||
|
||
## Examples | ||
|
||
```c | ||
new vehicleid = GetPlayerLastSyncedVehicleID(playerid); | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [GetPlayerLastSyncedTrailerID](GetPlayerLastSyncedTrailerID): Gets the player's last synced trailer ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: GetServerRuleFlags | ||
description: Gets the flags of a server rule. | ||
tags: ["rule"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
:::warning | ||
|
||
This function has not yet been implemented. | ||
|
||
::: | ||
|
||
## Description | ||
|
||
Gets the flags of a server rule. | ||
|
||
## Return Values | ||
|
||
Returns the server rule flags. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnGameModeInit() | ||
{ | ||
AddServerRule("discord", "discord.gg/samp"); | ||
SetServerRuleFlags("discord", 1); | ||
|
||
new E_SERVER_RULE_FLAGS:flags = GetServerRuleFlags("discord"); | ||
printf("Flags: %d", _:flags); // Flags: 1 | ||
return 1; | ||
} | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [AddServerRule](AddServerRule): Add a server rule. | ||
- [RemoveServerRule](RemoveServerRule): Remove the server rule. | ||
- [IsValidServerRule](IsValidServerRule): Checks if the given server rule is valid. | ||
- [SetServerRuleFlags](SetServerRuleFlags): Sets the flags of a server rule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: GetVehicleOccupiedTick | ||
description: Get the occupied tick of a vehicle. | ||
tags: ["vehicle"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Get the occupied tick of a vehicle. | ||
|
||
## Parameters | ||
|
||
| Name | Description | | ||
|-----------|------------------------| | ||
| vehicleid | The ID of the vehicle. | | ||
|
||
## Return Values | ||
|
||
Returns occupied tick in milliseconds. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnGameModeInit() | ||
{ | ||
new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); | ||
|
||
new occupiedTick = GetVehicleOccupiedTick(vehicleid); | ||
printf("Vehicle ID %d occupied tick: %d ms", vehicleid, occupiedTick); | ||
return 1; | ||
} | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [SetVehicleOccupiedTick](SetVehicleOccupiedTick): Set the occupied tick of a vehicle. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: HideObjectForPlayer | ||
description: Hide an object for a player. | ||
tags: ["player", "object"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Hide an object for a player. | ||
|
||
## Parameters | ||
|
||
| Name | Description | | ||
|----------|------------------------------------------| | ||
| playerid | The ID of the player. | | ||
| objectid | The ID of the object to hide for player. | | ||
|
||
## Returns | ||
|
||
`true` - The function was executed successfully. | ||
|
||
`false` - The function failed to execute. The playerid or objectid specified does not exist. | ||
|
||
## Examples | ||
|
||
```c | ||
new gObject; | ||
|
||
public OnGameModeInit() | ||
{ | ||
gObject = CreateObject(1431, 921.12201, -1206.78613, 16.52670, 0.00000, 0.00000, 90.00000); | ||
return 1; | ||
} | ||
|
||
public OnPlayerConnect(playerid) | ||
{ | ||
HideObjectForPlayer(playerid, gObject); | ||
return 1; | ||
} | ||
``` | ||
## Related Functions | ||
- [ShowObjectForPlayer](ShowObjectForPlayer): Show an object for a player. | ||
- [IsObjectHiddenForPlayer](IsObjectHiddenForPlayer): Checks if an object is hidden for a player. | ||
- [CreateObject](CreateObject): Create an object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: IsObjectHiddenForPlayer | ||
description: Checks if an object is hidden for a player. | ||
tags: ["player", "object"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Checks if an object is hidden for a player. | ||
|
||
## Parameters | ||
|
||
| Name | Description | | ||
|----------|--------------------------------| | ||
| playerid | The ID of the player. | | ||
| objectid | The ID of the object to check. | | ||
|
||
## Returns | ||
|
||
`true` - Object is hidden for the player. | ||
|
||
`false` - Object is not hidden for the player. | ||
|
||
## Examples | ||
|
||
```c | ||
new gObject; | ||
|
||
public OnGameModeInit() | ||
{ | ||
gObject = CreateObject(1431, 921.12201, -1206.78613, 16.52670, 0.00000, 0.00000, 90.00000); | ||
return 1; | ||
} | ||
|
||
public OnPlayerConnect(playerid) | ||
{ | ||
HideObjectForPlayer(playerid, gObject); | ||
return 1; | ||
} | ||
|
||
public OnPlayerSpawn(playerid) | ||
{ | ||
if (IsObjectHiddenForPlayer(playerid, gObject)) | ||
{ | ||
printf("Object %d is hidden for player %d", gObject, playerid); | ||
} | ||
return 1; | ||
} | ||
``` | ||
## Notes | ||
:::tip | ||
You can hide objects for a specific player with [HideObjectForPlayer](HideObjectForPlayer) function. | ||
::: | ||
## Related Functions | ||
- [HideObjectForPlayer](HideObjectForPlayer): Hide an object for a player. | ||
- [ShowObjectForPlayer](ShowObjectForPlayer): Show an object for a player. | ||
- [CreateObject](CreateObject): Create an object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.