SA-MP Forums Archive
X Y Z POS hlep - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: X Y Z POS hlep (/showthread.php?tid=273963)



X Y Z POS hlep - best_killa - 04.08.2011

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...


Re: X Y Z POS hlep - =WoR=Varth - 04.08.2011

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);



Re: X Y Z POS hlep - Rolyy - 04.08.2011

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


Re: X Y Z POS hlep - best_killa - 04.08.2011

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


Re: X Y Z POS hlep - Horrible - 04.08.2011

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;
}