02.04.2019, 13:12
Hi everyone,
I have problem with GetDynamicObjectPos and OnPlayerShootDynamicObject which are not getting coordinates right. I spent few hours trying to find solution but without any luck so I was hopping you guys can help me. You can see at the picture below that script is clearly getting coordinates and distance between player and object wrong.
This is object I created.
This is a code from script.
Any help would be appreciated.
I have problem with GetDynamicObjectPos and OnPlayerShootDynamicObject which are not getting coordinates right. I spent few hours trying to find solution but without any luck so I was hopping you guys can help me. You can see at the picture below that script is clearly getting coordinates and distance between player and object wrong.
This is object I created.
pawn Код:
CreateDynamicObject(19315, 1227.5359, -4454.4858, 23.4837, 0.00000, 0.00000, 0.00000, -1, -1, -1, 300.00, 300.00);
pawn Код:
public OnPlayerShootDynamicObject(playerid, weaponid, objectid, Float:x, Float:y, Float:z)
{
new
Float: fDistance = GetPlayerDistanceFromPoint(playerid, x, y, z),
sString[256],
sString2[256];
format(sString, sizeof(sString), "Weapon %i. Object: %i. Pos of Object: %f, %f, %f", weaponid, objectid, x, y, z);
format(sString2, sizeof(sString2), "Distance between you and Object is %0.2f.", fDistance);
SendClientMessage(playerid, -1, sString);
SendClientMessage(playerid, 0xA9C4E4FF, sString2);
return 1;
}