You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using AIM_SYNC and detecting the weapon state to set an ammo variable to 0 when they no longer have any bullets, ie - when weapon state is WEAPONSTATE_NO_BULLETS.
For some reason it is reporting no bullets when it shouldn't.
Yes I use 'GetPlayerSyncWeapon' which is from YSF to get the current weapon. The reason I use that is because there is no weaponid for the PR_AimSync callback. Could it be GetPlayerSyncWeapon is picking up the new weapon instead of the old weapon that ran out of bullets?
It is known that recently added GetPlayerSyncWeapon from YSF sometimes return weird invalid values as weaponid (like 192, 64, 255 and so on which is greater than 46). You can store weaponid from OnFoot/Driver/Passenger/Spectating sync manually in some your array and test the whole code again without GetPlayerSyncWeapon being used anywhere.
Hi there,
I'm using AIM_SYNC and detecting the weapon state to set an ammo variable to 0 when they no longer have any bullets, ie - when weapon state is WEAPONSTATE_NO_BULLETS.
For some reason it is reporting no bullets when it shouldn't.
Yes I use 'GetPlayerSyncWeapon' which is from YSF to get the current weapon. The reason I use that is because there is no weaponid for the PR_AimSync callback. Could it be GetPlayerSyncWeapon is picking up the new weapon instead of the old weapon that ran out of bullets?
I use this function:
new sync = GetPlayerSyncWeapon(playerid); if(aimData[PR_weaponState] == WEAPONSTATE_NO_BULLETS && sync != 0 && sync != 255) { new slot = GetWeaponSlot(sync); if(slot != 0 && slot != 1 && slot != 10 && slot != 11 && slot != 255) { WeaponInformation[playerid][slot][WeaponAmmo] = 0; if(UserInfo[playerid][DebugWeapon] == 10) { SendFormatMessage(playerid,COLOR_RED,"WEAPONSTATE_NO_BULLETS - ws hide - %d ", sync); } SetPlayerAmmo(playerid, GetPlayerSyncWeapon(playerid), 0); PlayerAmmo[playerid][slot] = 0; } }
The text was updated successfully, but these errors were encountered: