AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [Tutorial][CSS] Radar spot edit! (https://forums.alliedmods.net/showthread.php?t=135788)

javalia 08-19-2010 15:30

[Tutorial][CSS] Radar spot edit!
 
on this post, i will give u some way to make u able to edit radar info of player.

first, see this thing

Code:


Sub-Class Table (2 Deep): m_bPlayerSpotted
  -Member: 000 (offset 0) (type integer) (bits 1)
  -Member: 001 (offset 1) (type integer) (bits 1)
  -Member: 002 (offset 2) (type integer) (bits 1)
  -Member: 003 (offset 3) (type integer) (bits 1)
  -Member: 004 (offset 4) (type integer) (bits 1)
  -Member: 005 (offset 5) (type integer) (bits 1)
  -Member: 006 (offset 6) (type integer) (bits 1)
  -Member: 007 (offset 7) (type integer) (bits 1)
  -Member: 008 (offset 8) (type integer) (bits 1)
  -Member: 009 (offset 9) (type integer) (bits 1)
  -Member: 010 (offset 10) (type integer) (bits 1)
  -Member: 011 (offset 11) (type integer) (bits 1)
  -Member: 012 (offset 12) (type integer) (bits 1)
  -Member: 013 (offset 13) (type integer) (bits 1)
  -Member: 014 (offset 14) (type integer) (bits 1)
  -Member: 015 (offset 15) (type integer) (bits 1)
  -Member: 016 (offset 16) (type integer) (bits 1)
  -Member: 017 (offset 17) (type integer) (bits 1)
  -Member: 018 (offset 18) (type integer) (bits 1)
  -Member: 019 (offset 19) (type integer) (bits 1)
  -Member: 020 (offset 20) (type integer) (bits 1)
  -Member: 021 (offset 21) (type integer) (bits 1)
  -Member: 022 (offset 22) (type integer) (bits 1)
  -Member: 023 (offset 23) (type integer) (bits 1)
  -Member: 024 (offset 24) (type integer) (bits 1)
  -Member: 025 (offset 25) (type integer) (bits 1)
  -Member: 026 (offset 26) (type integer) (bits 1)
  -Member: 027 (offset 27) (type integer) (bits 1)
  -Member: 028 (offset 28) (type integer) (bits 1)
  -Member: 029 (offset 29) (type integer) (bits 1)
  -Member: 030 (offset 30) (type integer) (bits 1)
  -Member: 031 (offset 31) (type integer) (bits 1)
  -Member: 032 (offset 32) (type integer) (bits 1)
  -Member: 033 (offset 33) (type integer) (bits 1)
  -Member: 034 (offset 34) (type integer) (bits 1)
  -Member: 035 (offset 35) (type integer) (bits 1)
  -Member: 036 (offset 36) (type integer) (bits 1)
  -Member: 037 (offset 37) (type integer) (bits 1)
  -Member: 038 (offset 38) (type integer) (bits 1)
  -Member: 039 (offset 39) (type integer) (bits 1)
  -Member: 040 (offset 40) (type integer) (bits 1)
  -Member: 041 (offset 41) (type integer) (bits 1)
  -Member: 042 (offset 42) (type integer) (bits 1)
  -Member: 043 (offset 43) (type integer) (bits 1)
  -Member: 044 (offset 44) (type integer) (bits 1)
  -Member: 045 (offset 45) (type integer) (bits 1)
  -Member: 046 (offset 46) (type integer) (bits 1)
  -Member: 047 (offset 47) (type integer) (bits 1)
  -Member: 048 (offset 48) (type integer) (bits 1)
  -Member: 049 (offset 49) (type integer) (bits 1)
  -Member: 050 (offset 50) (type integer) (bits 1)
  -Member: 051 (offset 51) (type integer) (bits 1)
  -Member: 052 (offset 52) (type integer) (bits 1)
  -Member: 053 (offset 53) (type integer) (bits 1)
  -Member: 054 (offset 54) (type integer) (bits 1)
  -Member: 055 (offset 55) (type integer) (bits 1)
  -Member: 056 (offset 56) (type integer) (bits 1)
  -Member: 057 (offset 57) (type integer) (bits 1)
  -Member: 058 (offset 58) (type integer) (bits 1)
  -Member: 059 (offset 59) (type integer) (bits 1)
  -Member: 060 (offset 60) (type integer) (bits 1)
  -Member: 061 (offset 61) (type integer) (bits 1)
  -Member: 062 (offset 62) (type integer) (bits 1)
  -Member: 063 (offset 63) (type integer) (bits 1)
  -Member: 064 (offset 64) (type integer) (bits 1)
  -Member: 065 (offset 65) (type integer) (bits 1)

as u see, that is one bit bool. why is it just 1 bit, only bool?

the answer is, radar system of css.

if someone is your team, u can see him on rader regardless of some other teammate is able to spot him or not.
but, if u are not teammate, u cannot see someone is not in spottabl position from any of your teammate
but, if any of teammates able to spot that enemy, all of your team will able to see him. that is why that infomation is only bool, not something like bitflags or...

but all of these rules are accepted until u are alive.
if u are dead, opserver setting of server will determind whom will be spoted in your radar.

anyway, to set this, simply u can do this.

Code:

public OnMapStart(){
    //테스트코드
    new PMIndex = FindEntityByClassname(0, "cs_player_manager");
    SDKHook(PMIndex, SDKHook_ThinkPost, OnThinkPost);
   
}


public OnThinkPost(entity)
{
    //테스트코드
        //모든 플레이어를 레이더에 잡히게 한다
        new minimapoffset = FindSendPropOffs("CCSPlayerResource", "m_bPlayerSpotted");
       
        for(new target = 1; target < 65; target++){
           
            SetEntData(entity, minimapoffset + target, true, 4, true);
           
        }
       
        SetEntData(entity, FindSendPropOffs("CCSPlayerResource", "m_bBombSpotted"), true, 4, true);
       
}

this code will make everyone on server to see each other in radar.

if u want to set this not all, per client, should do like this:

Code:

public OnThinkPost(entity)
{
    //테스트코드
        //모든 플레이어를 레이더에 잡히게 한다
        new minimapoffset = FindSendPropOffs("CCSPlayerResource", "m_bPlayerSpotted");
       
        for(new target = 1; target <= MaxClients; target++){
           
            for(new client = 1; client <= MaxClients; client++){
           
                if(ditectedbysensor[client][target]){
                   
                    SetEntData(entity, minimapoffset + target, true, 4, true);
                   
                }
               
            }
           
        }
       
        //always spot the c4 for cts.
        SetEntData(entity, FindSendPropOffs("CCSPlayerResource", "m_bBombSpotted"), true, 4, true);
       
}

have fun with this! hahaha

##many guys talked on this thread and someguys uploaded nice research result.
thanks for em and i am writing some of that results on top of the thread to let other guys easy to see it


Quote:

Originally Posted by johan123jo (Post 1515938)

Quote:

Originally Posted by berni (Post 1278754)
Just for information, since the orange box update it's possible in CS:S to hide the radar completely for players serverside:

PHP Code:

/**
* Sets the Hud flags of a client
*
* @param client        Client index.
* @param flags            Flag to set, use one of the HIDEHUD_ hiding constants
* @noreturn
*/
stock Client_SetHud(clientflags) {
    
    
SetEntProp(clientProp_Send"m_iHideHUD"flags);
}

public 
OnClientPutInServer(client) {

    
Client_SetHud(client, ( 1<<));



This should be executed every spawn, because if the player spawns after it has been set on him the radar will show up again, and.. When this is on you can't change weapon, don't know why.. But i used this code to test it.

PHP Code:

#include <sourcemod>
#pragma semicolon 1

public OnPluginStart()
{
    
RegConsoleCmd("sm_hideradar"hide"Will hide the clients radar");
}

public 
Action:hide(clientargs)
{
    
Client_SetHud(client, ( 1<<));
}

stock Client_SetHud(clientflags)
{
    
SetEntProp(clientProp_Send"m_iHideHUD"flags);




DarkEnergy 08-19-2010 21:24

Re: [Tutorial][CSS] Radar spot edit!
 
very nice

Peace-Maker 08-21-2010 14:11

Re: [Tutorial][CSS] Radar spot edit!
 
That's nice to know.
I'm reversing it to not show anyone in radar to use in hide and seek:)

Thank you!

berni 08-21-2010 20:31

Re: [Tutorial][CSS] Radar spot edit!
 
Why not just disable the radar completely then ?

Peace-Maker 08-21-2010 23:15

Re: [Tutorial][CSS] Radar spot edit!
 
It's not showing, when setting all to false, but how would you disable radar completely via plugin?

javalia 08-21-2010 23:54

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by berni (Post 1278263)
Why not just disable the radar completely then ?

u cannot make radar to not visible on client cuz convar of radar for client is not editable on server side.
client should disable it in manually before game.
so instead of forcing clients to set that cvar before game, editing serverside radar is more easy for player

javalia 08-21-2010 23:56

Re: [Tutorial][CSS] Radar spot edit!
 
and i were found this method to make some clients to show in radar, more than not show someone. so it was not so helpful to me radar disable of client side.
i were used this method to sensor of tactical gun mod can show spotted enemy on radar of sensor`s owner`s team

javalia 08-21-2010 23:58

Re: [Tutorial][CSS] Radar spot edit!
 
in example :
if someone is in cloak mod, he will never able to spotted in radar!

berni 08-22-2010 10:43

Re: [Tutorial][CSS] Radar spot edit!
 
Just for information, since the orange box update it's possible in CS:S to hide the radar completely for players serverside:

PHP Code:

/**
* Sets the Hud flags of a client
*
* @param client        Client index.
* @param flags            Flag to set, use one of the HIDEHUD_ hiding constants
* @noreturn
*/
stock Client_SetHud(clientflags) {
    
    
SetEntProp(clientProp_Send"m_iHideHUD"flags);
}

public 
OnClientPutInServer(client) {

    
Client_SetHud(client, ( 1<<));



FireAnt 11-16-2010 07:42

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by berni (Post 1278754)
Just for information, since the orange box update it's possible in CS:S to hide the radar completely for players serverside:

PHP Code:

/**
* Sets the Hud flags of a client
*
* @param client        Client index.
* @param flags            Flag to set, use one of the HIDEHUD_ hiding constants
* @noreturn
*/
stock Client_SetHud(clientflags) {
    
    
SetEntProp(clientProp_Send"m_iHideHUD"flags);
}

public 
OnClientPutInServer(client) {

    
Client_SetHud(client, ( 1<<));




I can't get this to work :oops:, need this for a CS:S FFA server.

berni 11-16-2010 12:10

Re: [Tutorial][CSS] Radar spot edit!
 
are you asking for help ? or was this just an information.
I'm sorry, I don't really have the time and mood for random guessing.
more info maybe ?

FireAnt 11-16-2010 13:26

Re: [Tutorial][CSS] Radar spot edit!
 
I have compiled the code without errors and the plugin loads and show no errors in the logg. The server is running latest stable SM, MM and Balis CSS DM and SDK Hooks. I still se my teammates in the radar.

Code:

stock Client_SetHud(client, flags) {
   
    SetEntProp(client, Prop_Send, "m_iHideHUD", flags);
}

public OnClientPutInServer(client) {

    Client_SetHud(client, ( 1<<4 ));
}


javalia 11-16-2010 15:10

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by FireAnt (Post 1350694)
I have compiled the code without errors and the plugin loads and show no errors in the logg. The server is running latest stable SM, MM and Balis CSS DM and SDK Hooks. I still se my teammates in the radar.

Code:

stock Client_SetHud(client, flags) {
   
    SetEntProp(client, Prop_Send, "m_iHideHUD", flags);
}

public OnClientPutInServer(client) {

    Client_SetHud(client, ( 1<<4 ));
}


i think u should do that on every respawn of user.
from it will maybe resetted on respawn.

Peace-Maker 11-16-2010 16:13

Re: [Tutorial][CSS] Radar spot edit!
 
2 Attachment(s)
I got the problem, that players weren't able to change weapons when hiding the radar that way. It's still also buggy to set the m_bPlayerSpotted props to 0 for all players on PreThink, PostThink. Players sometimes still appear for a short time. I've been messing around with it a lot while writing hide and seek. If someone finds a better solution, please share!

HIDEHUD_ constants

javalia 11-16-2010 16:31

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by Peace-Maker (Post 1350818)
I got the problem, that players weren't able to change weapons when hiding the radar that way. It's still also buggy to set the m_bPlayerSpotted props to 0 for all players on PreThink, PostThink. Players sometimes still appear for a short time. I've been messing around with it a lot while writing hide and seek. If someone finds a better solution, please share!

HIDEHUD_ constants

as i said on top of thread, u should hook postthink of player manage entity like this on map start

public OnMapStart(){

new PMIndex = FindEntityByClassname(0, "cs_player_manager");
SDKHook(PMIndex, SDKHook_ThinkPost, OnThinkPost);

}

cuz css will send radar data after it`s think(not sure but in other kind of think hook, it was not work correctly)

berni 11-16-2010 18:13

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by javalia (Post 1350759)
i think u should do that on every respawn of user.
from it will maybe resetted on respawn.

Ok, I've tested it out on my test server, you need to delay it a little bit,
because the radar seems to get reset after spawning, here is working code to hide the radar with the hidehud property:

PHP Code:

public OnPluginStart() {
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Action:Event_PlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast) {
    
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
CreateTimer(0.1PlayerSpawn_Delayedclient);
    
    return 
Plugin_Continue;
}

public 
Action:PlayerSpawn_Delayed(Handle:timerany:client) {
    
    
Client_SetHud(client1<<4);
    
    return 
Plugin_Stop;


Credit me, when you use this ;)

Peace-Maker 12-01-2010 15:33

Re: [Tutorial][CSS] Radar spot edit!
 
Well, i am unable to change weapons when using your method berni.
It also hides health/kevlar and ammo showings.

KawMAN 12-06-2010 10:39

Re: [Tutorial][CSS] Radar spot edit!
 
Try to block "UpdateRadar" usermessage

javalia 12-08-2010 14:34

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by KawMAN (Post 1364504)
Try to block "UpdateRadar" usermessage

your idea is good and i think it will work, althrough i didnt tested it.

MoshMage 12-08-2010 18:39

Re: [Tutorial][CSS] Radar spot edit!
 
anyway, would anyone make a "plugin" for those of us who aren't that familiar with coding and whatsoever? :)

or hasn't anyone come to any conclusion?

I read somewhere that BAIL set the radar to scramble IF cssdm and ffa = 1 on server start?

javalia 12-09-2010 01:34

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by MoshMage (Post 1366351)
anyway, would anyone make a "plugin" for those of us who aren't that familiar with coding and whatsoever? :)

or hasn't anyone come to any conclusion?

I read somewhere that BAIL set the radar to scramble IF cssdm and ffa = 1 on server start?

well, i am not thinking to make some other plugins that using this code,
but if u ask about some conclusion, i will show u my tacticalgunmod,
when sensor detects other enemy in the map, it will let u see them in minimap,
and if enemy is cloacked and is not detected by sensor, they will not even exist in minimap. this is what i made for my plugin. so, i believe other guys can use this way, and it is perfectly working

Peace-Maker 12-09-2010 19:47

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by javalia (Post 1350831)
as i said on top of thread, u should hook postthink of player manage entity like this on map start

public OnMapStart(){

new PMIndex = FindEntityByClassname(0, "cs_player_manager");
SDKHook(PMIndex, SDKHook_ThinkPost, OnThinkPost);

}

cuz css will send radar data after it`s think(not sure but in other kind of think hook, it was not work correctly)

Using this method and setting the bPlayerSpotted offsets all to 0 still shows all players on radar. I also noticed a difference in hiding bots and real players.

I already tried blocking the UpdateRadar message, but i'm unable to do it in sourcepawn itself. The message get's through anyways. Maybe one need some kind of extension?

Seta00 12-31-2010 10:53

Re: [Tutorial][CSS] Radar spot edit!
 
You should hook player PreThink, otherwise you'll get many visual glitches on the radar.

Wiskyjim 05-15-2011 19:32

Re: [Tutorial][CSS] Radar spot edit!
 
How hide the position of teammates?
Make a example for the gametype DM-FFA.

GoD-Tony 05-16-2011 07:58

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by Wiskyjim (Post 1470183)
How hide the position of teammates?
Make a example for the gametype DM-FFA.

You can try this plugin I made when testing this a while ago. If it works then I'll post it in the plugin section. Requires SDKHooks.

Edit: Plugin Posted

Wiskyjim 05-16-2011 17:03

Re: [Tutorial][CSS] Radar spot edit!
 
The value 0 and 2 works fine, but the value 1 shows me still teammates.

GoD-Tony 05-16-2011 17:27

Re: [Tutorial][CSS] Radar spot edit!
 
Ok, maybe I'll play around with it later to see if I can get it working.

Peace-Maker 05-16-2011 17:48

Re: [Tutorial][CSS] Radar spot edit!
 
You can't hide teammates from the radar using the m_bPlayerSpotted property. Since they are in the same team as you, they're shown anyway. You may try to set everyones m_iTeam to 1 or similar in PostThink. Don't know if that will change anything though;)

GoD-Tony 05-18-2011 08:36

Re: [Tutorial][CSS] Radar spot edit!
 
I noticed that the radar is hidden while a player is flashed and he can still change his weapons. I also noticed that the client's m_iHideHUD property isn't changed whether he is flashed or not, so it must be something else triggering it.

To hide radar: Simulate a long flashbang with 0 alpha (no whitescreen).

Example: http://forums.alliedmods.net/showthread.php?p=1471473

Peace-Maker 05-18-2011 12:41

Re: [Tutorial][CSS] Radar spot edit!
 
Nice find!

klausenbusk 07-03-2011 09:34

Re: [Tutorial][CSS] Radar spot edit!
 
Is it possible to make such all CT can see all T, but T can only see all T?

Peace-Maker 07-03-2011 13:09

Re: [Tutorial][CSS] Radar spot edit!
 
Sure, since teammates are always on your radar, you only have to set m_bPlayerSpotted to 1 for all Ts.

ojmdk476oj 07-22-2011 06:56

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by berni (Post 1278754)
Just for information, since the orange box update it's possible in CS:S to hide the radar completely for players serverside:

PHP Code:

/**
* Sets the Hud flags of a client
*
* @param client        Client index.
* @param flags            Flag to set, use one of the HIDEHUD_ hiding constants
* @noreturn
*/
stock Client_SetHud(clientflags) {
    
    
SetEntProp(clientProp_Send"m_iHideHUD"flags);
}

public 
OnClientPutInServer(client) {

    
Client_SetHud(client, ( 1<<));



This should be executed every spawn, because if the player spawns after it has been set on him the radar will show up again, and.. When this is on you can't change weapon, don't know why.. But i used this code to test it.

PHP Code:

#include <sourcemod>
#pragma semicolon 1

public OnPluginStart()
{
    
RegConsoleCmd("sm_hideradar"hide"Will hide the clients radar");
}

public 
Action:hide(clientargs)
{
    
Client_SetHud(client, ( 1<<));
}

stock Client_SetHud(clientflags)
{
    
SetEntProp(clientProp_Send"m_iHideHUD"flags);



zeroibis 07-27-2011 01:36

Re: [Tutorial][CSS] Radar spot edit!
 
Does anyone know of a way to change the way a player is displayed to other players on the radar? For example lets say I want to have a given ct player show up as a gold star or something to the rest of his team only.

Bimbo1 08-14-2011 00:06

Re: [Tutorial][CSS] Radar spot edit!
 
Quote:

Originally Posted by zeroibis (Post 1519417)
Does anyone know of a way to change the way a player is displayed to other players on the radar? For example lets say I want to have a given ct player show up as a gold star or something to the rest of his team only.

No, i dont think so.
I have already tried to do something like that, and I got nothing.

morion 08-24-2011 13:09

Re: [Tutorial][CSS] Radar spot edit!
 
Is there a way to change the default radar icon for a dropped bomb. I tried just changing it server site. I believe it is located at "orangebox/cstrike/materials/sprites/bomb_dropped.vtf" but nothing happened. Or has this to be changed client side as well.

zeroibis 08-24-2011 17:21

Re: [Tutorial][CSS] Radar spot edit!
 
Read above it appears that none of us have found a way to edit the images themselves just if you can see them. I would bet that it is a client side file and we can not do anything to it :(

Experto 09-29-2011 22:42

Re: [Tutorial][CSS] Radar spot edit!
 
How do I get anyone as a spectator or dead, do not see the radar?

I tried using the code posted by Berni,
however, when a person dies or is a spectator
the radar remains

Mitchell 03-14-2012 13:19

Re: [Tutorial][CSS] Radar spot edit!
 
Did this die?

Bacardi 03-14-2012 15:12

Re: [Tutorial][CSS] Radar spot edit!
 
:3
Very easy and maybe useful to someone.

PHP Code:

new Handle:mp_forcecamera INVALID_HANDLE;
public 
OnPluginStart()
{
    if((
mp_forcecamera FindConVar("mp_forcecamera")) == INVALID_HANDLE)
    {
        
SetFailState("Convar mp_forcecamera not found");
    }
}

public 
OnClientPutInServer(client)
{
    if(!
IsFakeClient(client))
    {
        
SendConVarValue(clientmp_forcecamera"1");
    }


What this do ?
- Set to players convar mp_forcecamera to 1 when joined server, even server mp_forcecamera is 0.
- This however not prevent players to spectate other team like in real mp_forcecamera 1 mode.
- Radar still work like mp_forcecamera 1 mode, dead players see only teammates in radar, enemies hidden.
*edit
when ever change server mp_forcecamera value, also players cvar change, disabling this trick. Player need re-connect.

*edit
mp_forcecamera "2" hide both teams on radar when dead


All times are GMT -4. The time now is 18:19.

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