07.11.2018, 18:18
Hey guys,
Im trying to improve my logic abilities, unfortunately Im stuck...
I've read a few lines of this: https://en.wikipedia.org/wiki/Atan2
But as it's said in the subject, my math sucks, so... could somebody here make the exact picture like it's on wiki, but with player standing and looking at the point?
I've made this ... (with an inspiration from https://sampforum.blast.hk/showthread.php?tid=517551 )
It's not much of a code, but I can't continue, if I don't understand that.
Those numbers I get... What are they for?
Thanks
edit. I know what Player Pos is... Im trying to get through big bosses. And math is one of them.
Im trying to improve my logic abilities, unfortunately Im stuck...
I've read a few lines of this: https://en.wikipedia.org/wiki/Atan2
But as it's said in the subject, my math sucks, so... could somebody here make the exact picture like it's on wiki, but with player standing and looking at the point?
I've made this ... (with an inspiration from https://sampforum.blast.hk/showthread.php?tid=517551 )
PHP код:
stock IsPlayerFacingVehicle(playerid, Float:vX, Float:vY){
new
Float:pX ,
Float:pY ,
Float:pZ ,
Float:pA ,
Float:aftan ,
str[36]
;
GetPlayerPos(playerid, pX, pY, pZ); GetPlayerFacingAngle(playerid, pA);
if(pX !=0.0 && pY != 0.0 && pZ != 0.0){
aftan = atan2(pX - vX, pY - vY);
format(str, sizeof(str), "pX: %f, pY: %f - vX: %f, vY: %f", pX, pY, vX, vY); SendClientMessage(playerid, -1, str);
format(str, sizeof(str), "AFTER TAN: %f", aftan); SendClientMessage(playerid, -1, str);
format(str, sizeof(str), "FACING ANGLE: %f", pA); SendClientMessage(playerid, -1, str);
pA -= aftan;
format(str, sizeof(str), "FACING ANGLE AFTER: %f", pA); SendClientMessage(playerid, -1, str);
}
return false;
}
Those numbers I get... What are they for?
Thanks

edit. I know what Player Pos is... Im trying to get through big bosses. And math is one of them.