X Y Z POS hlep
#1

how can i create a command for example /mypos and shows you ur x y and z postion (needed to crate objects ingame) cuz its a pain in the @$$ to be doing /save all the time plz hellp...
Reply
#2

pawn Код:
new Float:Pos[3],string[32];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
format(string,sizeof(string),"%f %f %f",Pos[0],Pos[1],Pos[2]);
SendClientMessage(playerid,0xFFFFFF,string);
Reply
#3

Quote:
Originally Posted by best_killa
Посмотреть сообщение
how can i create a command for example /mypos and shows you ur x y and z postion (needed to crate objects ingame) cuz its a pain in the @$$ to be doing /save all the time plz hellp...
I have made my very own /getpos command, it works perfectly for me.
pawn Код:
if(strcmp(cmd, "/getpos", true) == 0 || strcmp(cmd, "/getposition", true) == 0)
{
    new StrGetPos[150], Float:X, Float:Z, Float:Y;
    GetPlayerPos(playerid, X, Y, Z);
    format(StrGetPos, sizeof(StrGetPos),"Your Current Position: {0080FF}%f, %f, %f,", X, Y, Z);
    SendClientMessage(playerid, COLOR_WHITE, StrGetPos);
    return 1;
}
Kind Regards,
Rolyy
Reply
#4

sorry but it all works just the error undifined symbol cmd??
Reply
#5

Quote:
Originally Posted by best_killa
Посмотреть сообщение
sorry but it all works just the error undifined symbol cmd??
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/getpos", cmdtext, true, 10) == 0)
{
    new StrGetPos[150], Float:X, Float:Z, Float:Y;
    GetPlayerPos(playerid, X, Y, Z);
    format(StrGetPos, sizeof(StrGetPos),"Your Current Position: {0080FF}%f, %f, %f,", X, Y, Z);
    SendClientMessage(playerid, COLOR_WHITE, StrGetPos);
    return 1;
}
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)