SA-MP Forums Archive
Teleport command help please :=D - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Teleport command help please :=D (/showthread.php?tid=302684)



Teleport command help please :=D - Sfor$ahil - 10.12.2011

Please tell me how to make a simple teleport command for all players in 0.3d with zcmd


Re: Teleport command help please :=D - Max_Coldheart - 10.12.2011

Are you using sscanf?


Re: Teleport command help please :=D - T0pAz - 10.12.2011

CLICK ME


Re: Teleport command help please :=D - doreto - 10.12.2011

PHP код:
CMD:command(playeridparams[]) //name on command
{
    
SetPlayerPos(playerid,Float:x,Float:y,Float:z);// set possition
    
return true;




Re: Teleport command help please :=D - Sfor$ahil - 10.12.2011

Thanks Doerto


Re: Teleport command help please :=D - doreto - 10.12.2011

Quote:
Originally Posted by Sfor$ahil
Посмотреть сообщение
Thanks Doerto
im not Doerto im doreto xD


Re: Teleport command help please :=D - Kostas' - 10.12.2011

There are two types of teleports.
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
*/