22.03.2015, 14:30
Quote:
i need help with this pickup code.
when i created a pickup, it doesnt create in front of me, it create under me. i want it to create in front of me when i create one but i cant get this code edit. please help me. |
pawn Код:
new
Float: pPos[4],
Float: dPos[3],
distanceFromPlayer = 1
;
// pPos - player's position,
// dPos - destination position
// distanceFromPlayer - some variable, adjust it for yourself.
GetPlayerPos(
playerid,
pPos[0], pPos[1], pPos[2]
);
GetPlayerFacingAngle(
playerid,
pPos[3]
);
pPos[3] = 360 - pPos[3];
dPos[0] = pPos[0] + distanceFromPlayer * floatsin( pPos[3], degrees ); // x coordinate
dPos[1] = pPos[1] + distanceFromPlayer * floatcos( pPos[3], degrees ); // y coordinate
dPos[2] = pPos[2] + 0.35; // z coordinate
The rest is piece of cake.
Greetings