-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(extra-natives/five): add getters for new track junction #3197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TheGamerzs
wants to merge
1
commit into
citizenfx:master
Choose a base branch
from
TheGamerzs:natives-track-junction
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,40 @@ | ||
--- | ||
ns: CFX | ||
apiset: client | ||
game: gta5 | ||
--- | ||
## GET_TRACK_JUNCTION_FROM_NODES | ||
|
||
```c | ||
int GET_TRACK_JUNCTION_FROM_NODES(int trackIndex, int trackNode, int newIndex, int newNode, bool direction); | ||
``` | ||
|
||
## Examples | ||
```lua | ||
local onTrack = 0 | ||
local onNode = 3899 | ||
local newTrack = 1 | ||
local newNode = 83 | ||
local direction = true | ||
|
||
local junctionId = RegisterTrackJunction(onTrack, onNode, newTrack, newNode, direction) | ||
print(("The junctionId is %s"):format(junctionId)) | ||
|
||
local retrievedJunctionId = GetTrackJunctionFromNodes(onTrack, onNode, newTrack, newNode, direction) | ||
|
||
if retrievedJunctionId ~= -1 then | ||
print(('The junction is valid, junctionId %i'):format(retrievedJunctionId)) | ||
else | ||
print('The junctionId is invalid') | ||
end | ||
``` | ||
|
||
## Parameters | ||
* **trackIndex**: The track index a train should be on | ||
* **trackNode**: The node a train should be on | ||
* **newIndex**: The new track index for a train to be placed on | ||
* **newNode**: The new track node for a train to be placed on | ||
* **direction**: The direction a train should be traveling for this junction | ||
|
||
## Return value | ||
Returns the junction id for the given nodes, or -1 if no junction exists. |
This file contains hidden or 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,41 @@ | ||
--- | ||
ns: CFX | ||
apiset: client | ||
game: gta5 | ||
--- | ||
## GET_TRACK_JUNCTION_INFO | ||
|
||
```c | ||
bool GET_TRACK_JUNCTION_INFO(int junctionId, int* trackIndex, int* trackNode, int* newIndex, int* newNode, bool* direction); | ||
``` | ||
|
||
## Examples | ||
|
||
```lua | ||
local onTrack = 0 | ||
local onNode = 3899 | ||
local newTrack = 1 | ||
local newNode = 83 | ||
local direction = true | ||
|
||
local junctionId = RegisterTrackJunction(onTrack, onNode, newTrack, newNode, direction) | ||
print(("The junctionId is %s"):format(junctionId)) | ||
|
||
local isValid, _onTrack, _onNode, _newTrack, _newNode, _direction = GetTrackJunctionInfo(junctionId) | ||
if isValid then | ||
print(('The junction is valid, on track %i, on node %i, new track %i, new node %i, direction %s'):format(_onTrack, _onNode, _newTrack, _newNode, _direction and 'true' or 'false')) | ||
else | ||
print('The junctionId is invalid') | ||
end | ||
``` | ||
|
||
## Parameters | ||
* **junctionId**: The track junction handle | ||
* **trackIndex**: The track index a train should be on | ||
* **trackNode**: The node a train should be on | ||
* **newIndex**: The new track index for a train to be placed on | ||
* **newNode**: The new track node for a train to be placed on | ||
* **direction**: The direction a train should be traveling for this junction | ||
|
||
## Return value | ||
Returns true if junction id is valid, false otherwise. |
This file contains hidden or 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,17 @@ | ||
--- | ||
ns: CFX | ||
apiset: client | ||
game: gta5 | ||
--- | ||
## IS_TRACK_JUNCTION_ACTIVE | ||
|
||
```c | ||
bool IS_TRACK_JUNCTION_ACTIVE(int junctionId, bool* isActive); | ||
``` | ||
|
||
## Parameters | ||
* **junctionId**: The track junction handle | ||
* **isActive**: Whether the track junction is active | ||
|
||
## Return value | ||
Returns true if junction id is valid, false otherwise. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.