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

Flashlight


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
safetymoose
Senior Member
Join Date: Feb 2015
Old 02-01-2016 , 14:56   Flashlight
Reply With Quote #1

Hello,

Does anyone know how i can manipulate the light coming from the default flashlight? Is there a way to enable/disable the light without turning off the flashlight?

PS: Connor's custom flashlight is not what i am looking for...
safetymoose is offline
Sn3amtz
Senior Member
Join Date: Jan 2015
Location: France
Old 02-01-2016 , 15:09   Re: Flashlight
Reply With Quote #2

mp_flashlight 0/1
Sn3amtz is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 02-01-2016 , 15:12   Re: Flashlight
Reply With Quote #3

Quote:
Originally Posted by Sn3amtz View Post
mp_flashlight 0/1
alt+f4 -> close the game, no game, no flashlight...

Seriously though, i need some constructive answers, I'm trying to change the light coming from the default flashlight.
safetymoose is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 02-02-2016 , 15:10   Re: Flashlight
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <engine>
   
#define PLUGIN "Register impulse"
#define VERSION "1.0"
#define AUTHOR "dumbass"

new g_can_use;
    
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
register_impulse(100"control_flashlight")
    
g_can_use register_cvar("is_active_default_flashlight_without_turning_off_the_flashlight""1"
}
public 
control_flashlight(id){
     if(!
get_pcvar_num(g_can_use)){
     
client_print(id,print_chat,"You can't use Flashlight right now.")
     return 
PLUGIN_HANDLED;
     }
     return 
PLUGIN_CONTINUE;

amx_cvar "is_active_default_flashlight_without_turning _off_the_flashlight" "1" - turn ON flashlight
amx_cvar "is_active_default_flashlight_without_turning _off_the_flashlight" "0" - turn OFF flashlight
siriusmd99 is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 02-02-2016 , 16:31   Re: Flashlight
Reply With Quote #5

I see what you did here, but this is not what i'm looking for. I dont want to manage who can use the flashlight and who cant, but i want to manage who can see the light coming from someone's flashlight..

You're blocking the player from sending the impulse command, but i actually want him to be able to do at as normal and have certain players not see it. I can manipulate who sees it with bools, but i need to get the entity id of the light coming from the default flashlight of a player.

Once again, i'm trying to get the light coming from the default cs flashlight and manipulate that.

Last edited by safetymoose; 02-02-2016 at 16:34.
safetymoose is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-02-2016 , 19:00   Re: Flashlight
Reply With Quote #6

You may want to look into AddToFullPack. Specifically ES_Effects. One's flashlight gets turned on by having their EF_DIMLIGHT effect set, and you can manipulate that for each player individually in AddToFullPack.
klippy 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 00:31.


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