AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Name Drawing (https://forums.alliedmods.net/showthread.php?t=60827)

Ricky Leone 09-13-2007 23:43

Name Drawing
 
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.

Roach 09-14-2007 09:43

Re: Name Drawing
 
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.

potatis_invalido 09-14-2007 15:05

Re: Name Drawing
 
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.

Wilson [29th ID] 09-14-2007 15:08

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

Pro Patria Finland 09-14-2007 15:11

Re: Name Drawing
 
Quote:

Originally Posted by potatis_invalido (Post 531303)
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. :)

Lord_Destros 09-14-2007 16:27

Re: Name Drawing
 
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).

Ricky Leone 09-14-2007 16:34

Re: Name Drawing
 
Thanks for all of the help. It's appreciated.

Wilson [29th ID] 09-14-2007 21:17

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

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.

Ricky Leone 09-14-2007 22:58

Re: Name Drawing
 
An example illustrating this would be nice, yes. And thank you.

Wilson [29th ID] 09-15-2007 09:44

Re: Name Drawing
 
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; }


All times are GMT -4. The time now is 16:13.

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