Ammo doesnt register when shooting up & down with TEC9
#1

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?
Reply
#2

Show your OnPlayerWeaponShot callbsck?
Reply
#3

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.
Reply
#4

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?
Reply
#5

Код:
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)