SA-MP Forums Archive
Remove spawn buttons when die.. +REP if help - 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: Remove spawn buttons when die.. +REP if help (/showthread.php?tid=645617)



Remove spawn buttons when die.. +REP if help - sjames - 30.11.2017

When a player connects to the server, I set his spawn info to LSPD. Player spawns correctly.

Every time that the player dies, his skin is set to 0 (CJ), and "Spawn" button and arrows appear like here:
https://i.gyazo.com/1248703ebf791618...3a5d1841d7.jpg

This is my whole GM (you can test yourself):
https://pastebin.com/TXABqNak

How can I please remove these buttons every time? I want a NORMAL SPAWN, not some class selection spawn!


Re: Remove spawn buttons when die.. +REP if help - kAn3 - 30.11.2017

Use TogglePlayerSpectating for it.
NOTE: If you use TogglePlayerSpectating under OnPlayerConnect, be sure to add SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); or you will experience crashings.


Re: Remove spawn buttons when die.. +REP if help - sjames - 30.11.2017

Quote:
Originally Posted by kAn3
Посмотреть сообщение
Use TogglePlayerSpectating for it.
NOTE: If you use TogglePlayerSpectating under OnPlayerConnect, be sure to add SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); or you will experience crashings.
If you look my code, I have it when the textdraw is being shown (when player connects). The issue is when the player dies, later. Are you suggesting me that the player should start spectating when dead? I want him to just normally respawn.


Re: Remove spawn buttons when die.. +REP if help - TakeiT - 30.11.2017

onplayerdeath add spawnplayer.


Re: Remove spawn buttons when die.. +REP if help - sjames - 30.11.2017

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
onplayerdeath add spawnplayer.
1) This makes the "OnPlayerSpawn" be called twice.
2) It removes the deathcam (the camera that hovers over you after death ~3 secs). So player will spawn 0.01s after death, two times, which is not really good looking.


Re: Remove spawn buttons when die.. +REP if help - kAn3 - 30.11.2017

Didnt read still your code but unless you press F4 before dying you should spawn normally. Probably you added something you need to check under OnPlayerDeath.


Re: Remove spawn buttons when die.. +REP if help - sjames - 30.11.2017

Quote:
Originally Posted by kAn3
Посмотреть сообщение
Didnt read still your code but unless you press F4 before dying you should start normally. Probably you added something you need to check...
Test my code, that is all I have. I dont know why the spawn buttons come. I am not pressing F4.

Here: Spawn in LSPD, then die and spawn buttons and all bugged..
https://gyazo.com/f707096533707503ad6c7f53c2898fb5


Re: Remove spawn buttons when die.. +REP if help - ToiletDuck - 01.12.2017

Add SpawnPlayer(playerid); on public OnPlayerRequestClassSpawn