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

Force a player


Post New Thread Reply   
 
Thread Tools Display Modes
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 05-19-2012 , 18:12   Re: Force a player
Reply With Quote #11

I'm 99% positive that won't work.
__________________
Dr. McKay is offline
TrueSurvivor
Member
Join Date: Jun 2010
Old 05-19-2012 , 18:22   Re: Force a player
Reply With Quote #12

Quote:
Originally Posted by Dr. McKay View Post
I'm 99% positive that won't work.
Silly me, FakeClientCommand is server-side. Well played sleepyhead.
ClientCommand does seem to work, actually.

Last edited by TrueSurvivor; 05-19-2012 at 18:22.
TrueSurvivor is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-19-2012 , 18:35   Re: Force a player
Reply With Quote #13

So you want simple, hide crosshair from players ? (Why need all that crosshair alpha )
Blodia posted snip.

But if I don't remember wrong, you need delay this after player spawn

How do i get rid of the lifedisplay in HL2 DM

*edit
What I tested seems can't select anymore weapons when croshair disabled.
I used ( 1<< 0 )
*Counter-Strike:source
*something to do weapons, if weapon_scout not have.

Last edited by Bacardi; 05-19-2012 at 19:01.
Bacardi is offline
Kriax
Senior Member
Join Date: Apr 2012
Old 05-22-2012 , 12:55   Re: Force a player
Reply With Quote #14

Hello,
Firstly, sorry for my activity on the subject, I am currently coding a spirited RolePlay with the people who taught me to code.
Finally, is not the subject!

I just post because I inform you that none of your code to not work.
I heard echoes of my friends encoder disans that it is not possible to disable the viewfinder for everyone.
Property I'm sure we can do it ^ ^

I do not see how I can do, turn off the hud and is crosshairscale asser dificille I confess.

Thank you for your response.

Sincerely,
Kriax.

Last edited by Kriax; 05-22-2012 at 12:56.
Kriax is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-22-2012 , 18:04   Re: Force a player
Reply With Quote #15

what a bad English Kriax xD, like me

I told you that its not possible to force the cl_ cvar on the client-side

anyway you can disable all the HUD for a player, but I don't remember the way to do this
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
iNexus
Member
Join Date: May 2011
Old 05-23-2012 , 03:47   Re: Force a player
Reply With Quote #16

test this for forcing hide hud

Code:
for(new i = 1; i <= maxplayers; i++)
{
	if (IsClientInGame(i))
	{
		ClientCommand(i, "hidehud all");
	}
}
@ kriax
je suis pas sur mais ça dois être ça.
après a toi de trouver comment retire le crosshair uniquement
__________________
Sorry For my English, i'm French developer ;)
iNexus is offline
Kriax
Senior Member
Join Date: Apr 2012
Old 05-23-2012 , 10:03   Re: Force a player
Reply With Quote #17

This code works, but the crosshair is deactivated only if I put the ALL.
I'm still looking for work only to the crosshair, but I have trouble.

Code:
// Hud Element hiding flags 
#define        HIDEHUD_WEAPONSELECTION        ( 1<<0 )    // Hide ammo count & weapon selection 
#define        HIDEHUD_FLASHLIGHT            ( 1<<1 ) 
#define        HIDEHUD_ALL                    ( 1<<2 ) 
#define        HIDEHUD_HEALTH                ( 1<<3 )    // Hide health & armor / suit battery 
#define        HIDEHUD_PLAYERDEAD            ( 1<<4 )    // Hide when local player's dead 
#define        HIDEHUD_NEEDSUIT            ( 1<<5 )    // Hide when the local player doesn't have the HEV suit 
#define        HIDEHUD_MISCSTATUS            ( 1<<6 )    // Hide miscellaneous status elements (trains, pickup history, death notices, etc) 
#define        HIDEHUD_CHAT                ( 1<<7 )    // Hide all communication elements (saytext, voice icon, etc) 
#define        HIDEHUD_CROSSHAIR            ( 1<<8 )    // Hide crosshairs 
#define        HIDEHUD_VEHICLE_CROSSHAIR    ( 1<<9 )    // Hide vehicle crosshair 
#define        HIDEHUD_INVEHICLE            ( 1<<10 ) 
#define        HIDEHUD_BONUS_PROGRESS        ( 1<<11 )    // Hide bonus progress display (for bonus map challenges) 

#define        HIDEHUD_BITCOUNT    12   

public OnPluginStart() 
{ 
    HookEvent("player_spawn", spawn); 
} 

public spawn(Handle:event, const String:name[], bool:dontBroadcast) 
{ 
    new userid = GetEventInt(event, "userid"); 
    CreateTimer(0.0, remove_hud_health, userid); 
} 

public Action:remove_hud_health(Handle:timer, any:userid) 
{ 
    new client = GetClientOfUserId(userid); 
    if(client != 0 && IsClientInGame(client)) 
    { 
        SetEntProp(client, Prop_Send, "m_iHideHUD", GetEntProp(client, Prop_Send, "m_iHideHUD")|HIDEHUD_HEALTH); 
    } 
}  


@ INexus - I think your code is not different from mine xD

Kriax

Last edited by Kriax; 05-23-2012 at 10:03.
Kriax is offline
iNex
Junior Member
Join Date: Dec 2011
Old 05-23-2012 , 10:25   Re: Force a player
Reply With Quote #18

"hidehud all" is console command
iNex 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 08:36.


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