Raised This Month: $ Target: $400
 0% 

block in water fog


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-28-2013 , 05:48   block in water fog
Reply With Quote #1

Hello, how to block water fog, that fog when you are inside of water.
Anyway if you are in the water and you try to set fog message then nohting happen
code: http://forums.alliedmods.net/showpos...0&postcount=13
Thanks!

Edit: If you register message hook for fog then it never get callback.
PHP Code:
public plugin_init()
{
    
message_fog get_user_msgid"Fog" )
    
register_messagemessage_fog"fog_msghook" )


Last edited by .Dare Devil.; 04-28-2013 at 05:51.
.Dare Devil. is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-28-2013 , 10:39   Re: block in water fog
Reply With Quote #2

After trying many things it seems that water fog is in client side and there is no way to block it.
I just need to recreate water entity, it will solve many problems and give me more opportunities and also its gonna be fun.

I have one question, if i have brush entity pev mins maxs right, how to get brush entity higher point?
.Dare Devil. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-28-2013 , 11:15   Re: block in water fog
Reply With Quote #3

Try this :

Source world.cpp HLSDK :
Spoiler

PHP Code:
enum _:playerTasks ( += 33 )
{
    
TASK_PLR_FIX_LIGHTSTYLE,
}

public 
plugin_init()
{
    
EF_LightStyle(12"m");
}

public 
client_putinserver(id)
{
    
set_task(0.1"Task_Fix_LightStyle"id TASK_PLR_FIX_LIGHTSTYLE);
}

public 
Task_Fix_LightStyleid )
{
    
id %= TASK_PLR_FIX_LIGHTSTYLE;
    if( 
is_user_connected(id) )
    {
        
EF_LightStyle(12"m");
    }

Also, from ian.camarata climb plugin, you can do in client_PreThink :
PHP Code:
    //Prevent drowning
    // waterlevel 0 - not in water
    // waterlevel 1 - feet in water
    // waterlevel 2 - waist in water
    // waterlevel 3 - head in water
    
if( pevidpev_waterlevel ) == set_pevidpev_waterlevel
Would be more correct to set CD_WaterLevel in update_clientdata though.

PHP Code:
enum _:playerTasks ( += 33 )
{
    
TASK_PLR_FIX_LIGHTSTYLE,
}

public 
plugin_init()
{
    
register_forward(FM_UpdateClientData"OnUpdateClientData_Post"true);
    
EF_LightStyle(12"m");
}

public 
client_putinserver(id)
{
    
set_task(0.1"Task_Fix_LightStyle"id TASK_PLR_FIX_LIGHTSTYLE);
}

public 
OnUpdateClientData_Post(entsenweaponscd)
{
    if( 
get_cd(cdCD_WaterLevel) == )
    {
        
set_cd(cdCD_WaterLevel2);
    }
}

public 
Task_Fix_LightStyleid )
{
    
id %= TASK_PLR_FIX_LIGHTSTYLE;
    if( 
is_user_connected(id) )
    {
        
EF_LightStyle(12"m");
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-28-2013 at 11:21.
ConnorMcLeod is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-28-2013 , 11:09   Re: block in water fog
Reply With Quote #4

origin[2] + maxs[2] ?
or just get pev_absmax

Last edited by jimaway; 04-28-2013 at 11:11.
jimaway is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-28-2013 , 12:58   Re: block in water fog
Reply With Quote #5

Thanks you jimaway & ConnorMcLeod !
.Dare Devil. 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 10:45.


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