21.06.2016, 22:21
So okay, for some reason (I just noticed) OnPlayerWeaponShot doesn't get called with bombs and rocket launchers.
Tested with that code.
Now, there is only 1 work around I found for bombs and thats it with KeyStateChange
But is there another way for it?
PHP код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
print("OnPlayerWeaponShot called");
printf("Weapon ID: %i :: Ammo: %i",GetPlayerWeapon(playerid),GetPlayerAmmo(playerid));
printf("Weapon ID: %i :: Ammo: %i",weaponid,GetPlayerAmmo(playerid));
return 1;
}
Now, there is only 1 work around I found for bombs and thats it with KeyStateChange
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE)) {
if(GetPlayerWeapon(playerid) == 16) {
printf("Weapon ID: %i :: Ammo: %i",GetPlayerWeapon(playerid),GetPlayerAmmo(playerid));
}
}
return 1;
}