Raised This Month: $ Target: $400
 0% 

invisibility


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuleBreaker
Senior Member
Join Date: May 2011
Old 07-28-2011 , 20:13   invisibility
Reply With Quote #1

Can somebody make me just like in furion, if user is CT and he stays in one place few sec he become invisible, and if he crouch he become invisible faster
Thanks ;)
RuleBreaker is offline
delayedCoder
Junior Member
Join Date: Jul 2011
Location: under binary
Old 07-29-2011 , 00:30   Re: invisibility
Reply With Quote #2

Here's something to get you going:
This will detect if a user has been idle for 5 seconds, if so, they will be invisible.

Note: There is no team detection or crouch method.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <fakemeta> #define PLUGIN "Blah" #define VERSION "1.0" #define AUTHOR "delayedCoder" new Float:lastMove[33]; public plugin_init() {         register_forward(FM_PlayerPreThink, "fw_playerprethink", 1);     } public fw_playerprethink(id) {         static Float:velocity[3];         pev(id,pev_velocity,velocity);         new Float:time = get_gametime();         if(velocity[1] || velocity[0] || velocity[2] || !(pev(id,pev_frags) & FL_ONGROUND))         lastMove[id] = time;         if(time-lastMove[id] >= 5.0)     {         set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 20);         lastMove[id] = time;     }         return FMRES_IGNORED; }
delayedCoder is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-29-2011 , 02:45   Re: invisibility
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #define PLUGIN "Blah" #define VERSION "1.0" #define AUTHOR "delayedCoder" new Float:lastMove[33]; new visible; public client_PreThink(id) {     static Float:velocity[3];         entity_get_vector(id,EV_VEC_velocity,velocity);         new Float:time = get_gametime();         new flags = get_entity_flags(id);     if(velocity[1] || velocity[0] || velocity[2] || ~flags & FL_ONGROUND)     {         if(~visible & (1<<(id&31)))         {             visible |= (1<<(id&31));             set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0);         }         lastMove[id] = time;     }     else     {         visible &= ~(1<<(id&31));                 new Float:maxStillTime = (flags & FL_DUCKING) ? 3.0 : 5.0;         new Float:stillTime = floatmin(maxStillTime, lastMove[id] - time);                 set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, floatround(255.0 - (255.0 * stillTime / maxStillTime)));     } }

Fixed never making player visible again.
Added fading, duck support, and converted to engine.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
RuleBreaker
Senior Member
Join Date: May 2011
Old 07-29-2011 , 06:28   Re: invisibility
Reply With Quote #4

I just tested it and it doesn`t work :\
RuleBreaker 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 00:47.


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