16.01.2014, 17:29
I made somethink like grep hook and when I shot vehicle, the pos in callback is 0.0
Log in console from callback:
[19:36:16] BULLET HIT type: 2 with weapon 22. HITID: 1714 POS (-0.269142, 2.660293, 0.314309)
Code:
Vehicle pos:
176.3295,-7.4976,1.6480,180.2088
Log in console from callback:
[19:36:16] BULLET HIT type: 2 with weapon 22. HITID: 1714 POS (-0.269142, 2.660293, 0.314309)
Code:
Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(fX != 0 && fY != 0 && fZ != 0)
{
new Float:a;
GetPlayerFacingAngle(playerid, a);
fX -= floatsin(-a, degrees)/2;
fY -= floatcos(-a, degrees)/2;
SetPlayerPos(playerid, fX, fY, fZ+0.3);
}
printf("BULLET HIT type: %d with weapon %d. HITID: %d POS (%f, %f, %f)", hittype, weaponid, hitid, fX, fY, fZ);
return 1;
}
176.3295,-7.4976,1.6480,180.2088


