Raised This Month: $12 Target: $400
 3% 

Name Drawing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 09-13-2007 , 23:43   Name Drawing
Reply With Quote #1

Well, I'm trying to write a plugin to hide player names when you put your crosshair over them. This is for The Specialists. Here's what I have:

Code:
#include <amxmodx>

public plugin_init()
{
	register_plugin("Xavier-HPN", "1.0", "Xavier")
	
	register_cvar("amx_hidenames", "1")
}

public client_putinserver(id)
{
	if (get_cvar_num("amx_hidenames") <= 1)
		set_cvar_num("cl_drawnames", 0)
	else
		set_cvar_num("cl_drawnames", 1)
}

public client_disconnect(id)
{
	set_cvar_num("cl_drawnames", 1)
}
The thing is, I don't think cl_drawnames works in TS. I tried it, but it had no effect. What am I doing wrong? Thanks for any help.
Ricky Leone is offline
Roach
Writes love letters to sawce Daily
Join Date: Jul 2006
Location: Internet
Old 09-14-2007 , 09:43   Re: Name Drawing
Reply With Quote #2

First off, you're posting in the wrong forum.

I'm moving this for you to the correct forum. Next time, read the forum descriptions.
__________________
Quote:
Originally Posted by Brad View Post
That sounds like a really good idea!
Now replace the word "good" with "dumb".
What was your rationale for proposing such a thing?
Roach is offline
potatis_invalido
BANNED
Join Date: Jul 2007
Location: 0 (world)
Old 09-14-2007 , 15:05   Re: Name Drawing
Reply With Quote #3

cl_ cvars are client side. You trying to change the cvar on the server.
Changing clients's cvars is slowhacking.
You can't change clients's cvars or execute commands on a client in client_disconnect. Client_disconnect is called after the client has disconnected.

Last edited by potatis_invalido; 09-14-2007 at 15:08.
potatis_invalido is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 09-14-2007 , 15:08   Re: Name Drawing
Reply With Quote #4

You can use this plugin to achieve it.
http://forums.alliedmods.net/showthread.php?t=53728
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 09-14-2007 , 15:11   Re: Name Drawing
Reply With Quote #5

Quote:
Originally Posted by potatis_invalido View Post
cl_ cvars are client side. You trying to change the cvar on the server.
Changing clients's cvars is slowhacking.
You can't change clients's cvars or execute commands on a client in client_disconnect. Client_disconnect is called after the client has disconnected.
I would help, but potatis is right. This is basically slowhacking, so no support for you. Read the rules.
__________________
I am not a number. I am Gordon Freeman!
Pro Patria Finland is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 09-14-2007 , 16:27   Re: Name Drawing
Reply With Quote #6

There is no cl_drawnames in TS 3.0 (or any version as far as I know). Quite a few have attempted to remove the "HUD" but few have succeeded (and those who have haven't publicly released it).
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 09-14-2007 , 16:34   Re: Name Drawing
Reply With Quote #7

Thanks for all of the help. It's appreciated.
Ricky Leone is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 09-14-2007 , 21:17   Re: Name Drawing
Reply With Quote #8

Oh shoot, I forgot to mention. The method I know works in DoD will probably work in your silly "specialists" game too

Simply set ES_SolidState to SOLID_NOT in AddToFullPack and when you put your mouse over them, it will not show their names. I'm assuming that's what cl_drawnames alters. If you need help doing this, reply and I'll post some code.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 09-14-2007 , 22:58   Re: Name Drawing
Reply With Quote #9

An example illustrating this would be nice, yes. And thank you.
Ricky Leone is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 09-15-2007 , 09:44   Re: Name Drawing
Reply With Quote #10

Code:
new g_cvarEnabled; public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR );     register_forward( FM_AddToFullPack, "hook_AddToFullPack_post", 1 );         g_cvarEnabled = register_cvar( "dod_blockicons", "0" ); } public hook_AddToFullPack_post( es_handle, e, entid, host, hostflags, player, pSet ) {     if( !player || !is_user_alive( entid ) || !get_pcvar_num( g_cvarEnabled ) ) return FMRES_IGNORED;         // Set user's Solid Type to SOLID_NOT     set_es( es_handle, ES_Solid, SOLID_NOT );     return FMRES_HANDLED; }
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
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 00:50.


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