[HELP] Spawn
#1

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.
Reply
#2

Use SetSpawnInfo.
Reply
#3

Still have no idea, where to find the spawn thing in GM
is it "OnPlayerDeath" should it be under this.
Reply
#4

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.
Reply
#5

No. You use it when the player buys the house and (if you have a login system), when he logs in.
Reply
#6

- 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?
Reply
#7

Yes i understand. Just use SetSpawnInfo when a player buys a house. Make X, Y, Z the house position and the rest like before.
Reply
#8

So i need to edit it every time a player buys a house.
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)