AlliedModders

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

safetymoose 02-01-2016 14:56

Flashlight
 
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...

Sn3amtz 02-01-2016 15:09

Re: Flashlight
 
mp_flashlight 0/1

safetymoose 02-01-2016 15:12

Re: Flashlight
 
Quote:

Originally Posted by Sn3amtz (Post 2389139)
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.

siriusmd99 02-02-2016 15:10

Re: Flashlight
 
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

safetymoose 02-02-2016 16:31

Re: Flashlight
 
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.

klippy 02-02-2016 19:00

Re: Flashlight
 
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.


All times are GMT -4. The time now is 09:23.

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