groundunder

User

Joined on Dec 26 2020

GetPlayerLastShotVectors origin with hittype_none
Closed
Snapshot 4.1.4
GetPlayerLastShotVectors should always return the origin of the bullet, whether it hits anything or not. A bullet can't be registered from nowhere. 

  • Give yourself a gun
  • Shoot
  • GetPlayerLastShotVectors()
  • print() the result of GetPlayerLastShotVectors

Add this code to your script and you'll see for yourself:

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { new Float:oX, Float:oY, Float:oZ, Float:hX, Float:hY, Float:hZ; GetPlayerLastShotVectors(playerid, oX, oY, oZ, hX, hY, hZ); printf("[debug] Weaponid: %d, oX:%f, oY:%f, oZ:%f, hX:%f, hY:%f, hZ:%f", weaponid, oX, oY, oZ, hX, hY, hZ); return 1;}

dkluin

Project Leader

Joined on May 11 2016

Posted 3 years ago

You don't have lagcomp enabled. We've had this native enabled for a very long time on our testing servers and we know this works correctly.