AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block in water fog (https://forums.alliedmods.net/showthread.php?t=214529)

.Dare Devil. 04-28-2013 05:48

block in water fog
 
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" )



.Dare Devil. 04-28-2013 10:39

Re: block in water fog
 
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?

jimaway 04-28-2013 11:09

Re: block in water fog
 
origin[2] + maxs[2] ?
or just get pev_absmax

ConnorMcLeod 04-28-2013 11:15

Re: block in water fog
 
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");
    }



.Dare Devil. 04-28-2013 12:58

Re: block in water fog
 
Thanks you jimaway & ConnorMcLeod !


All times are GMT -4. The time now is 10:45.

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