Raised This Month: $32 Target: $400
 8% 

[CS:GO] Flashlight (1.3.62)


Post New Thread Reply   
 
Thread Tools Display Modes
Berva
Member
Join Date: Feb 2018
Old 02-27-2018 , 17:08   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #91

Nice plugin! ... Is there any way, how to make it team sided? for example only ct?
Berva is offline
srvmil
Senior Member
Join Date: Oct 2010
Old 02-28-2018 , 02:42   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #92

Quote:
Originally Posted by Berva View Post
Nice plugin! ... Is there any way, how to make it team sided? for example only ct?
Looking for this as well, anyone?
srvmil is offline
schwarz
Senior Member
Join Date: Nov 2011
Location: under your bed
Old 03-04-2018 , 11:35   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #93

hey

i have suggestion for this plugin , maybe can we create command for disable permanent flashlight if player wont use it .

like !disableflash (!df )

possibly? thanks
__________________
schwarz is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-04-2018 , 12:02   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #94

You mean a command to disable the flash for each client?
Mitchell is offline
schwarz
Senior Member
Join Date: Nov 2011
Location: under your bed
Old 03-04-2018 , 12:03   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #95

Quote:
Originally Posted by Mitchell View Post
You mean a command to disable the flash for each client?
yeh
__________________
schwarz is offline
schwarz
Senior Member
Join Date: Nov 2011
Location: under your bed
Old 03-07-2018 , 02:54   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #96

What do you think about my suggestion ?
__________________
schwarz is offline
Deluks
Junior Member
Join Date: Jul 2019
Old 06-21-2020 , 05:01   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #97

Всем привет, тему поднимаю, т.к. столкнулся с проблемой используя этот плагин.
Фонарик светит, но из-за игрока, и получается что тень от модели закрывает весь обзор. До обновлений все было хорошо.

Hi all, the subject is raised, because encounter a problem using this plugin.
The flashlight shines, but because of the player, and it turns out that the shadow from the model closes the whole review. Before the updates everything was fine.

cet time now
Deluks is offline
Sandervraun
Senior Member
Join Date: May 2019
Location: Denmark
Old 07-04-2020 , 15:10   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #98

Is there any way to make some kind of extra light for admins? Just for fun
Sandervraun is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-14-2021 , 15:15   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #99

Sometimes the cvar with "return" in the name will be treated as 0 and the only fix is to change it from 1 to 0 and again to 1.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-22-2021 , 07:57   Re: [CS:GO] Flashlight (1.3.62)
Reply With Quote #100

Code:
#pragma semicolon 1
#include <sdktools>
#define PVERSION "1.3.63"

new Handle:gH_Enabled = INVALID_HANDLE;
new Handle:gH_LAW = INVALID_HANDLE;
new Handle:gH_Return = INVALID_HANDLE;
new Handle:gH_Sound = INVALID_HANDLE;
new Handle:gH_SoundAll = INVALID_HANDLE;

new String:zsSnd[255];

public Plugin:myinfo =
{
	name = "Flashlight",
	author = "Mitch",
	description = "Replaces +lookatweapon with a toggleable flashlight. Also adds the command: sm_flashlight",
	version = PVERSION,
	url = "https://forums.alliedmods.net/showthread.php?t=227224"
};

bool bSnd;

public OnPluginStart()
{
	gH_Enabled = CreateConVar("sm_flashlight_enabled", "1", 
					"0 = Disables flashlight; 1 = Enables flashlight", _, true, 0.0, true, 1.0);
	gH_LAW = CreateConVar("sm_flashlight_lookatweapon", "1", 
					"0 = Doesn't use +lookatweapon; 1 = hooks +lookatweapon", _, true, 0.0, true, 1.0);
	gH_Return = CreateConVar("sm_flashlight_return", "0", 
					"0 = Doesn't return blocking +look at weapon; 1 = Does return", _, true, 0.0, true, 1.0);
	gH_Sound = CreateConVar("sm_flashlight_sound", "items/flashlight1.wav", 
					"Sound path to use when a player uses the flash light.");
	gH_SoundAll = CreateConVar("sm_flashlight_sound_all", "1", 
					"Play the sound to all players, or just to the activator?");
	UpdateSound();
	HookConVarChange(gH_Sound, ConVarChanged);
	AutoExecConfig();

	CreateConVar("sm_flashlight_version", PVERSION, "CsGoFlashlight Version", FCVAR_DONTRECORD|FCVAR_NOTIFY);

	AddCommandListener(Command_LAW, "+lookatweapon");	//Hooks cs:go's flashlight replacement 'look at weapon'.
	RegConsoleCmd("sm_flashlight", Command_FlashLight); 	//Bindable Flashlight command
}

public ConVarChanged(Handle:cvar, const String:oldVal[], const String:newVal[])
{
	if(cvar == gH_Sound) {
		UpdateSound();
	}
}

public UpdateSound() {
	decl String:formatedSound[256];
	GetConVarString(gH_Sound, formatedSound, sizeof(formatedSound));
	
	bSnd = false;
	
	if(StrEqual(formatedSound, "") || StrEqual(formatedSound, "0")) {
	} else {
		strcopy(zsSnd, sizeof(zsSnd), formatedSound);

		bSnd = true;
		PrecacheSound(zsSnd);
		if(!StrEqual(formatedSound, "items/flashlight1.wav")) {
			Format(formatedSound, sizeof(formatedSound), "sound/%s", formatedSound);
			AddFileToDownloadsTable(formatedSound);
		}
	}
}

public OnMapStart() {
	if(GetConVarBool(gH_SoundAll)) {
		PrecacheSound(zsSnd, true);
	}
}

public Action:Command_LAW(client, const String:command[], argc)
{
	if(!GetConVarBool(gH_LAW) || !GetConVarBool(gH_Enabled)) //Enable this hook?
		return Plugin_Continue;

	if(!IsClientInGame(client)) //If player is not in-game then ignore!
		return Plugin_Continue;

	if(!IsPlayerAlive(client)) //If player is not alive then continue the command.
		return Plugin_Continue;	

	ToggleFlashlight(client);

	return (GetConVarBool(gH_Return)) ? Plugin_Continue : Plugin_Handled;
}

public Action:Command_FlashLight(client, args)
{
	if(!GetConVarBool(gH_Enabled))
		return Plugin_Handled;

	if (IsClientInGame(client) && IsPlayerAlive(client)) {
		ToggleFlashlight(client);
	}
	return Plugin_Handled;
}

ToggleFlashlight(client) {
	SetEntProp(client, Prop_Send, "m_fEffects", GetEntProp(client, Prop_Send, "m_fEffects") ^ 4);
	if(bSnd) {
		if(GetConVarBool(gH_SoundAll)) {
			EmitSoundToAll(zsSnd, client);
		} else {
			EmitSoundToClient(client, zsSnd);
		}
	}
}
Trying a fix for the issue I mentioned above.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 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 15:58.


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