24.08.2008, 20:18
TeleportPlayer();
it also teleportates the vehicle with the player (if they are inside one)
you can set different positions for when the player is using a vehicle, or not.
- telename = the name of the teleport in: "You have been teleported to <name>"
- Vx = Vehicle x coord
- Vy = Vehicle z ...
- Vz
- Va = Vehicle angle
- Px = player x coord
- ...
- interior = the interior where the player teleports to.
usage:
it also teleportates the vehicle with the player (if they are inside one)
you can set different positions for when the player is using a vehicle, or not.
Код:
TeleportPlayer(playerid, telename[], Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior);
- Vx = Vehicle x coord
- Vy = Vehicle z ...
- Vz
- Va = Vehicle angle
- Px = player x coord
- ...
- interior = the interior where the player teleports to.
Код:
stock TeleportPlayer(playerid, telename[], Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior)
{
new Message[128];
format(Message, sizeof(Message), "You have been teleported to /%s", telename);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),Vx,Vy,Vz);
SetVehicleZAngle(GetPlayerVehicleID(playerid),Va);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(GetPlayerVehicleID(playerid),interior);
}
else
{
SetPlayerPos(playerid,Px,Py,Pz);
SetPlayerFacingAngle(playerid,Pa);
SetCameraBehindPlayer(playerid);
}
SetPlayerInterior(playerid, interior);
SendClientMessage(playerid, 0x0066FFAA, Message);
return 1;
}
Код:
if(strcmp(cmdtext, "/Somewhere", true) == 0)
{
TeleportPlayer(playerid, "Somewhere", -2847.1392, 2185.9849, 799.5908, 180.0000, -2838.7273, 2199.9253, 801.7857, 145.0000, 0, 568);
return 1;
}

