Raised This Month: $ Target: $400
 0% 

CSGO Flashlight


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kierant
AlliedModders Donor
Join Date: Dec 2010
Old 09-28-2013 , 12:13   CSGO Flashlight
Reply With Quote #1

Does anyone know why this doesn't work? Trying to add a command to toggle flashlight using impulse 100 client console command.

Code:
#include <sourcemod>

public OnPluginStart()
{
RegConsoleCmd("sm_flashlight", Command_Flash);
}

public Action:Command_Flash(client, args)
{
new toggle;

if(!toggle)
{
FakeClientCommand(client, "impulse 100");
PrintToChat(client, "[SM] Flashlight enabled.");
toggle = 1;
} else
{
FakeClientCommand(client, "impulse 100");
PrintToChat(client, "[SM] Flashlight disabled.");
toggle = 0;
}
return toggle;
}
Any help is appreciated.
kierant is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-28-2013 , 15:29   Re: CSGO Flashlight
Reply With Quote #2

try add in server.cfg
sm_cvar mp_flashlight "1"

and forget your code for now

*edit
type command while you are on server
__________________
Do not Private Message @me

Last edited by Bacardi; 09-28-2013 at 15:34.
Bacardi is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 09-28-2013 , 16:56   Re: CSGO Flashlight
Reply With Quote #3

I actually have a flashlight coded for cs:go that i was going to release, it overwrites the default bind to f, which is look at weapon.
Mitchell is offline
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 09-28-2013 , 17:32   Re: CSGO Flashlight
Reply With Quote #4

impulse 100 is the default for cs:go's client as long as it's enabled on the server like Bacardi suggested above.
hamilton5 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 09-28-2013 , 17:39   Re: CSGO Flashlight
Reply With Quote #5

Here i released it.

Mitchell is offline
kierant
AlliedModders Donor
Join Date: Dec 2010
Old 09-28-2013 , 17:51   Re: CSGO Flashlight
Reply With Quote #6

impulse 100 is not the default, since mp_flashlight 1 is already enabled on my server, yet visualize weapon is still default, the 'f' key bind was re-binded after the csgo update which released lookatweapon.

Anyway, thanks Mitchell, works perfectly
kierant is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 09-28-2013 , 18:04   Re: CSGO Flashlight
Reply With Quote #7

Quote:
Originally Posted by kierant View Post
impulse 100 is not the default, since mp_flashlight 1 is already enabled on my server, yet visualize weapon is still default, the 'f' key bind was re-binded after the csgo update which released lookatweapon.

Anyway, thanks Mitchell, works perfectly
Mp_flashlight dosent do anything with out cheats enabled, since impulse commands cant be used with out cheats. and you cant force a player to use a impulse command.
Mitchell is offline
kierant
AlliedModders Donor
Join Date: Dec 2010
Old 09-28-2013 , 18:43   Re: CSGO Flashlight
Reply With Quote #8

Not sure i understand :p

sv_cheats 0
sm_cvar mp_flashlight 1

Used to work then, but csgo update visualize weapon re-binded f key. I use impulse 100 without sv_cheats enabled, it works.
kierant is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-28-2013 , 18:54   Re: CSGO Flashlight
Reply With Quote #9

Quote:
Originally Posted by hamilton5 View Post
impulse 100 is the default for cs:go's client as long as it's enabled on the server like Bacardi suggested above.
true

exec config_default
and you get default bindings
Quote:
Originally Posted by kierant View Post
Not sure i understand :p

sv_cheats 0
sm_cvar mp_flashlight 1

Used to work then, but csgo update visualize weapon re-binded f key. I use impulse 100 without sv_cheats enabled, it works.
Haven't seen that kind update what mess player binds...
But true, not need cheats enable

*edit
now I remember why I disable auto-update for this game... too late

*edit, ouh great
Rebinding key f to new command +lookatweapon.

Last edited by Bacardi; 09-29-2013 at 01:17.
Bacardi is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 09-28-2013 , 19:31   Re: CSGO Flashlight
Reply With Quote #10

They gonna remove it sooner or later probably. First step is replacing the bind, next removing the command maybe. Funny, but they don't clean their shit very well. Spray sound and stock sprays are still present even now on a client. Too bad TE for spray doesn't work.
xf117 is offline
Send a message via ICQ to xf117
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 03:41.


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