SA-MP Forums Archive
[Resovled] Cant Spawn In Buildings - 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: [Resovled] Cant Spawn In Buildings (/showthread.php?tid=65934)



[Resovled] Cant Spawn In Buildings - KennethHoegh - 17.02.2009

Hello.

I have tryed (whitout luck) to get my players spawn in a building. (Jeffersons Motel)
But when i go into the building type /save and the insert this line in my gamemode - he/she spawn in the air ?

Код:
public OnPlayerSpawn(playerid)
{
  SetPlayerPos(playerid, 2227.2009,-1150.4501,1025.7969); // Spawn at Unity Station {OK}
	return 1;
}
What is the problem ?

- KennethHoegh


Re: Cant Spawn In Buildings - beckzy - 17.02.2009

Type /interior and use SetPlayerInterior too.


Re: Cant Spawn In Buildings - KennethHoegh - 17.02.2009

Quote:
Originally Posted by BeckzyBoi
Type /interior and use SetPlayerInterior too.
I can fine see something - Its when im in the class selection, then its spawn long up in the air


Re: Cant Spawn In Buildings - KennethHoegh - 18.02.2009

B.U.M.P


Re: Cant Spawn In Buildings - am0k - 18.02.2009

go to Unity station
do /interior to see in wich interior you are.
you need to do SetPlayerInterior(playerid, interior) at OnplayerSpawn()

this way he will spawn in the interior not in the air
but if you use Spawnplayer(playerid) somewhere else do not forget players is set to spawn in an interior


Re: Cant Spawn In Buildings - KennethHoegh - 18.02.2009

Quote:
Originally Posted by am0k
go to Unity station
do /interior to see in wich interior you are.
you need to do SetPlayerInterior(playerid, interior) at OnplayerSpawn()

this way he will spawn in the interior not in the air
but if you use Spawnplayer(playerid) somewhere else do not forget players is set to spawn in an interior
Код:
public OnPlayerSpawn(playerid)
{

  SetPlayerPos(playerid, 2227.1917,-1150.5311,1025.7969); 
  SetPlayerInterior(playerid, 2);
	return 1;
}
How to i know what /interior i should use ?


Re: Cant Spawn In Buildings - beckzy - 18.02.2009

Go to the location and type /interior. That is the interior you need to set for the player.


Re: Cant Spawn In Buildings - KennethHoegh - 18.02.2009

Quote:
Originally Posted by BeckzyBoi
Go to the location and type /interior. That is the interior you need to set for the player.
Nice dude.. Its working now..

Thanks to all the helped me.