SA-MP Forums Archive
Someone Teach Me to Create A Teleport - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Someone Teach Me to Create A Teleport (/showthread.php?tid=250640)



Someone Teach Me to Create A Teleport - ReDKiiL - 24.04.2011

Anyone can post a Ae Tutorial How to Create A Teleport Refusal Of Dollars. Or Pawn Helping Cause I Need To Make A Teleport and I can not. Thanks.


Re: Someone Teach Me to Create A Teleport - Laronic - 24.04.2011

Fast explained:

Go in game and type /save
then you do /Q and open "Documents / GTA San Andreas User Files / SAMP / savedpositions.txt"
and it should look like:
Код:
AddPlayerClass(0,1133.0504,-2038.4034,69.1000,47.4233,0,0,0,0,0,0); //
The numbers i mared in red is named the X, Y, Z coords if you dont know it :P

then to the command

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1133.0504, -2038.4034, 69.1000);
                SendClientMessage(playerid, 0xFF0000FF, "You has been teleported");
		return 1;
	}
	return 0;
}



Re: Someone Teach Me to Create A Teleport - nuriel8833 - 24.04.2011

Quote:
Originally Posted by CyberGhost
Посмотреть сообщение
Fast explained:

Go in game and type /save
then you do /Q and open "Documents / GTA San Andreas User Files / SAMP / savedpositions.txt"
and it should look like:
Код:
AddPlayerClass(0,1133.0504,-2038.4034,69.1000,47.4233,0,0,0,0,0,0); //
The numbers i mared in red is named the X, Y, Z coords if you dont know it :P

then to the command

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1133.0504, -2038.4034, 69.1000);
                SendClientMessage(playerid, 0xFF0000FF, "You has been teleported");
		return 1;
	}
	return 0;
}
**Continuation:
Код:
AddPlayerClass(0,1133.0504,-2038.4034,69.1000,47.4233,0,0,0,0,0,0); //
The number in blue is the angle of the player,the angle tells you what does the player look at.
For example:
If the players looks to the North - His angle is 0/360 (its the same)
If the players looks to the West - His angle is 90
If the players looks to the South - His angle is 180
If the players looks to the East - His angle is 270

Now,to make the player teleport in a specific angle,do this:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1133.0504, -2038.4034, 69.1000);
                SetPlayerFacingAngle(playerid,47.4233);
                SendClientMessage(playerid, 0xFF0000FF, "You has been teleported");
		return 1;
	}
	return 0;
}
Got it?


Re: Someone Teach Me to Create A Teleport - captainjohn - 24.04.2011

Look here https://sampforum.blast.hk/showthread.php?tid=230341 shows you how to create a teleport command with extras.