Raised This Month: $ Target: $400
 0% 

[SOLVED] Default Flashlight: Only owner can see the light.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-12-2011 , 14:01   [SOLVED] Default Flashlight: Only owner can see the light.
Reply With Quote #1

Hi did anyone know how to make only owner can see their flashlight. I don't want to use Custom Flashlight plugin. Original flashlight more efficient but i need only owner can see the light.

[IMG]http://img543.**************/img543/2624/dedust20001kr.png[/IMG]
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 08-04-2011 at 12:09. Reason: Problem solved
yokomo is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 01-12-2011 , 23:47   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #2

look at SgtBane`s predator mod its included inside.
__________________
okay
ARES[ro] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-13-2011 , 01:21   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #3

Hook AddToFullPack and remove flashlight from ES_Effects when ent is not host.
You can cache On/off status in a bit at FlashLight event.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-13-2011 , 07:52   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #4

Quote:
Originally Posted by ARES[ro] View Post
look at SgtBane`s predator mod its included inside.
I've see predator mod flash light effect but it's flashing, i want default flashlight effect.

Quote:
Originally Posted by ConnorMcLeod View Post
Hook AddToFullPack and remove flashlight from ES_Effects when ent is not host.
You can cache On/off status in a bit at FlashLight event.
OMG how to do this can you make an example.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-13-2011 , 10:47   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #5

You can code or you want the full code ?
If you want the whole code your are not in the right forum.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 01-13-2011 , 10:58   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #6

PHP Code:
if(ent != hostset_es(es_handleES_Effectsget_es(es_handleES_Effects) & ~EF_DIMLIGHT
That? D:
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-13-2011 , 14:14   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
You can code or you want the full code ?
If you want the whole code your are not in the right forum.
My coding skills is very limited, if you are free can you give me the whole code. So i can study about it. Sorry if i am in the wrong section.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 01-13-2011 , 22:40   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #8

The code metalicross added works right just put it in your FM_AddToFullPack forward.
__________________
okay

Last edited by ARES[ro]; 01-13-2011 at 22:48.
ARES[ro] is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 08-04-2011 , 08:50   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #9

Sorry revived my old thread. OK i have done with this code:
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Ghost Flash Light"
#define VERSION "1.0.0"
#define AUTHOR "yokomo"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_AddToFullPack"fw_full_pack"1)
}

public 
fw_full_pack(eseenthosthostflagsplayerpSet)
{
    if(!
pev_valid(ent)) return FMRES_IGNORED
    
    
if(ent != hostset_es(esES_Effectsget_es(esES_Effects) & ~EF_DIMLIGHT)
    
    return 
FMRES_IGNORED

Tested and works fine but i don't know it will make server lag or not. If someone can optimize it i feel so appreciate.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-04-2011 , 09:24   Re: [HELP] Default Flashlight: Only owner can see the light.
Reply With Quote #10

Main thing you forgot is to check if a player is passed, adding this filter would prevent many checks on every other entities than player.
Then, get_orig_retval check, if it is 0 it means the player is not viewable from host or is dead, so don't bother.
Last, check ES_Effects first so you make sure you need to set it or not.

PHP Code:
public fw_full_pack(eseenthosthostflagsplayerpSet)
{
    static 
bitEffects
    
if(    player
    
&&    host != ent
    
&&    get_orig_retval()
    &&    (
bitEffects get_es(esES_Effects)) & EF_DIMLIGHT    )
    {
        
set_es(esES_EffectsbitEffects & ~EF_DIMLIGHT)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 02:08.


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