OnPlayerClickPlayer.
#1

When i Click a player in the tab menu, how to teleport to him ?

Can anyone help me?
Reply
#2

Is this right ?

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new
        world,interior,
        Float:x, Float:y, Float:z, Float:angle;

    world = GetPlayerVirtualWorld(clickedplayerid);
    interior = GetPlayerInterior(clickedplayerid);
    GetPlayerPos(clickedplayerid, x, y, z);
    GetPlayerFacingAngle(clickedplayerid, angle);

    SetPlayerPos(playerid, x, y, z+0.2);
    SetPlayerFacingAngle(playerid, angle);
    SetCameraBehindPlayer(playerid);
    SetPlayerVirtualWorld(playerid, world);
    SetPlayerInterior(playerid, interior);
    return 1;
}
Reply
#3

Edit: Beat me to it.

- Plus, you added more stuff than me. Wasn't thinking about VW's and Interiors and shit.
Reply
#4

Quote:
Originally Posted by Edin Black
Посмотреть сообщение
Is this right ?

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new
        world,interior,
        Float:x, Float:y, Float:z, Float:angle;

    world = GetPlayerVirtualWorld(clickedplayerid);
    interior = GetPlayerInterior(clickedplayerid);
    GetPlayerPos(clickedplayerid, x, y, z);
    GetPlayerFacingAngle(clickedplayerid, angle);

    SetPlayerPos(playerid, x, y, z+0.2);
    SetPlayerFacingAngle(playerid, angle);
    SetCameraBehindPlayer(playerid);
    SetPlayerVirtualWorld(playerid, world);
    SetPlayerInterior(playerid, interior);
    return 1;
}
This is perfect so, but i don't think that you have to add "SetCameraBehindPlayer" function, unless if you have something such as tutorials that you use for it SetPlayerCameraPos etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)