/getco ( Getting Player ID's Coordinates )
#3

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
SendClientMessage does not accept all of those additional parameters and cannot be used to format a string, you need to use a function such as format for that, for example:

pawn Код:
new string[128];
format(string, sizeof(string), "Target Coordinates X - %f | Y - %f | Z - %f", poscord[0], poscord[1], poscord[2]);

SendClientMessage(playerid, COLOR_GRAD4, string);
Atleast it does remove the Errors, now my code is

pawn Код:
forward GetLocation(playerid);
public GetLocation(playerid)
{
    new giveplayerid;
    new string[128];
    GetPlayerPos(giveplayerid, poscord[0], poscord[1], poscord[2]);
    SendClientMessage(playerid, COLOR_GRAD4, "Target Coordinates successfully recieved");
    format(string, sizeof(string), "Target Coordinates X - %f | Y - %f | Z - %f", poscord[0], poscord[1], poscord[2]);
    SendClientMessage(playerid, COLOR_GRAD4, string);
    return 1;
}
Works, Thank you
Reply


Messages In This Thread
/getco ( Getting Player ID's Coordinates ) - by Aira - 25.05.2012, 07:36
Re: /getco ( Getting Player ID's Coordinates ) - by JaTochNietDan - 25.05.2012, 07:45
Re: /getco ( Getting Player ID's Coordinates ) - by Aira - 25.05.2012, 07:56

Forum Jump:


Users browsing this thread: 1 Guest(s)