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

[CSGO] remove radar and teammate arrows for DM/FFA?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PresidentEvil
AlliedModders Donor
Join Date: Jun 2012
Old 02-10-2014 , 01:17   [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #1

Is there a cvar or plugin that will remove the radar and teammate arrows for free for all and dm servers.

I set up a survival games server and its you against everyone and it is very annoying.
__________________
PresidentEvil is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 02-10-2014 , 05:55   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #2

Deathmatch plugins do that.
This is fairly easy to code as its own plugin using
PHP Code:
SetEntProp(clientIndexProp_Send"m_iHideHUD"HIDEHUD_RADAR); 
On a 0.0 second timer after OnClientSpawn.
h3bus is offline
klexen
Senior Member
Join Date: Sep 2013
Old 02-10-2014 , 14:19   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #3

Quote:
Originally Posted by h3bus View Post
Deathmatch plugins do that.
This is fairly easy to code as its own plugin using
PHP Code:
SetEntProp(clientIndexProp_Send"m_iHideHUD"HIDEHUD_RADAR); 
On a 0.0 second timer after OnClientSpawn.
This line for some reason is giving me errors in my deathmatch plugin...

My error log is flooded with:

Code:
L 02/10/2014 - 00:15:51: [SM] Native "SetEntProp" reported: Entity 5 (5) is invalid
L 02/10/2014 - 00:15:51: [SM] Displaying call stack trace for plugin "deathmatch.smx":
L 02/10/2014 - 00:15:51: [SM]   [0]  Line 1068, deathmatch.sp::RemoveRadar()
I'm using Deathmatch 1.5.5

Any ideas?
__________________


klexen is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 02-10-2014 , 14:53   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #4

It works perfectly well in my deathmatch plugin: https://forums.alliedmods.net/showthread.php?t=233685

I guess function does not check for client validity before SetEntProp
h3bus is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-10-2014 , 15:53   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #5

As usual, you should never pass a client index to a timer. Even a 0.0 one. Pass a userid instead.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-10-2014 at 15:53.
Powerlord is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 02-10-2014 , 17:01   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
Pass a userid instead.
You should pass a client serial instead.
KyleS is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 02-12-2014 , 00:36   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #7

I've wondered this for a while but what would the differences be between using GetClientSerial(client) and EntIndexToEntRef(client)?
hlstriker is offline
thiry
SourceMod Donor
Join Date: Feb 2011
Location: Japan
Old 02-14-2014 , 02:09   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #8

PHP Code:
#include <sourcemod> 
#define ENT_RADAR 1 << 12 
public OnPluginStart() {
  
HookEvent("player_spawn"ev_player_spawn);
}
public 
ev_player_spawn(Handle:event, const String:name[], bool:dontBroadcast) {
  new 
client=GetClientOfUserId(GetEventInt(event"userid"));
  
CreateTimer(0.0RemoveRadarclient);
}  
public 
Action:RemoveRadar(Handle:timerany:client) {      
  
SetEntProp(clientProp_Send"m_iHideHUD"ENT_RADAR);


Last edited by thiry; 02-14-2014 at 02:10.
thiry is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 02-14-2014 , 02:27   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #9

You should pass a serial to RemoveRadar, and then check for client connected and alive in that function.
h3bus is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-14-2014 , 11:49   Re: [CSGO] remove radar and teammate arrows for DM/FFA?
Reply With Quote #10

Quote:
Originally Posted by KyleS View Post
You should pass a client serial instead.
What advantage is there in passing a client serial instead of a userid? I mean, I guess there's the possibility that 32,768 people could join before the timer expires, but if that's really happening you have timers that are WAY too long.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-14-2014 at 11:51.
Powerlord 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 14:36.


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