How do I get/check a players position? + Is this script right?
#3

Not tested, but should work fine:

pawn Код:
CMD:check(playerid, params[])
{
    new targetid;

    new Float:pX,
        Float:pY,
        Float:pZ;

    new string[128];

    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/check (ID)");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player isn't connected.");
   
    GetPlayerPos(targetid, pX, pY, pZ);
    format(string, sizeof(string), "ID %d position: %f, %f, %f", targetid, pX, pY, pZ);
    SendClientMessage(playerid, -1, string);

    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)