Raised This Month: $ Target: $400
 0% 

Help with Hologram Code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wAyz
Senior Member
Join Date: Feb 2010
Location: Germany
Old 01-17-2014 , 06:38   Help with Hologram Code
Reply With Quote #1

Hello,

I'm using this code by ConnorMcLeod.

Code:
#include <amxmodx> 
#include <engine> 
#include <fun> 
#include <fakemeta> 
#include <hamsandwich> 

new const VERSION[] = "0.7.0" 

const MAX_PLAYERS = 32 

new g_iPlayers[MAX_PLAYERS], g_iNum, g_iPlayer, i 
new const g_szAliveFlags[] = "a" 
#define RefreshPlayersList()    get_players(g_iPlayers, g_iNum, g_szAliveFlags) 

public plugin_init() 


{    

    register_plugin("Hologram", VERSION, "ConnorMcLeod") 

    register_forward(FM_AddToFullPack, "FM_client_AddToFullPack_Post", 1) 

    RegisterHam(Ham_Player_PreThink, "player", "Ham_CBasePlayer_PreThink_Post", 1) 
} 



public FM_client_AddToFullPack_Post(es, e, iEnt, id, hostflags, player, pSet) 
{ 
    if( player && id != iEnt && get_orig_retval() && is_user_alive(id) ) 
    { 
        set_es(es, ES_Solid, SOLID_NOT) 

        set_es(es, ES_RenderMode, kRenderTransAdd) 
        set_es(es, ES_RenderAmt, 80)
        set_es(es, ES_RenderColor, 0, 0, 0)
        set_es(es, ES_RenderFx, kRenderFxDistort)
    } 
} 

public Ham_CBasePlayer_PreThink_Post(id) 
{ 
    if( !is_user_alive(id) ) 
    { 
        return 
    } 

    RefreshPlayersList() 

    for(i = 0; i<g_iNum; i++) 
    { 
        g_iPlayer = g_iPlayers[i] 
        if( id != g_iPlayer ) 
        { 
            set_pev(g_iPlayer, pev_solid, SOLID_NOT) 
        } 
    } 
} 

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

    RefreshPlayersList() 

    for(i = 0; i<g_iNum; i++) 
    { 
        g_iPlayer = g_iPlayers[i] 
        if( g_iPlayer != id ) 
        { 
            set_pev(g_iPlayer, pev_solid, SOLID_SLIDEBOX) 
        } 
    } 
}
Would it be possible to make this code only affect on Spectators? That would be a cool
feature for my HNS Server (Spectators wouldn't block other players).
I will have to include <cstrike> and using cs_get_user_team but I don't know exactly where to put it.
Maybe ConnorMcLeod or some other guy knows.

Last edited by wAyz; 01-17-2014 at 06:40.
wAyz 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 10:15.


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