SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 29/07/2020, 05:31 AM   #1
Little Clucker
Join Date: Jan 2018
Posts: 44
Reputation: 0
Exclamation TogglePlayerSpectating BUG

Apparently I have a problem with this function, I use this function in OnPlayerRequestClass
Toggleplayerspectating (playerid, 1) to remove spawn buttons, and I have a texdraw when selecting texdraw does this toggleplayerspectating (playerid, 0) to spawn but when spawning my character dies, any solution?
Daynox12 is offline   Reply With Quote
Old 29/07/2020, 10:46 AM   #2
Huge Clucker
SkyFlare's Avatar
Join Date: Apr 2015
Location: NZ
Posts: 221
Reputation: 43
Default Re: TogglePlayerSpectating BUG

When spectator mode is disabled, OnPlayerSpawn will automatically be called, if you wish to restore player to state before spectating, you will have to handle that in OnPlayerSpawn. Note also, that player can also go to class selection before if they used F4 during spectate, a player also CAN die in spectate mode due to various glitches.
If you need to spawn a player while they are in spectating mode, do use TogglePlayerSpectating and not SpawnPlayer. Otherwise they won't be spawned and instead will show the player flying mid-air

also check out this tutorial here on how to successfully remove the spawn buttons.
Purchasable Scripting Services Available, Inbox me with your Requests.
My Project Progress Tracker
My Work
S-Store System V2 LinkIngame Store in Dialogs
SkyFlare is offline   Reply With Quote
Old 29/07/2020, 02:53 PM   #3
Little Clucker
Join Date: Jan 2018
Posts: 44
Reputation: 0
Default Re: TogglePlayerSpectating BUG

apparently the only thing missing was to set the health to 100 and it works perfect, this is because when using this function, is the health at 0?
Daynox12 is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
TogglePlayerSpectating() Dreamerzzz Русский/Russian 3 18/08/2014 09:17 PM
TogglePlayerSpectating Sarra Scripting Help 3 15/08/2014 12:24 PM
[HELP] toggleplayerspectating Luca12 Scripting Help 7 31/01/2014 11:30 PM
TogglePlayerSpectating help .. OTACON Scripting Help 2 13/01/2014 04:02 AM
TogglePlayerSpectating help! Help Archive 1 16/12/2009 02:51 PM

All times are GMT. The time now is 02:17 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.