AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Force camera to find next player in Spec Mode. (https://forums.alliedmods.net/showthread.php?t=246189)

Paulster1022 08-13-2014 09:41

Force camera to find next player in Spec Mode.
 
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.

SpeeDeeR 08-13-2014 11:13

Re: Force camera to find next player in Spec Mode.
 
Check this out
https://forums.alliedmods.net/showpo...50&postcount=2

Paulster1022 08-13-2014 12:50

Re: Force camera to find next player in Spec Mode.
 
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 08-13-2014 18:17

Re: Force camera to find next player in Spec Mode.
 
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.

skodddy 08-13-2014 20:47

Re: Force camera to find next player in Spec Mode.
 
lol client_cmd(id, "+attack;wait;-attack")

Paulster1022 08-13-2014 22:06

Re: Force camera to find next player in Spec Mode.
 
Quote:

Originally Posted by skodddy (Post 2183694)
lol client_cmd(id, "+attack;wait;-attack")

*facepalm. +jump changes the mode out of freelook, thx though.


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

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