• Spectate mode?
    11 replies, posted
I need a spectator system for my gamemode, which is round-based. The round system is ready, however the spectate & setmovetype functions aren't working as I expected them to. Any ideas on how to make a properly working spectate mode? Newly joined players need to start as spectator for example [lua] function VDPlayerJoined(ply) ply:Spectate(OBS_MODE_ROAMING) end hook.Add("PlayerInitialSpawn","VDPlayerJoined",VDPlayerJoined) [/lua] Already tried this, and tried a lot of combinations with movetype, killing before spectating ect, but the player keeps shaking heavily on the ground. Any help is appreciated.
ply:Spectate() only sets the mode, to force them to spectate run this function on initialspawn: [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerSpawnAsSpectator]GM/PlayerSpawnAsSpectator[/url]
[QUOTE=whitestar;49301130]ply:Spectate() only sets the mode, to force them to spectate run this function on initialspawn: [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerSpawnAsSpectator]GM/PlayerSpawnAsSpectator[/url][/QUOTE] Turns out that its still not working. [lua] function VDPlayerJoined(ply) GAMEMODE:PlayerSpawnAsSpectator(ply) end hook.Add("PlayerInitialSpawn","VDPlayerJoined",VDPlayerJoined) [/lua] With and without adding the ply:Spectate() itself. Still shaking heavily on the ground.
Did you set the players move type to spectate?
[QUOTE=boxvader;49301865]Did you set the players move type to spectate?[/QUOTE] What combination should be used exactly? I've tried multiple combinations, including setting move type.
Based on this [URL="https://wiki.garrysmod.com/page/Enums/MOVETYPE"]list[/URL] I believe you are supposed to set the move type to MOVETYPE_OBSERVER
[QUOTE=boxvader;49302064]Based on this [URL="https://wiki.garrysmod.com/page/Enums/MOVETYPE"]list[/URL] I believe you are supposed to set the move type to MOVETYPE_OBSERVER[/QUOTE] I know, I tried observer already, but it gave the same result sadly.
[QUOTE=boxvader;49301865]Did you set the players move type to spectate?[/QUOTE] "Spectator movetype. [B]DO NOT[/B] use this to make player spectate"
[QUOTE=whitestar;49302144]"Spectator movetype. [B]DO NOT[/B] use this to make player spectate"[/QUOTE] It mans to not use it solely to make the person spectate however the move type still needs to be set. Walking is not the right move type for a spectator.
[QUOTE=boxvader;49302173]It mans to not use it solely to make the person spectate however the move type still needs to be set. Walking is not the right move type for a spectator.[/QUOTE] Why not use OBS_MODE_ROAMING in the Spectate function then? The only problem he has right now aint the movement, its the fact that upon touching the ground the view is all shaky, but not when the player is jumping.
That is for setting the type of spectate mode of the player not the move type. Jumping? Where are you getting that info from? All he said in his original post is that the player is shaking on the ground, he mentions nothing about jumping. I assumed he meant the player is stuck on the ground and the camera is just shaking thus why he needed to set the move type.
[QUOTE=boxvader;49302283]That is for setting the type of spectate mode of the player not the move type. Jumping? Where are you getting that info from? All he said in his original post is that the player is shaking on the ground, he mentions nothing about jumping. I assumed he meant the player is stuck on the ground and the camera is just shaking thus why he needed to set the move type.[/QUOTE] I got that info from the community forum hes admin on, sigh. thats why I quoted the text.
Sorry, you need to Log In to post a reply to this thread.