10.12.2011, 08:32
There are two types of teleports.
On Foot
On Foot + On Vehicle
I will show you both.
On Foot
On Foot + On Vehicle
I will show you both.
pawn Код:
// This is only on foot.
CMD:teleport(playerid, params[])
{
SetPlayerPos(playerid, X, Y, Z);
return 1;
}
// This command is for on foot and vehicle.
CMD:tf2(playerid, params[])
{
new
currentveh,
Float:x,
Float:y,
Float:z,
Float:angle;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
else SetPlayerPos(playerid, X, Y, Z);
currentveh = GetPlayerVehicleID(playerid);
GetVehicleZAngle(currentveh, angle);
SetVehicleZAngle(currentveh, A);
return 1;
}
/* Note:
The Float: X, Y, Z and A should be changed by the coordinates you want.
Connect in-game write
/save teleport1
Note: teleport1 is an example. You can save it with the name you want.
there you want to make the teleport command. Then go to your ...\My Documents\GTA San Andreas User Files\SAMP and open the savedpositions.txt file
You will see something like this
AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
Ofc it would have different numbers. Then you should copy the second, third and fourth numbers becaue it's the X, Y, Z
AddPlayerClass(skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
The fifth numbers is the Angle or A at the command.
I hope it helps! Good Luck
*/