OnPlayerClickPlayer Teleport -
kelvin22 - 25.03.2012
OnPlayerClickPlayer Teleport
Functions we're going to use:
OnPlayerClickPlayer
GetPlayerPos
SetPlayerPos
Lets start:
pawn Code:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
// Declare 3 float variables to store the X, Y and Z coordinates in
new Float:x, Float:y, Float:z;
// Use GetPlayerPos, passing the 3 float variables we just created
GetPlayerPos(clickedplayerid, x, y, z);
// SetPlayerPos from: 3 float variables wich we saved
SetPlayerPos(playerid, x,y,z);
return 1;
}
Re: OnPlayerClickPlayer Teleport -
Shabi RoxX - 25.03.2012
The shortest Tutorial :
You just use
pawn Code:
OnPlayerClickPlayer,
GetPlayerPos,
SetPlayerPos
Never explain them by yourself o_O
Re: OnPlayerClickPlayer Teleport -
rbN. - 25.03.2012
Not even a tutorial..
Re: OnPlayerClickPlayer Teleport -
kelvin22 - 25.03.2012
Quote:
Originally Posted by Shabi RoxX
The shortest Tutorial :
You just use
pawn Code:
OnPlayerClickPlayer, GetPlayerPos, SetPlayerPos
Never explain them by yourself o_O
|
What i did explain them, lol?
@RobinOwnz
It's a short one or better to say basic.
Re: OnPlayerClickPlayer Teleport -
Max_Coldheart - 25.03.2012
It is a tutorial.
Re: OnPlayerClickPlayer Teleport -
XStormiest - 06.06.2012
So OnPlayerCkiclPlayer is used for when you want to see the player's connect and click on it no? yes or no..?
Re: OnPlayerClickPlayer Teleport -
Jonny5 - 06.06.2012
hum..
what if your in a vehicle...
or they are in a different interior or world.
Re: OnPlayerClickPlayer Teleport -
kelvin22 - 06.06.2012
@XStormiest OnPlayerClickPlayer is used when a player double-clicks into another player's name on the scoreboard
@Jonny5 Then you need to make the code a bit more complicated
pawn Code:
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;
}
Re: OnPlayerClickPlayer Teleport -
Jonny5 - 06.06.2012
yes i know but others dont,
your teaching here so try to tackle all aspects or problems that might happen
also you have an error in that last code
pawn Code:
world = GetPlayerVirtualWorld(clickedplayerid);
interior = GetPlayerInterior(clickedplayerid);
i changed playerid to clickedplayerid
just trying to help improve ya tut!
Re: OnPlayerClickPlayer Teleport -
kelvin22 - 06.06.2012
Sorry, typing mistake