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

Fix incorrect behavior of onPlayerChangesWorldSpecialProperty event #3994

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

Nico8340
Copy link
Contributor

@Nico8340 Nico8340 commented Jan 30, 2025

Fixes incorrect behavior of the onPlayerChangesWorldSpecialProperty event, which was previously triggered for every internal call. Also includes minor refactors.

  • Remove unnecessary code
  • Replace the packet send logic

@Nico8340
Copy link
Contributor Author

Tests:

local cheats = {
    ["hovercars"] = true,
    ["aircars"] = true,
    ["extrabunny"] = true,
    ["extrajump"] = true
}

addEventHandler("onPlayerChangesWorldSpecialProperty", root,
    function(property, enabled)
        if not cheats[property] then
            return
        end

        if not enabled then
            return
        end

        banPlayer(source, false, false, true, "Server", "Time to take a permanent break :-)")
    end
)

Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

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

Looks good now, thanks

@Lpsd Lpsd merged commit caa5c4f into multitheftauto:master Jan 30, 2025
6 checks passed
@Nico8340 Nico8340 deleted the specialproperty branch January 30, 2025 21:33
@CArg22
Copy link
Contributor

CArg22 commented Jan 31, 2025

does it take an account reseting properties to default?

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