Show Coords Command Help
#1

Simply stated, I just want to use this command in-game to tell me my coords, but I'm not sure how to display the coords exactly:

pawn Код:
if(strcmp(cmdtext,"/GPS",true) == 0)
    {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid,X,Y,Z);
        SendClientMessage(playerid, 0xFFEE00, "You are at X Y Z.");
        return 1;
    }
I saw the script somewhere on a ****** search and couldn't find it again. It would be useful for my mapping.
Reply
#2

You can use the function format() to format a string and display it together with variables.

pawn Код:
new string[64];
format(string, sizeof(string), "You are at %0.f %0.f %0.f.", X, Y, Z);
SendClientMessage(playerid, 0xFFEE00, string);
Reply
#3

Quote:
Originally Posted by magnusburton
Посмотреть сообщение
You can use the function format() to format a string and display it together with variables

pawn Код:
new string[64];
format(string, sizeof(string), "You are at %0.f %0.f %0.f.", X, Y, Z);
SendClientMessage(playerid, COLOR_WHITE, string);
Testing.

EDIT: Problem solved! Thank you sir for your help.
Reply
#4

if that doesn't work, try using this :
Код:
if(strcmp(cmdtext,"/GPS",true) == 0)
    {
        new Float:X, Float:Y, Float:Z;
        new string[64];
        GetPlayerPos(playerid,X,Y,Z);
        format(string, sizeof(string), "You are at %f %f %f.", X, Y, Z);
        SendClientMessage(playerid, 0xFFEE00, string);
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)