Raised This Month: $12 Target: $400
 3% 

[STOCK] Creating customizable fog


Post New Thread Reply   
 
Thread Tools Display Modes
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-26-2010 , 02:58   Re: [STOCK] Creating customizable fog
Reply With Quote #11

It's a client-side operation, server just informs that the player should have fog enabled and the client does the rest.

However, this only works on OpenGL, on D3D and software fog doesn't work.
__________________
Hunter-Digital is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-26-2010 , 07:33   Re: [STOCK] Creating customizable fog
Reply With Quote #12

Quote:
Originally Posted by Hunter-Digital View Post
However, this only works on OpenGL, on D3D and software fog doesn't work.
Ya its and old problem with cs
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-22-2010 , 12:34   Re: [STOCK] Creating customizable fog
Reply With Quote #13

Here a better stock which is not hardcoded with predefined density value, and add more checks.
This way, you can put any value between 0.0001 and 0.25, so you can configure more finely.

I don't think it's the real limit but after some testing, below 0.0001 you don't see the difference and above 0.25 you don't see you hand/weapon anymore. So I guess it's enough.

Code:
stock CreateFog ( const index = 0, const red = 127, const green = 127, const blue = 127, const Float:density_f = 0.001, bool:clear = false ) {     static msgFog;         if ( msgFog || ( msgFog = get_user_msgid( "Fog" ) ) )     {         new density = _:floatclamp( density_f, 0.0001, 0.25 ) * _:!clear;                 message_begin( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgFog, .player = index );         write_byte( clamp( red  , 0, 255 ) );         write_byte( clamp( green, 0, 255 ) );         write_byte( clamp( blue , 0, 255 ) );         write_long( _:density );         message_end();     } }

Examples :

Sending/Clearing for all players :
Code:
CreateFog( 0, 133, 6, 6, 0.003 );
Code:
CreateFog( 0, .clear = true );

Sending/Clearing for one player :
Code:
CreateFog( id, 133, 6, 6, 0.003 );
Code:
CreateFog( id, .clear = true );
__________________

Last edited by Arkshine; 01-06-2012 at 10:16.
Arkshine is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 10-02-2010 , 16:15   Re: [STOCK] Creating customizable fog
Reply With Quote #14

Nice !
.Dare Devil. is offline
Saad706
Member
Join Date: Jun 2010
Location: Karachi,Pakistan
Old 10-10-2010 , 04:33   Re: [STOCK] Creating customizable fog
Reply With Quote #15

Hey abdul you copy my fog style
__________________
HeLL MoD Project is 50% Completed . Thanks @bdul for Help

My plugin link Advanced fog system
http://forums.alliedmods.net/showthr...t=advanced+fog
Saad706 is offline
Send a message via Skype™ to Saad706
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-10-2010 , 05:34   Re: [STOCK] Creating customizable fog
Reply With Quote #16

Quote:
Originally Posted by Saad706 View Post
Hey abdul you copy my fog style
Your fog style ???
Abe chalien maine copy nai kiya ye mere mehnat hai
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-10-2010 , 07:20   Re: [STOCK] Creating customizable fog
Reply With Quote #17

Quote:
Originally Posted by abdul-rehman View Post
Your fog style ???
Abe chalien maine copy nai kiya ye mere mehnat hai
Keep it English only.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-10-2010 , 08:19   Re: [STOCK] Creating customizable fog
Reply With Quote #18

Quote:
Originally Posted by Exolent[jNr] View Post
Keep it English only.
He is my cozn who knows nothing about scripting
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-10-2010 , 15:28   Re: [STOCK] Creating customizable fog
Reply With Quote #19

Quote:
Originally Posted by abdul-rehman View Post
He is my cozn who knows nothing about scripting
You can still talk in English.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-14-2011 , 11:10   Re: [STOCK] Creating customizable fog
Reply With Quote #20

How is this way, beside that all player gets the fog?

PHP Code:
#include < amxmodx >
#include < fakemeta_util >

public plugin_precache( )
{
    new 
iEntity fm_create_entity"env_fog" );
    
    
fm_set_kvdiEntity"density""0.0005""env_fog" );
    
fm_set_kvdiEntity"rendercolor""180 0 0""env_fog" );

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu 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 09:50.


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