SetPlayerPos [Rep +1]
#1

I made this

pawn Код:
CMD:port(playerid,params[])
{
    #pragma unused params
    SetPlayerPos(playerid,2048.9729,-1908.4037,13.5469);
    return true;
}
pawn Код:
CMD:portback(playerid,params[])
{
    #pragma unused params
    //How do I return to the coordinates where it was when he type / port
    return true;
}
Reply
#2

Save the player's position like this:
pawn Код:
new
    Float: gLastPos[MAX_PLAYERS][3];

//When you use the command:

CMD:port(playerid,params[])
{
    #pragma unused params

    GetPlayerPos(playerid, gLastPos[playerid][0], gLastPos[playerid][1], gLastPos[playerid][2]); // Save the coordinates of his position

    SetPlayerPos(playerid,2048.9729,-1908.4037,13.5469);
    return true;
}

// Return him back to his old location:
CMD:portback(playerid,params[])
{
    #pragma unused params
    //How do I return to the coordinates where it was when he type / port
    SetPlayerPos(playerid, gLastPos[playerid][0], gLastPos[playerid][1], gLastPos[playerid][2]);
    return true;
}
Reply
#3

Thanks man!

I give you 1 reputation
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)