Raised This Month: $32 Target: $400
 8% 

No freelook using orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skatz_ws
Junior Member
Join Date: Aug 2019
Old 08-22-2019 , 11:53   No freelook using orpheu
Reply With Quote #1

Hey guys!
PHP Code:
public  Observer_IsValidTarget_Pre( const this, const iTarget, const bool:bOnlyTeam 
{
    if(
is_user_alive(iTarget) && skDia == DIA_ESCONDIDAS)
    {
        if(
get_team(iTarget) != 2)
        {
            static 
idid iTarget;
            while ((
id find_ent_by_class(id"player" )) != iTarget 
            {
                if(
get_team(id) != 2
                    continue;
                
                
OrpheuSetParam(2id);
                break;
            }
        }
    }

I have this orpheu function that blocks terrorist to watch another terrorist, just cts cam in first person, but they are allowed to see the other cameras like freelook etc and I want to block that too if its possible (without changing camera server cvars).
skatz_ws is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-22-2019 , 13:11   Re: No freelook using orpheu
Reply With Quote #2

I do suggest hiding(making them invisible to dead players) them using add to full pack forward.

Also this should be ..
PHP Code:
static idid iTarget
            while ((
id find_ent_by_class(id"player" )) != iTarget )  
            { 
                if(
get_team(id) != 2)  
                    continue; 
                 
                
OrpheuSetParam(2id); 
                break; 
            } 
PHP Code:
       if(get_team(this) == CS_TEAM_T && get_team(iTarget) == CS_TEAM_T) {
            static 
gPlayers[32], pnum;
            
get_players(gPlayerspnum"ahe""CT");
            if(
pnum 0OrpheuSetParam(2gPlayers[0]);
       } 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-22-2019 at 13:32.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
skatz_ws
Junior Member
Join Date: Aug 2019
Old 08-22-2019 , 14:39   Re: No freelook using orpheu
Reply With Quote #3

You use get_team and check if is equal to CS_TEAM?

Last edited by skatz_ws; 08-22-2019 at 14:39.
skatz_ws is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-23-2019 , 00:44   Re: No freelook using orpheu
Reply With Quote #4

Quote:
Originally Posted by skatz_ws View Post
You use get_team and check if is equal to CS_TEAM?
I assumed this is for counter strike isn't it?

Purpose for it, is people to understand ( readability ).

Or you could add a define
PHP Code:
 #define TEAM_TERRORIST 1 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-23-2019 at 00:45.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
skatz_ws
Junior Member
Join Date: Aug 2019
Old 08-27-2019 , 12:36   Re: No freelook using orpheu
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
I do suggest hiding(making them invisible to dead players) them using add to full pack forward.

Also this should be ..
PHP Code:
static idid iTarget
            while ((
id find_ent_by_class(id"player" )) != iTarget )  
            { 
                if(
get_team(id) != 2)  
                    continue; 
                 
                
OrpheuSetParam(2id); 
                break; 
            } 
PHP Code:
       if(get_team(this) == CS_TEAM_T && get_team(iTarget) == CS_TEAM_T) {
            static 
gPlayers[32], pnum;
            
get_players(gPlayerspnum"ahe""CT");
            if(
pnum 0OrpheuSetParam(2gPlayers[0]);
       } 
Sorry, i didnt understand your sugestion in the first place but now I did. How can I make the players invisible using add to full pack forward?
skatz_ws is offline
skatz_ws
Junior Member
Join Date: Aug 2019
Old 08-31-2019 , 07:38   Re: No freelook using orpheu
Reply With Quote #6

PHP Code:
public fwdAddToFullPack_Post(es_handleeenthosthostflagsplayerpSet

   if(!
player
        return 
FMRES_IGNORED
    
    if(
skDia == DIA_ESCONDIDAS 
    
&& !is_user_alive                 (host
    && !(
get_user_flags                (host) & ADMIN_BAN
    && 
is_user_alive                 (es_handle
    && 
cs_get_user_team                (es_handle) & CS_TEAM_CT)
    {
        
set_es(es_handleES_RenderModekRenderTransTexture); 
        
set_es(es_handleES_RenderAmt0); 
    }
     
    return 
FMRES_IGNORED;

I've made this way, it works, but now I want the spectator to see the players if they are in the ct camera
Can someone help? Anyway to check if the spectator is watching on the first person camera, to make the players visible?

Last edited by skatz_ws; 08-31-2019 at 07:38.
skatz_ws is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-31-2019 , 08:04   Re: No freelook using orpheu
Reply With Quote #7

es_handle is not a player index but a handle (key) to retrieve/set info

Param ent / e could be a player index (client/guest)

PHP Code:
#if !defined OBS_IN_EYE
  #define OBS_IN_EYE 4
#endIf

public fwdAddToFullPack_Post(es_handleeenthosthostflagsplayerpSet

   if(!
player || is_user_alive(host)) 
        return 
FMRES_IGNORED
    
    if(
skDia == DIA_ESCONDIDAS 
    
&& pev(hostpev_iuser1) != OBS_IN_EYE
    
&& !(get_user_flags(host) & ADMIN_BAN
    && 
is_user_alive(ent
    && 
cs_get_user_team(ent) == CS_TEAM_CT)
    {
        
set_es(es_handleES_RenderModekRenderTransTexture); 
        
set_es(es_handleES_RenderAmt0); 
    }
     
    return 
FMRES_IGNORED;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-31-2019 at 09:01.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
skatz_ws
Junior Member
Join Date: Aug 2019
Old 08-31-2019 , 14:35   Re: No freelook using orpheu
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
es_handle is not a player index but a handle (key) to retrieve/set info

Param ent / e could be a player index (client/guest)

PHP Code:
#if !defined OBS_IN_EYE
  #define OBS_IN_EYE 4
#endIf

public fwdAddToFullPack_Post(es_handleeenthosthostflagsplayerpSet

   if(!
player || is_user_alive(host)) 
        return 
FMRES_IGNORED
    
    if(
skDia == DIA_ESCONDIDAS 
    
&& pev(hostpev_iuser1) != OBS_IN_EYE
    
&& !(get_user_flags(host) & ADMIN_BAN
    && 
is_user_alive(ent
    && 
cs_get_user_team(ent) == CS_TEAM_CT)
    {
        
set_es(es_handleES_RenderModekRenderTransTexture); 
        
set_es(es_handleES_RenderAmt0); 
    }
     
    return 
FMRES_IGNORED;

It works!! Thanks
skatz_ws is offline
skatz_ws
Junior Member
Join Date: Aug 2019
Old 09-08-2019 , 10:57   Re: No freelook using orpheu
Reply With Quote #9

It's possible to block or make it invisible in overview too?
skatz_ws is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-08-2019 , 14:46   Re: No freelook using orpheu
Reply With Quote #10

Quote:
Originally Posted by skatz_ws View Post
It's possible to block or make it invisible in overview too?
I guess try blocking the forward instead of changing the rendering.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 11:03.


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