Skip to content
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

Update IsVehicleStoppedAtTrafficLights #1115

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

Mathu-lmn
Copy link
Contributor

This behavior was checked using this code :

Citizen.CreateThread(function()
    while checkveh do
        Citizen.Wait(0)
        for k, v in pairs(GetGamePool("CVehicle")) do
            if DoesEntityExist(v) then
                local coords = GetEntityCoords(v)
                local dst = #(GetEntityCoords(PlayerPedId()) - coords)
                if dst <= 150.0 then
                    if IsEntityOnScreen(v) then
                        local stopped = IsVehicleStoppedAtTrafficLights(v)
                        DrawText3D(coords.x, coords.y, coords.z, "Stopped: " .. tostring(stopped))
                    end
                end
            end
        end
    end
end)

VEHICLE/IsVehicleStoppedAtTrafficLights.md Outdated Show resolved Hide resolved
VEHICLE/IsVehicleStoppedAtTrafficLights.md Outdated Show resolved Hide resolved
@Mathu-lmn
Copy link
Contributor Author

Thanks for your feedback, does this looks good to you ?

Is this for red lights only? more testing required.
This native checks if the given vehicle is stopped at a red light.

**Note:** Will return false if the vehicle is stopped behind another vehicle waiting at a traffic light.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false -> false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work since it's already in a ``` box no ?

Copy link
Contributor

@4mmonium 4mmonium Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imported comments shouldn't be modified this way, instead it should be taken out of the fenced code block and written as a description of the native. That way everyone knows the documentation has been updated, it will show "Has modern docs" in the native reference site.

Copy link
Contributor

@4mmonium 4mmonium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes, check my comments. Thank you for your contribution!

Is this for red lights only? more testing required.
This native checks if the given vehicle is stopped at a red light.

**Note:** Will return false if the vehicle is stopped behind another vehicle waiting at a traffic light.
Copy link
Contributor

@4mmonium 4mmonium Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imported comments shouldn't be modified this way, instead it should be taken out of the fenced code block and written as a description of the native. That way everyone knows the documentation has been updated, it will show "Has modern docs" in the native reference site.

@@ -9,10 +9,10 @@ BOOL IS_VEHICLE_STOPPED_AT_TRAFFIC_LIGHTS(Vehicle vehicle);
```

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove backticks, these are reserved for imported comments, not actual contributions by the community.

Is this for red lights only? more testing required.
This native checks if the given vehicle is stopped at a red light.

**Note:** Will return false if the vehicle is stopped behind another vehicle waiting at a traffic light.
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these as well.

Complement native documentation based on research.
@4mmonium
Copy link
Contributor

Made some changes based on research, merging. Thanks!

@4mmonium 4mmonium merged commit d043337 into citizenfx:master Jun 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants