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

OnPlayerChangeWeapon #992

Open
hiwyn opened this issue Sep 27, 2024 · 2 comments
Open

OnPlayerChangeWeapon #992

hiwyn opened this issue Sep 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@hiwyn
Copy link

hiwyn commented Sep 27, 2024

A lot servers have to do it like me:

SetTimerEx("CheckIfPlayersChangedWeapon", 500, true, "i", playerid);


public CheckIfPlayersChangedWeapon(i) {
    new Now_WeaponInHands = GetPlayerWeapon(i);
    if(LastWeaponInHands[i] != Now_WeaponInHands) {
        OnPlayerChangeWeapon(i, LastWeaponInHands[i], Now_WeaponInHands);
        LastWeaponInHands[i] = Now_WeaponInHands;
    }
    return 1;
}

A infinite timer to check every 0.5 sec, to detect if player change weapon, to change weapons on skin and stuff like that

Would be possible on server side to detect and create a new callback
OnPlayerChangeWeapon
???

@hiwyn hiwyn added the enhancement New feature or request label Sep 27, 2024
@Vince0789
Copy link

This is what OnPlayerUpdate was intended to be used for. A timer might not even catch all changes if the players scrolls fast.

@NexiusTailer
Copy link
Contributor

NexiusTailer commented Oct 2, 2024

Even OnPlayerUpdate can miss some fast scrolling so its accuracy is not ideal (and tbf it cannot be ideal if made serverside). It would be even more strange to see this as out-of-the-box callback which isn't accurate enough for people who imply that it should detect everything if it was allocated into a separate and "natively" done thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants