openmultiplayer / openmultiplayer/open.mp

OnPlayerChangeWeapon

Open
#992 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
641
Forks
208
PR merge metrics
No merged PRs in 30d

Description

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
???

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the server-side weapon handling and existing player callbacks, then compare them with the polling example. Done requires an agreed callback behavior and implementation, including when the old and new weapon values are reported.

Written by the indexing model from the issue text.

Assessment

Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.