Raised This Month: $ Target: $400
 0% 

Force camera to find next player in Spec Mode.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Paulster1022
Member
Join Date: Apr 2006
Old 08-13-2014 , 09:41   Force camera to find next player in Spec Mode.
Reply With Quote #1

If spectator is not looking at player, it will find next available alive player to spec every second or so.

For example, if I'm spectating... and i go in freelook, my camera will be forced on next available alive player (in firstperson preferably.)

Is this possible? Thx in advance guys.

Last edited by Paulster1022; 08-13-2014 at 09:42.
Paulster1022 is offline
Send a message via AIM to Paulster1022
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 08-13-2014 , 11:13   Re: Force camera to find next player in Spec Mode.
Reply With Quote #2

Check this out
https://forums.alliedmods.net/showpo...50&postcount=2
SpeeDeeR is offline
Paulster1022
Member
Join Date: Apr 2006
Old 08-13-2014 , 12:50   Re: Force camera to find next player in Spec Mode.
Reply With Quote #3

Something similar.... but I want.... if im in freelook mode it will force me to spectate someone. I need this cuz in spectator mode u can freelook regardless of mp_forcechasecam.

*If im in freelook, look for next alive player to spectate. That's it. This seems to be on track though idk.
Paulster1022 is offline
Send a message via AIM to Paulster1022
Paulster1022
Member
Join Date: Apr 2006
Old 08-13-2014 , 18:17   Re: Force camera to find next player in Spec Mode.
Reply With Quote #4

I am able to tell when im not spectating in first person.

Code:
public plugin_init()
{
set_task(1.0, "check_spectating", 123094, "", 0, "b", 0)
}


public check_spectating()
{
	new id = blinkID()

	if(!is_user_connected(id) || cs_get_user_team(id) != CS_TEAM_SPECTATOR)
		return

	if( (1 << pev(id, pev_iuser1)) & ((1 << 1)|(1 << 2)|(1 << 4)))
    	{
        	new player = pev(id, pev_iuser2);
        	if(is_user_alive(player) )
        	{
            		g_target = player
    		}
	}

	else
	{
		client_print(id, print_chat, "Not spectating a Player!")
		// Switch to next alive player. How?

	}
}
*How can i switch camera to next alive player?
I want this because if no players are connected, camera goes to freelook. So every second I want to check if alive player is available....then move camera to alive player.

Last edited by Paulster1022; 08-13-2014 at 18:19.
Paulster1022 is offline
Send a message via AIM to Paulster1022
skodddy
Junior Member
Join Date: Oct 2013
Old 08-13-2014 , 20:47   Re: Force camera to find next player in Spec Mode.
Reply With Quote #5

lol client_cmd(id, "+attack;wait;-attack")
skodddy is offline
Paulster1022
Member
Join Date: Apr 2006
Old 08-13-2014 , 22:06   Re: Force camera to find next player in Spec Mode.
Reply With Quote #6

Quote:
Originally Posted by skodddy View Post
lol client_cmd(id, "+attack;wait;-attack")
*facepalm. +jump changes the mode out of freelook, thx though.
Paulster1022 is offline
Send a message via AIM to Paulster1022
Reply



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

Forum Jump


All times are GMT -4. The time now is 13:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode