How to find position
#1

How do i find the position of the player like the codes Get the X Y Z coordinates of a player.
Example: SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);

So my question is how do i find the current position of the player like something that says the player position codes like
2475.6655,-1662.9609,13.3326

So thats the question maybe when you type a command it comes the player position codes or something like that.

I would really appreciate if someone can help,
Reply
#2

Код:
//... On command
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
// You can now use x,y, and z as the players position for SetPlayerPos,etc.
there you go
Reply
#3

First create a local veriable

pawn Код:
new  Float:x, Float:y, Float:z;
then use
pawn Код:
GetPlayerPos(playerid, x, y, z);
Reply
#4

So how do i create a command for this.
Code:
Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
Can you make like when i type /pos the position codes come up?
Reply
#5

Sure.

Код:
CMD:pos(playerid,params[])
{
	new Float:x, Float:y, Float:z, msg[254];
	GetPlayerPos(playerid,x,y,z);
	format(msg,sizeof(msg),"Your current pos: X:%d Y:%d Z:%d",x,y,z);
	SendClientMessage(playerid,-1,msg);
	return 1;
}
Reply
#6

pawn Код:
CMD:pos(playerid, params[])
{
    new Message[200], Float:x, Float:y, Float:z;

    GetPlayerPos(playerid, x, y, z);
    format(Message, sizeof(Message), "Location: X%4.2f, Y%4.2f, Z%4.2f", x, y, z);
    SendClientMessage(playerid, 0xFFFFFFFF, Message);
    return 1;
}
Try that, i haven't tested. Tell me if it works.

Edit: lol again he was faster then me, oh well
Reply
#7

Quote:
Originally Posted by driftg0d
Посмотреть сообщение
Sure.

Код:
CMD:pos(playerid,params[])
{
	new Float:x, Float:y, Float:z, msg[254];
	GetPlayerPos(playerid,x,y,z);
	format(msg,sizeof(msg),"Your current pos: X:%d Y:%d Z:%d",x,y,z);
	SendClientMessage(playerid,-1,msg);
	return 1;
}
Ok thanks i will give rep but i need to wait 24 hours ill give after that remind me


And this:
Код:
CMD:pos(playerid, params[])
{
    new Message[200], Float:x, Float:y, Float:z;

    GetPlayerPos(playerid, x, y, z);
    format(Message, sizeof(Message), "Location: X%4.2f, Y%4.2f, Z%4.2f", x, y, z);
    SendClientMessage(playerid, 0xFFFFFFFF, Message);
    return 1;
}
Ill try it thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)