Ammo doesnt register when shooting up & down with TEC9 -
JaydenJason - 08.08.2016
Hey, I was fucking around with my weapon system and noticed this very weird thing.
If you're holding either a Colt45, UZI or a TEC-9 and stand in the stance like in the SS below, OnPlayerWeaponShot doesn't register for some reason.
Here's a few screens with it:
This is the stance I'm talking about.
Shooting doesn't register OnPlayerWeaponShot
If the crosshair is visible, it does:
How would I go on about fixing this? Or any alternatives for this?
Re: Ammo doesnt register when shooting up & down with TEC9 -
Ahmed21 - 08.08.2016
Show your OnPlayerWeaponShot callbsck?
Re: Ammo doesnt register when shooting up & down with TEC9 -
Luicy. - 08.08.2016
Quote:
Originally Posted by Ahmed21
Show your OnPlayerWeaponShot callbsck?
|
Well, this is nothing you can fix, since gta sa itself don't register the bullets. Because they only have to egister it when you're able to hit someone, in the stance you showed us, it's impossible to hit someone.
Re: Ammo doesnt register when shooting up & down with TEC9 -
JaydenJason - 08.08.2016
Quote:
Originally Posted by Ahmed21
Show your OnPlayerWeaponShot callbsck?
|
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new str[120], weapondata[2];
GetPlayerWeaponData(playerid, GetWeaponSlot(weaponid), weapondata[0], weapondata[1]);
format(str, sizeof(str), "DEBUG: weapondata for %s: weapon:%i ammo:%i slot:%i", GetOOCName(playerid), weapondata[0], weapondata[1], GetWeaponSlot(weaponid));
SendClientMessage(playerid, COLOR_WHITE, str);
return 1;
}
Quote:
Originally Posted by Luicy.
Well, this is nothing you can fix, since gta sa itself don't register the bullets. Because they only have to egister it when you're able to hit someone, in the stance you showed us, it's impossible to hit someone.
|
That's right, but is there any way for me to fix this? Alternatives, whatsoever?
Re: Ammo doesnt register when shooting up & down with TEC9 -
d1git - 08.08.2016
Код:
new
ammo[MAX_PLAYERS char];
forward check(playerid);
public check(playerid) {
if(GetPlayerWeapon(playerid) == 32) {
if(GetPlayerAmmo(playerid) < ammo{playerid}) {
new string[14];
format(string, sizeof string, "AMMO: %d", GetPlayerAmmo(playerid));
SendClientMessage(playerid, -1, string);
}
ammo{playerid} = GetPlayerAmmo(playerid);
}
return 1;
}
CMD:tec(playerid, params[]) {
GivePlayerWeapon(playerid, 32, 100);
SetTimerEx("check", 1, true, "d", playerid);
return 1;
}
Increase the timer interval, this was just for testing purposes - and it is not recommended to format a string inside a loop, again... this was just for testing purposes.