Raised This Month: $81 Target: $400
 20% 

Only one team can see names on crosshair


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cuttlas
Senior Member
Join Date: Jan 2015
Old 11-28-2023 , 03:30   Only one team can see names on crosshair
Reply With Quote #1

I can change the mp_playerid to 1, but then every team can only see their teammates on the crosshair.

I need only CT can see names on crosshair (they can see names on both teams on crosshair), and terror can not.

or only admins can see names on crosshair...

is there any way to do this by amxmodx scripting?
__________________
To Infinity n Beyond

Last edited by Cuttlas; 11-28-2023 at 03:32.
Cuttlas is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-28-2023 , 04:54   Re: Only one team can see names on crosshair
Reply With Quote #2

PHP Code:
const Offset_m_flNextSBarUpdateTime 449;
set_pdata_float(playerOffset_m_flNextSBarUpdateTimefGameTime 99999.0); 
__________________
@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
Cuttlas
Senior Member
Join Date: Jan 2015
Old 11-28-2023 , 05:10   Re: Only one team can see names on crosshair
Reply With Quote #3

thank you bro, on which event should i use set_pdata_float?

could you please show me more code? I'm in beginner level
__________________
To Infinity n Beyond
Cuttlas is offline
WATCH_D0GS UNITED
Member
Join Date: Jan 2023
Old 11-28-2023 , 20:36   Re: Only one team can see names on crosshair
Reply With Quote #4

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Player Status X","1.0","Scripting Help")
    
register_message(get_user_msgid("StatusValue"), "Event_StatusValue")
}

public 
Event_StatusValue(msg_idmsg_destid)
{
    if (
get_user_team(id) == 2)
    {
        return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_CONTINUE

__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is online now
Cuttlas
Senior Member
Join Date: Jan 2015
Old 11-29-2023 , 06:29   Re: Only one team can see names on crosshair
Reply With Quote #5

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Player Status X","1.0","Scripting Help")
    
register_message(get_user_msgid("StatusValue"), "Event_StatusValue")
}

public 
Event_StatusValue(msg_idmsg_destid)
{
    if (
get_user_team(id) == 2)
    {
        return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_CONTINUE


thank you, bro, but with your code, if a player is on CT, then he can not see his teammate's names either.

let me explain more clearly:

- if a player is in Terror, he CAN NOT see his teammates' names on the crosshairs. but He can see the CT names on the crosshair.

- and a CT player can see only his teammates' names on the crosshairs. he can not see any terror players name on the crosshair.

I want to achieve this.
__________________
To Infinity n Beyond
Cuttlas is offline
Cuttlas
Senior Member
Join Date: Jan 2015
Old 11-29-2023 , 07:33   Re: Only one team can see names on crosshair
Reply With Quote #6

@WATCH_D0GSUNITED do you know how to get the aimer and aimed player ID in Event_StatusValue? I think then I can do it what I want
__________________
To Infinity n Beyond
Cuttlas is offline
Old 11-29-2023, 07:38
WATCH_D0GS UNITED
This message has been deleted by WATCH_D0GS UNITED. Reason: :
WATCH_D0GS UNITED
Member
Join Date: Jan 2023
Old 11-29-2023 , 08:38   Re: Only one team can see names on crosshair
Reply With Quote #7

V2 EDIT

PHP Code:
#include <amxmodx>

static target,body,i_team,tgt_team

public plugin_init()
{
    
register_plugin("Status X","2.0","Scripting Help")
    
register_message(get_user_msgid("StatusValue"), "Event_Status_X")
    
register_message(get_user_msgid("StatusText"), "Event_Status_X")
}

public 
Event_Status_X(msg_idmsg_destid)
{
    
get_user_aiming(id,target,body,9999)
    if(
31 >= target 0) {
        
tgt_team get_user_team(target)
        
i_team get_user_team(id)
        if (
i_team == && i_team != tgt_team || i_team == && i_team == tgt_team)
        {
            return 
PLUGIN_HANDLED
        
}
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE

There might be a different way for this, but this one works well.
If you find any bug please let us know.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com

Last edited by WATCH_D0GS UNITED; 11-29-2023 at 14:20.
WATCH_D0GS UNITED is online now
Cuttlas
Senior Member
Join Date: Jan 2015
Old 11-29-2023 , 16:06   Re: Only one team can see names on crosshair
Reply With Quote #8

thank you bro, works like a charm
__________________
To Infinity n Beyond
Cuttlas is offline
Cuttlas
Senior Member
Join Date: Jan 2015
Old 12-02-2023 , 16:36   Re: Only one team can see names on crosshair
Reply With Quote #9

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
V2 EDIT

PHP Code:
#include <amxmodx>

static target,body,i_team,tgt_team

public plugin_init()
{
    
register_plugin("Status X","2.0","Scripting Help")
    
register_message(get_user_msgid("StatusValue"), "Event_Status_X")
    
register_message(get_user_msgid("StatusText"), "Event_Status_X")
}

public 
Event_Status_X(msg_idmsg_destid)
{
    
get_user_aiming(id,target,body,9999)
    if(
31 >= target 0) {
        
tgt_team get_user_team(target)
        
i_team get_user_team(id)
        if (
i_team == && i_team != tgt_team || i_team == && i_team == tgt_team)
        {
            return 
PLUGIN_HANDLED
        
}
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE

There might be a different way for this, but this one works well.
If you find any bug please let us know.
Sometimes, it will show the player's name at the start of the round, but it will fix some seconds later. what do you think?
__________________
To Infinity n Beyond
Cuttlas is offline
WATCH_D0GS UNITED
Member
Join Date: Jan 2023
Old 12-02-2023 , 17:23   Re: Only one team can see names on crosshair
Reply With Quote #10

Never occurred here.
Only if aiming a player in long ranges, rarely occurs.
Take in note that this is something already buggy in the game, like when you keep the crosshair position and the targeted player moves, it still show when it shouldn't.
Another problem is when you aim to a player close to another, the text of the previous player will appear when aiming the other.
But we will take another look at this soon.
WATCH_D0GS UNITED is online now
Reply


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

Forum Jump


All times are GMT -4. The time now is 15:01.


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