[HELP] Spawn - 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: [HELP] Spawn (
/showthread.php?tid=178081)
[HELP] Spawn -
NotoriousMOB - 20.09.2010
I have a problem when players have a house
and they die they were supposed to spawn at their house but they spawn at airport.
Anyone who knows what to change so you spawn at your house after death.
Re: [HELP] Spawn -
DeathOnaStick - 20.09.2010
Use
SetSpawnInfo.
Re: [HELP] Spawn -
NotoriousMOB - 20.09.2010
Still have no idea, where to find the spawn thing in GM
is it "OnPlayerDeath" should it be under this.
Re: [HELP] Spawn -
Mauzen - 20.09.2010
You can also use SetPlayerPos in OnPlayerSpawn (if you do not have it in your gm just add it
https://sampwiki.blast.hk/wiki/OnPlayerSpawn)
if the player has a house, use SetPlayerPos to teleport him there when he spawns.
Re: [HELP] Spawn -
DeathOnaStick - 20.09.2010
No. You use it when the player buys the house and (if you have a login system), when he logs in.
Re: [HELP] Spawn -
NotoriousMOB - 20.09.2010
- The start spawn for all players is the airport
But when a player buys a house, he should spawn at his home and not the airport again.
just to make sure you understand xD
And it has OnPlayerSpawn
shall i just put SetPlayerPos in it?
Re: [HELP] Spawn -
DeathOnaStick - 20.09.2010
Yes i understand. Just use SetSpawnInfo when a player buys a house. Make X, Y, Z the house position and the rest like before.
Re: [HELP] Spawn -
NotoriousMOB - 20.09.2010
So i need to edit it every time a player buys a house.
Re: [HELP] Spawn -
DeathOnaStick - 20.09.2010
Yea. Do a code like this (just a simple example):
pawn Код:
public OnPlayerBuyHouse(playerid, House)
{
SetSpawnInfo(playerid, GetPlayerTeam(playerid), GetPlayerSkin(playerid), HousePos[House][x], HousePos[House][y], HousePos[House][z], HousePos[House][a], 0, 0, 0, 0, 0, 0);
return 1;
}
HousePos is an array, where you store the positions of the house and the angle, that the player should have when spawning at the house.
I hope you understand.