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

Add Player.enterVehicle #1965

Merged
merged 3 commits into from
Jan 11, 2025
Merged

Add Player.enterVehicle #1965

merged 3 commits into from
Jan 11, 2025

Conversation

Advers
Copy link
Contributor

@Advers Advers commented Jan 10, 2025

Adds a function to allow forcing players into seats. This could be abusable, so it's restricted to "admin only" permissions by default, and also requires entity permissions on the player and the vehicle.

@thegrb93
Copy link
Owner

I don't think we need a entity permission check on the vehicle. However, I'm wondering if the CanPlayerEnterVehicle hook should be checked.

@adamnejm
Copy link
Collaborator

adamnejm commented Jan 10, 2025

Honestly, introducing an optional player argument to Entity.use that's only available to superadmins could work too and be more versatile.
Wouldn't have to deal with checking the hook (if that's needed) and could be used for other purposes as well.

Could also implement admin-only Player.use that would work the same as Entity.use, but the entire function would require admin perms and take the entity as an arg instead.

@thegrb93
Copy link
Owner

I think use() has the same problem in that it bypasses PlayerCanUse. Might be wrong tho

@thegrb93
Copy link
Owner

Also, I think its preferable that enterVehicle can bypass in-engine vehicle locks

@Advers
Copy link
Contributor Author

Advers commented Jan 10, 2025

However, I'm wondering if the CanPlayerEnterVehicle hook should be checked.

Player.EnterVehicle already obeys CanPlayerEnterVehicle by default. It would be redundant to add an extra check.

@thegrb93 thegrb93 merged commit 3161315 into thegrb93:master Jan 11, 2025
1 check passed
github-actions bot added a commit that referenced this pull request Jan 11, 2025
* enterVehicle

* remove vehicle permission check

* local func 3161315
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.

3 participants