retrieving data from a three dimensional array
#1

I made a 3 dimensional array to store coordinates of 2 spawn points, its not setting the player's position to the specified coords, here is the code:


Код:
new Float:HOUSE [1][2][4] = {

	 { {2492.4282, -1702.2996, 1018.3438, 179.5183}, {2495.9780, -1707.2451, 1014.7422, 0.000000} } // This stores the two spawn points in the CJ's house (including the facing angle[s])

};

// This array is supposed to store two spawn points for each house in the array, and in this case there is only once house (currently) which is CJ's house.
// Here 'extra' variable is the house indicating the first house or the first item '0' in the list/array.
// The 'team' variable shows which spawn point to select from the 2 specified points.
// And the last thing is the x,y,z pos in order of 0,1,2 in the array


SetPlayerPos (playerid, HOUSE [extra][team][0], HOUSE [extra][team][1], HOUSE [extra][team][2]);
SetPlayerFacingAngle (playerid, HOUSE [extra][team][3]);
There is no problem with the interior, im setting the right interior of the player in order to teleport the player to the CJ's house but the problem is the player is teleported to the void, far away from cj's house (its not even visible) which imply that its setting the position to somewhere else or not changing the player's position at all,
Reply
#2

Are you sure, you're using the correct interior ID (which is 3 in this case)? Because your code is correct + I've tested it and it works.

EDIT:
Here's a fiddle: click.
Reply
#3

Oh, sorry im so dumb lol it was another minor mistake.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)