Get player pos after seting it
#1

Hi, I cant get my player pos when i set it :/

new Floatos[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 onlye interior and virtual world changes...
HELP!
Reply
#2

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));
	
}
Reply
#3

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.
Reply
#4

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"
Reply
#5

Obviously because the player has not sent an update to the server with their new position.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)