[HELP] Spawning
#1

I have it set so that when you choose a new class you spawn at the train station in San Fierro. That works perfectly.

When you logout, eg next to SFPD, then you will log back in and spawn at SFPD. Also when you die you'll then respawn at SFPD.

Does anybody know how to fix this?

Regards,
Worthy
Reply
#2

Not quite sure on the Login thing, but you should make it save his last location into a file.. and OnPlayerConnect, check if that position in that file exists for a player, if it does, set his position there.

And the on player death thing, I think you should use SetSpawnInfo. My best guess.
Reply
#3

Quote:
Originally Posted by IcyBlight
Not quite sure on the Login thing, but you should make it save his last location into a file.. and OnPlayerConnect, check if that position in that file exists for a player, if it does, set his position there.

And the on player death thing, I think you should use SetSpawnInfo. My best guess.
I don't want him to spawn at his last position, that's the thing.
Reply
#4

Oh so what then?

You said "if hes next to SFPD and relog he'll spawn at SFPD"

You want him to spawn at the nearest major building or place when he logs out? Or just at the SFPD?

If you want him to the closest, make a PlayerToPoint or something to the places, and save the closest one as spawn coordinates.

If you want him to always spawn at SFPD when logging in/out, OnPlayerSpawn -> if(check if he has a spawn cords file) -> SetPlayerPos(playerid, SFPD location);

If this isn't what you mean, then I'm sorry but I'm confused
Reply
#5

I'm trying to tell you that the user will spawn at the place they logged out at.
Reply
#6

Under OnPlayerSpawn there's something that makes you spawn at a saved location from a file.
Reply
#7

Its like spawn points?
If i logout at sfpd, ill spawn at sfpd.
If i die, i will spawn at sfpd (Because i visited that spawnpoint latest?)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)