SetPlayerPos isn't working properly.
#1

Hello, I am using SetPlayerPos to teleport a player to the hitmans base when they press a key, however when I press the defined key it just teleports me to a random position nowhere near the actual co-ordinates the player should be at.

Код:
	if(newkeys == KEY_SECONDARY_ATTACK)
	{
	 	if(IsPlayerInRangeOfPoint(playerid, 10.0,-831.0634,1985.0758,9.4007))
	        {
			SetPlayerPos(playerid, -571.6187, 2003.2090, -360.5818);
			return 1;
		}

It just teleports me to -827.1250,1975.1250,7.6998.
Unless it's because I am teleporting deep beneath the ground and it's bugging out I am totally confused any help is greatly appreciated.
Reply
#2

Probably the coordinates are wrong,go ingame and do /save where you want the player to get teleported.,grab the Coordinates from GTA SA User Files (Saved positions.txt)

AddPlayerClass(287,1127.7100, 2861.0835, 10.8203, 40.7175,0,0,0,0,0,0);

Red part is the coordinates.
Reply
#3

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
Probably the coordinates are wrong,go ingame and do /save where you want the player to get teleported.,grab the Coordinates from GTA SA User Files (Saved positions.txt)

AddPlayerClass(287,1127.7100, 2861.0835, 10.8203, 40.7175,0,0,0,0,0,0);

Red part is the coordinates.
That isn't possible due to the fact that I mapped it in myself and cannot get there to do /save because the coding above doesn't teleport me there, but clicking on one of the objects using Map Construction gives the Co-ordinates that I want the player to be teleported to, so I don't know.
Reply
#4

The problem is exactly that,the map editor can give false coordinates,actually,the player's body will appear cutted of (in other terms,the player is not exactly on the coordinate you want them to be!)right in the object,therefore you are falling on ground,you should go ingame (using test) and doing /save there.
Reply
#5

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
The problem is exactly that,the map editor can give false coordinates,actually,the player's body will appear cutted of (in other terms,the player is not exactly on the coordinate you want them to be!)right in the object,therefore you are falling on ground,you should go ingame (using test) and doing /save there.
I cannot get there mate, I just tried to test pointing at exaclty the position it should be then hit Test and it spawned me at the random location.
Reply
#6

well sir map editor gives you your cameras pos not objects point where you clicked
there is a test button click button click on it to get to the clicked pos
Reply
#7

Quote:
Originally Posted by Abhishek.
Посмотреть сообщение
well sir map editor gives you your cameras pos not objects point where you clicked
there is a test button click button click on it to get to the clicked pos
I am sorry, but I don't understand you. How do I select which point I will be tped to when I click test?
Reply
#8

you written Z coordonate -360.5818, I think this is why setting you in wrong place, its too under position, since the water level is around 0.0
Reply
#9

Quote:
Originally Posted by mineralo
Посмотреть сообщение
you written Z coordonate -360.5818, I think this is why setting you in wrong place, its too under position, since the water level is around 0.0
I thought it must be something along the lines of this. I will change it and thanks to everyone who helped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)