Raised This Month: $ Target: $400
 0% 

Invisibility


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 06-29-2010 , 01:10   Invisibility
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <tsfun>

new bool:g_bCloakEnabled[33]
new 
g_iLastRender[33]

public 
plugin_init()
{
    
register_plugin("Shadow Cloak""1.0""Spunky")

    
register_clcmd("say /cloak""cmd_cloak")
}

public 
client_disconnect(id)
{
    
g_bCloakEnabled[id] = false
    g_iLastRender
[id] = 0
}

public 
client_PostThink(id)
{
    if (!
is_user_alive(id))
        return 
PLUGIN_CONTINUE

    
else if (!g_bCloakEnabled[id])
        return 
PLUGIN_CONTINUE

    
static Float:fpVelocity[3]
    
entity_get_vector(idEV_VEC_velocityfpVelocity)

    new 
Float:fpSpeed fpVelocity[0] + fpVelocity[1] + fpVelocity[2]
    new 
iModifier fpSpeed != 0.0 : -1
    
new Float:fpRenderAmount float((g_iLastRender[id] = clamp(g_iLastRender[id] + iModifier0255)) + 50)
    static 
iDummy
    
new iWeapon ts_getuserwpn(idiDummyiDummyiDummyiDummy)

    switch (
iWeapon)
    {
        case 
TSW_KATANATSW_KUNG_FUTSW_CKNIFETSW_SKNIFETSW_TKNIFE:
            
fpRenderAmount -= 50.0
    
}

    
entity_set_int(idEV_INT_renderfxkRenderFxGlowShell)
    
entity_set_vector(idEV_VEC_rendercolorFloat:{0.00.00.0})
    
entity_set_int(idEV_INT_rendermodekRenderTransAlpha)
    
entity_set_float(idEV_FL_renderamtfpRenderAmount)

    return 
PLUGIN_CONTINUE
}

public 
cmd_cloak(id)
{
    if (!
is_user_alive(id))
        return 
PLUGIN_HANDLED

    
else if (!g_bCloakEnabled[id])
    {
        
g_bCloakEnabled[id] = true
        g_iLastRender
[id] = 0

        client_print
(idprint_chat"Cloak enabled.")
    }

    else
    {
        
g_bCloakEnabled[id] = false

        client_print
(idprint_chat"Cloak disabled.")
    }

    return 
PLUGIN_HANDLED

This doesn't seem to work but I can't for the life of me figure out why. It should work absolutely fine. I can't see anything wrong with it. When you enable the cloak, they're supposed to slowly fade out for as long as they're standing still. When they move, they fade in. I know it's been done before (and not much differently than this) but I want to know why this won't work.

And if you're wondering, yes, the code is mostly Hawk552's.
Spunky is offline
Send a message via AIM to Spunky
 



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 14:42.


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