OnPlayerWeaponShot doesn't work for driver DB
#1

OnPlayerWeaponShot doesn't get called when the driver of a vehicle fires a weapon, but does get called by a passenger drive-by. Can this be fixed?
Reply
#2

You mean pressing Q and E ?
Yea i've noticed that too
Reply
#3

Correction: its not always 0. For the passenger the weaponid is kind of random, could be something like the weapon in the previous slot, or its somehow dependent from the previously used weapon. At least its the wrong ID most of the time. Tiny bug, but should also be easy to fix.
Reply
#4

On a side note, does anyone know if drive-bys (driver or passenger) are lag compensated? Or is it only on-foot? What about someone on-foot shooting someone in a moving vehicle?
Reply
#5

I guess passenger drivebys are synced, and driver drivebys not (yet), since they call/dont call OnPlayerWeaponShot. From what I know synced shots should always trigger that callback, and there shouldnt be unsynced shots related with the callback as it is freshly added.
Not sure about your second question. Though I guess for GTA's hitdetection theres no big difference if someone is walking or sitting in a car, so if OnPlayerWeaponShot really is directly linked to that client's hitdetection it should also work for guys in vehicles. Would be easy to test that, but im also too lazy right now.
Reply
#6

What about vehicles with guns? (Helicopters)
Reply
#7

The guns on vehicles (seasparrow/hunter guns) work (they call OnPlayerWeaponShot). The reason is WEAPON_M4 IIRC.
Reply
#8

I have just made a very brief test with OnPlayerWeaponShot. I just created a filterscript with this simple code:

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    SendClientMessage(playerid, -1, "OnPlayerWeaponShot has been called");
    return 1;
}
to test if this callback is called from vehicles. When I found it's not I was gonna open a thread, but then I found you MP2 are already reporting this issue.

Quote:
Originally Posted by MP2
Посмотреть сообщение
The guns on vehicles (seasparrow/hunter guns) work (they call OnPlayerWeaponShot). The reason is WEAPON_M4 IIRC.
I have just tested it and armed vehicles (like Rustler, RC Baron, Hydra, Hunter...) do NOT call OnPlayerWeaponShot, just like they don't (at least in previous versions) call OnPlayerGiveDamage. Ohh come on Kalcor, please fix both of these
Reply
#9

Quote:
Originally Posted by Gryphus One
Посмотреть сообщение
I have just made a very brief test with OnPlayerWeaponShot. I just created a filterscript with this simple code:

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    SendClientMessage(playerid, -1, "OnPlayerWeaponShot has been called");
    return 1;
}
to test if this callback is called from vehicles. When I found it's not I was gonna open a thread, but then I found you MP2 are already reporting this issue.


I have just tested it and armed vehicles (like Rustler, RC Baron, Hydra, Hunter...) do NOT call OnPlayerWeaponShot, just like they don't (at least in previous versions) call OnPlayerGiveDamage. Ohh come on Kalcor, please fix both of these
I only tested the seasparrow and hunter, and know it worked. Perhaps you made a mistake, or RC3 changed it. I doubt that though.
Reply
#10

Quote:
Originally Posted by MP2
Посмотреть сообщение
I only tested the seasparrow and hunter, and know it worked. Perhaps you made a mistake, or RC3 changed it. I doubt that though.
I didn't test Seasparrow but I did test Hunter (both gun and rockets) and other vehicles, and the callback wasn't called.
In a filterscript as simple as the one I created there's not much room for mistakes, specially knowing that it worked when shooting on foot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)