SA-MP Forums Archive
Death SetSpawnInfo seems to not work. - 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)
+--- Thread: Death SetSpawnInfo seems to not work. (/showthread.php?tid=614205)



Death SetSpawnInfo seems to not work. - Luicy. - 05.08.2016

So well, The
SetSpawnInfo wont set my spawninfo, It wont set my coordinates, or give me the bat and 9mm..
But it do SpawnPlayer me.

Full file;
http://pastebin.com/jDxJE76Y


Re: Death SetSpawnInfo seems to not work. - Luicy. - 06.08.2016

Gonna go ahead and 'bump' this.


Re: Death SetSpawnInfo seems to not work. - SickAttack - 06.08.2016

You have to use the function before spawning.


Re: Death SetSpawnInfo seems to not work. - Luicy. - 06.08.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
You have to use the function before spawning.
If you'd read the file you would see I did.


Re: Death SetSpawnInfo seems to not work. - Shinja - 06.08.2016

Quote:
Originally Posted by Meller
Посмотреть сообщение
But it do SpawnPlayer me.
http://pastebin.com/jDxJE76Y
Ofc you will be spawned after death, but does it gives also score and money successfully?


Re: Death SetSpawnInfo seems to not work. - SickAttack - 06.08.2016

Try killing the player instead of using SpawnPlayer. If it doesn't work, just use SetPlayerPos and so forth. Or try setting a timer then use SpawnPlayer.


Re: Death SetSpawnInfo seems to not work. - Luicy. - 06.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Ofc you will be spawned after death, but does it gives also score and money successfully?
Get your facts right you don't get auto spawned, on death regullarly you have to click on Spawn.


Re: Death SetSpawnInfo seems to not work. - Nero_3D - 06.08.2016

You get autospawned after death as it always has been, otherwise you prevent it by script (it seem you have somewhere ForceClassSelection)

Here are way to many open question, why is it delayed, why is it in OnPlayerDeath not in OnPlayerSpawn (is the player able to switch classes while being alive?), do you have in OnPlayerSpawn something that works against it like SetPlayerPos and ResetPlayerWeapons? Doesn't OnPlayerDeath has a reason parameter ? Does the code even get called (maybe the hook isn't working)?

Put SetSpawnInfo in OnPlayerDeath in a new pwn file and test it than you know if it works or not


Re: Death SetSpawnInfo seems to not work. - Luicy. - 06.08.2016

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
You get autospawned after death as it always has been, otherwise you prevent it by script (it seem you have somewhere ForceClassSelection)

Here are way to many open question, why is it delayed, why is it in OnPlayerDeath not in OnPlayerSpawn (is the player able to switch classes while being alive?), do you have in OnPlayerSpawn something that works against it like SetPlayerPos and ResetPlayerWeapons? Doesn't OnPlayerDeath has a reason parameter ? Does the code even get called (maybe the hook isn't working)?

Put SetSpawnInfo in OnPlayerDeath in a new pwn file and test it than you know if it works or not
I do not have ForceClassSeleciton,
It is delayed to in order show the death thingy from gta sadefault,
No he's not able to switch, they must use /changeteam
Never used OnPlayerSpawn in my gamemode.
OnPlayerdeath do have a reason parameter, but this works fine.
The hooking is fine.


Re: Death SetSpawnInfo seems to not work. - SickAttack - 06.08.2016

Doing this works:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetSpawnInfo(playerid, 0, 0, 2512.9407, -1665.5356, 13.5741, 94.9650, 5, 1, 22, 500, 0, 0);
    return 1;
}
Remove SpawnPlayer(playerid); and let the player respawn automatically.