GetPlayerAmmo @ OnPlayerWeaponShot
#1

Could someone confirm or dismiss this bug I get.

Strangely it happens only with Mp5, when you shot many times in a row, it gets the same amount of bullets twice.
When you shot like 1 bullet per second its fine.


[ame]http://www.youtube.com/watch?v=kTCvb02nEdE[/ame]


And this is by disabling servers AC, it gets twice the same bullet and then goes lower by 2 bullets.




This is the code I use

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    new string[128];
    format(string,sizeof(string), "WeaponID: %d   Ammo: %d",weaponid,GetPlayerAmmo(playerid));
    SendClientMessage(playerid,-1,string);
    return 1;

}
Reply
#2

That's because the bullets / ammunition is fired before the server can update the data. This is the only weapon allowing such a fast shooting issue.
Reply
#3

Pair the if statement with an animation index and tick count. I found some framework months ago for the full list of tick counts, I think it was on either southclaw's or someone elses github..

#If servervar < GetPlayerAmmo && animationindex == shooting anim && (gettime - lastshot) < patched tick
-- servervar = getplayerammo;
Reply
#4

Confirmed yes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)