[C#] GetWeaponTimeBetweenShots returns int but it should return float

  1. Client (production/canary) and FXServer version
    Irrelevant
  2. What you expected to happen
    GetWeaponTimeBetweenShots should return a float
  3. What actually happens
    GetWeaponTimeBetweenShots returns an integer
  4. Category of bug (eg. client, server, weapons, peds, native)
    Native
  5. Reproducible steps, preferably with example script(s)
    Irrelevant

GetWeaponTimeBetweenShots natively returns a float value, but on the C# Native API it returns an integer.

My current workaround is the following:

var fireRate = BitConverter.ToSingle(BitConverter.GetBytes(GetWeaponTimeBetweenShots(weaponHash)), 0);

Intended and can’t be changed without breaking source+binary compatibility (i.e. if this is fixed, your assembly, even in binary form, won’t work anymore).

see cs_type annotation