OnPlayerClickPlayer Teleport
#1

hi now im going to post fast a topic, because i don't have much time x)
So in my script ... in everyone's script. There is OnPlayerClickPlayer
On the forum i don't find it so i'm going to ask it x)
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
   
    return 1;
}
Ofcouse xD But i want to make:
If someone(/the admin) clicks on a player he/she has to be teleported to him/her. (or maybe just for the admin himself )
So how you do that ?

plz answer me question

SOLVED
Reply
#2

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new Float: X,Float:Y, Float:Z, string[70];
    GetPlayerPos(clickedplayerid, X,Y,Z);
    SetPlayerPos(playerid, X,Y,Z);
    format(string, sizeof(string), "You have teleported to ID: %i", clickedplayerid);
    return 1;
}
Reply
#3

Well i wrote some code and lorenc_ posted but ill post mine anyway as it does other things.

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

    world = GetPlayerVirtualWorld(playerid);
    interior = GetPlayerInterior(playerid);
    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
#4

Yes i would suggest iggy's because its got interior checking and other cool stuff, mines pretty straight of basic (lol took me 20 seconds to type that without pawno -.-)
Reply
#5

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new Float: X,Float:Y, Float:Z, string[70];
    GetPlayerPos(clickedplayerid, X,Y,Z);
    SetPlayerPos(playerid, X,Y,Z);
    format(string, sizeof(string), "You have teleported to ID: %i", clickedplayerid);
    return 1;
}
Quote:
Originally Posted by iggy1
Посмотреть сообщение
Well i wrote some code and lorenc_ posted but ill post mine anyway as it does other things.

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

    world = GetPlayerVirtualWorld(playerid);
    interior = GetPlayerInterior(playerid);
    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;
}
Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
Yes i would suggest iggy's because its got interior checking and other cool stuff, mines pretty straight of basic (lol took me 20 seconds to type that without pawno -.-)
Yeah ok thank you guys ^^ im going to test them both ... maybe someone's don't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)