Get player pos after seting it -
ignas1125 - 30.10.2014
Hi, I cant get my player pos when i set it :/
new Float
![Tongue](images/smilies/razz.gif)
os[3];
SetPlayerFacingAngle(playerid, ExitAngle);
SetPlayerPos(playerid, ExitX, ExitY, ExitZ);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 4.0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
and i spawn at the same position i was
![undecided](images/smilies/neutral.gif)
onlye interior and virtual world changes...
HELP!
Re: Get player pos after seting it -
ignas1125 - 30.10.2014
anyone know what is the problem ?
Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) {
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid)) {
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Re: Get player pos after seting it -
BornHuman - 30.10.2014
Try changing
pawn Код:
GetPlayerPos(playerid, x, y, a);
to
pawn Код:
GetPlayerPos(playerid, x, y, z);
You're getting the z coordinate, but assigning it to variable a which isn't what I think you wnat.
Re: Get player pos after seting it -
Stinged - 31.10.2014
Quote:
Originally Posted by BornHuman
Try changing
pawn Код:
GetPlayerPos(playerid, x, y, a);
to
pawn Код:
GetPlayerPos(playerid, x, y, z);
You're getting the z coordinate, but assigning it to variable a which isn't what I think you wnat.
|
This has nothing to do with the problem.
****** is the creator of that function (GetXYInFrontOfPlayer)
He used "a" instead of "z" as he isn't going to use "z" but he is going to re-assign the angle to "a"
Re: Get player pos after seting it -
Pottus - 31.10.2014
Obviously because the player has not sent an update to the server with their new position.