Raised This Month: $ Target: $400
 0% 

[CS:S]Is it possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ofir753
Senior Member
Join Date: Aug 2012
Old 12-03-2013 , 15:35   [CS:S]Is it possible?
Reply With Quote #1

Is it possible to make player visible for only one player?
Example:There is 20 players in the server.
And i can only see/hear him and he only can see/hear me and the other players cannot see us.
ofir753 is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 12-03-2013 , 15:40   Re: [CS:S]Is it possible?
Reply With Quote #2

Yes, should be possible by modifing datamap on per player base. search the extensions forums.
Chrisber is offline
ofir753
Senior Member
Join Date: Aug 2012
Old 12-03-2013 , 15:52   Re: [CS:S]Is it possible?
Reply With Quote #3

Quote:
Originally Posted by Chrisber View Post
Yes, should be possible by modifing datamap on per player base. search the extensions forums.
I am sorry but i dont know what to search for.
ofir753 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 12-03-2013 , 16:29   Re: [CS:S]Is it possible?
Reply With Quote #4

Would SDKHooks work using settransmit?
__________________
View my Plugins | Donate
TnTSCS is offline
ofir753
Senior Member
Join Date: Aug 2012
Old 12-03-2013 , 16:31   Re: [CS:S]Is it possible?
Reply With Quote #5

Quote:
Originally Posted by TnTSCS View Post
Would SDKHooks work using settransmit?
I dont think so it will settransimt for all the players in the server
ofir753 is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 12-03-2013 , 16:59   Re: [CS:S]Is it possible?
Reply With Quote #6

Code:
#include <sourcemod>
#include <sdkhooks>

#pragma semicolon 1

new Handle:gH_Array[MAXPLAYERS+1];

public Plugin:myinfo = 
{
    name = "Hide some players",
    author = "shavit",
    version = "1.0"
}

public OnPluginStart()
{
    LoadTranslations("common.phrases");
    
    RegConsoleCmd("sm_hideplayer", Command_Hideplayer);
}

public OnClientPutInServer(client)
{
    gH_Array[client] = CreateArray(MaxClients, 1);
    
    SDKHook(client, SDKHook_SetTransmit, SetTransmit);
}

public OnClientDisconnect(client)
{
    if(gH_Array[client] != INVALID_HANDLE)
    {
        CloseHandle(gH_Array[client]);
        
        gH_Array[client] = INVALID_HANDLE;
    }
}

public Action:SetTransmit(entity, client) 
{ 
    if(gH_Array[client] != INVALID_HANDLE && client != entity && IsValidClient(client) && IsValidClient(entity, true))
    {
        if(FindValueInArray(gH_Array[client], entity) != -1)
        {
            return Plugin_Handled;
        }
    }
    
    return Plugin_Continue;
}

public Action:Command_Hideplayer(client, args)
{
    if(!args)
    {
        ReplyToCommand(client, "\x04[SM]\x01 Usage: sm_hideplayer <target>");
        
        return Plugin_Handled;
    }
    
    new String:arg[MAX_TARGET_LENGTH];
    GetCmdArg(1, arg, MAX_TARGET_LENGTH);
    
    new target = FindTarget(client, arg, false, false);
    
    if(target == -1)
    {
        return Plugin_Handled;
    }
    
    new index = FindValueInArray(gH_Array[client], target);
    
    if(index == -1)
    {
        PushArrayCell(gH_Array[client], target);
        
        ReplyToCommand(client, "\x04[SM]\x01 You are now hiding \x05%N\x01.", target);
    }
    
    else
    {
        RemoveFromArray(gH_Array[client], index);
        
        ReplyToCommand(client, "\x04[SM]\x01 You are not hiding \x05%N\x01 anymore.", target);
    }
    
    return Plugin_Handled;
}

/**
* Checks if client is valid, ingame and safe to use.
*
* @param client            Client index.
* @param alive            Check if the client is alive.
* @return                True if the user is valid.
*/
stock bool:IsValidClient(client, bool:alive = false)
{
    return (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (alive == false || IsPlayerAlive(client)));
}
That should work, hope you got the idea.

About that only you can hear each other, look at SetListenOverride. (sdktools_voice.inc)
Code:
/**
 * Override the receiver's ability to listen to the sender.
 *
 * @param iReceiver        The listener index.
 * @param iSender        The sender index.
 * @param override        The override of the receiver's ability to listen to the sender.
 * @return            True if successful otherwise false.
 */
native bool:SetListenOverride(iReceiver, iSender, ListenOverride:override);
__________________
retired

Last edited by shavit; 12-03-2013 at 17:00.
shavit is offline
Smffy
Senior Member
Join Date: Sep 2012
Old 12-03-2013 , 20:48   Re: [CS:S]Is it possible?
Reply With Quote #7

Is a crude method also just to set the player alpha to 0 0 0 0 for all but conditionally that if one player is flagged they still see normal 255 255 255 255 alphas? I guess it depends on what this is for... If its for one team to be invisible that would do but you would need to suppress the radar and shadows etc which is less simple.
Smffy is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 12-03-2013 , 22:27   Re: [CS:S]Is it possible?
Reply With Quote #8

Alpha is just one entry of the four render options; the other three are Red Green Blue values. Setting them all to 0 would work, but if he happened to become visible again he would be painted black. I am not sure if you can set a render on a per-client basis. When you change the render settings of an entity, it changes it completely, meaning that everyone now sees that entity with those settings. I do not believe you can make certain entities appear a certain way to specific people.
Marcus_Brown001 is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 12-04-2013 , 02:31   Re: [CS:S]Is it possible?
Reply With Quote #9

Define "hear the other player". Do you mean voicechat only, or also in game sounds?
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
ofir753
Senior Member
Join Date: Aug 2012
Old 12-04-2013 , 07:39   Re: [CS:S]Is it possible?
Reply With Quote #10

Quote:
Originally Posted by Dr. Greg House View Post
Define "hear the other player". Do you mean voicechat only, or also in game sounds?
In game sound:footsteps, gun sound.....
ofir753 is offline
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 19:16.


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