Cerere plugin new /invis [ rezolvat ]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
codrutzz
Membru, skill +2
Membru, skill +2
Posts: 539
Joined: 29 Jan 2014, 18:27
Detinator Steam: Da
CS Status: Nu citesc forumu xtreamCS* =]]]
Detinator server CS: In curand
SteamID: Personal
Location: Iasi<3
Has thanked: 68 times
Been thanked: 9 times
Contact:

02 Apr 2014, 07:11

Descriere plugin cerut: Am pluginu asta:
| Afiseaza codul
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define MAX_ENTITYS 900+15*32 // (900+15*SERVER_SLOTS) is the calculation cs uses but it can be bypassed by the "-num_edicts <x>"-parameter

new bool:g_bPlayerInvisible[33];
new bool:g_bWaterInvisible[33];

new bool:g_bWaterEntity[MAX_ENTITYS];
new bool:g_bWaterFound;

new g_iSpectatedId[33];

new const g_szForum[ ] = "***.Ecila.Ro-DianaD";

public plugin_init( )
{
    register_plugin( "Invis", "2.0", "SchlumPF" );
    
    register_clcmd( "say /invis", "menuInvisDisplay" );
    register_menucmd( register_menuid( "\r[FPS] - \wInvizibilitate^n^n" ), 1023, "menuInvisAction" );
    
    register_forward( FM_AddToFullPack, "fwdAddToFullPack_Post", 1 );
    RegisterHam( Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
    
    register_event( "SpecHealth2", "eventSpecHealth2", "bd" );
}

public plugin_cfg( )
{
    new ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_water" ) ) != 0 )
    {
        // pev( ent, pev_skin ) ==  CONTENTS_WATER is also true on func_water entities
        
        if( !g_bWaterFound )
        {
            g_bWaterFound = true;
        }

        g_bWaterEntity[ent] = true;
    }
    
    // thanks to connor for finding the following two detections
    ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_illusionary" ) ) != 0 )
    {
        if( pev( ent, pev_skin ) ==  CONTENTS_WATER )
        {
            if( !g_bWaterFound )
            {
                g_bWaterFound = true;
            }
    
            g_bWaterEntity[ent] = true;
        }
    }
    
    ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_conveyor" ) ) != 0 )
    {
        if( pev( ent, pev_spawnflags ) == 3 )
        {
            if( !g_bWaterFound )
            {
                g_bWaterFound = true;
            }
    
            g_bWaterEntity[ent] = true;
        }
    }
}

public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset )
{
    if( player && g_bPlayerInvisible[host] && host != ent && ent != g_iSpectatedId[host] && get_user_team(host) == get_user_team(ent) )
    {
        static const Float:corner[8][3] = 
        {
            { -4096.0, -4096.0, -4096.0 },
            { -4096.0, -4096.0, 4096.0 },
            { -4096.0, 4096.0, -4096.0 },
            { -4096.0, 4096.0, 4096.0 },
            { 4096.0, -4096.0, -4096.0 },
            { 4096.0, -4096.0, 4096.0 },
            { 4096.0, 4096.0, -4096.0 },
            { 4096.0, 4096.0, 4096.0 }
        };
        
        // rounded; distance from the map's center to the corners; sqrt( 4096^2 + 4096^2 + 4096^2 )
        static const Float:map_distance = 7094.480108;
        
        static Float:origin[3];
        get_es( es_handle, ES_Origin, origin );
        
        static i;
        while( get_distance_f( origin, corner ) > map_distance )
        { 
            if( ++i >= sizeof( corner ) )
            {
                // better to nullify the varibale now then doing it each time before the loop
                i = 0;
            }
        }
        
        set_es( es_handle, ES_Origin, corner );
        set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
    }
    else if( g_bWaterInvisible[host] && g_bWaterEntity[ent])
    {
        set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
    }
}

public hamSpawnPlayer_Post( id )
{
    g_iSpectatedId[id] = 0;
}

// thanks to xPaw who told me about this event
public eventSpecHealth2( id )
{
    g_iSpectatedId[id] = read_data( 2 );
}

public menuInvisDisplay( id )
{
    static menu[256];

    new len = formatex( menu, 255, "\r[FPS] - \wInvizibilitate^n^n" );
    
    len += formatex( menu[len], 255 - len, "\r1. \wCoechipierii: \y%s^n", g_bPlayerInvisible[id] ? "Invizibili" : "Vizibili" );
    
    if( g_bWaterFound )
    {
        len += formatex( menu[len], 255 - len, "\r2. \wApa: \y%s^n", g_bWaterInvisible[id] ? "Invizibila" : "Vizibila" );
    }
    else
    {
        len += formatex( menu[len], 255 - len, "\r2. \wApa: \yNu exista apa pe harta!^n" );
    }

    len += formatex( menu[len], 255 - len, "^n\r0. \wIesire" );
    len += formatex( menu[len], 255 - len, "^n\r%s", g_szForum );
    
    show_menu( id, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );
        
    return PLUGIN_HANDLED;
}

public menuInvisAction( id, key )
{
    switch( key )
    {
        case 0:
        {
            g_bPlayerInvisible[id] = !g_bPlayerInvisible[id];
            menuInvisDisplay( id );
        }
        case 1:
        {
            if( g_bWaterFound )
            {
                g_bWaterInvisible[id] = !g_bWaterInvisible[id];
            }
            
            menuInvisDisplay( id );
        }
        case 9: show_menu( id, 0, "" );
    }
}

public client_connect( id )
{
    g_bPlayerInvisible[id] = false;
    g_bWaterInvisible[id] = false;
    g_iSpectatedId[id] = 0;
}

public client_putinserver( id )
{
	set_task( 5.0, "menuInvisDisplay", id );
}
si vreau la el sa mai adaugati cv ca sa dispara si mainile inclusiv ce are in maini pentru a mari fps.
Alte informatii: -;
Thanks
Last edited by Hades Ownage on 08 Apr 2014, 17:36, edited 1 time in total.
Reason: Marcat ca rezolvat.
RoyalServer 2
User avatar
codrutzz
Membru, skill +2
Membru, skill +2
Posts: 539
Joined: 29 Jan 2014, 18:27
Detinator Steam: Da
CS Status: Nu citesc forumu xtreamCS* =]]]
Detinator server CS: In curand
SteamID: Personal
Location: Iasi<3
Has thanked: 68 times
Been thanked: 9 times
Contact:

03 Apr 2014, 06:56

UP :-"
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

06 Apr 2014, 18:09

| Afiseaza codul
[code=php]#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define MAX_ENTITYS 900+15*32 // (900+15*SERVER_SLOTS) is the calculation cs uses but it can be bypassed by the "-num_edicts <x>"-parameter

new bool:g_bPlayerInvisible[33];
new bool:g_bWaterInvisible[33];

new bool:g_bWaterEntity[MAX_ENTITYS];
new bool:g_bWaterFound;

new g_iSpectatedId[33];

new const g_szForum[ ] = "***.Ecila.Ro-DianaD";

public plugin_init( )
{
    register_plugin( "Invis", "2.0", "SchlumPF" );
    
    register_clcmd( "say /invis", "menuInvisDisplay" );
    register_menucmd( register_menuid( "\r[FPS] - \wInvizibilitate^n^n" ), 1023, "menuInvisAction" );
    
    register_forward( FM_AddToFullPack, "fwdAddToFullPack_Post", 1 );
    RegisterHam( Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
    
    register_event ( "CurWeapon", "Event_CurWeapon", "be", "1=1" );
    register_event( "SpecHealth2", "eventSpecHealth2", "bd" );
}

public plugin_cfg( )
{
    new ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_water" ) ) != 0 )
    {
        // pev( ent, pev_skin ) ==  CONTENTS_WATER is also true on func_water entities
        
        if( !g_bWaterFound )
        {
            g_bWaterFound = true;
        }

        g_bWaterEntity[ent] = true;
    }
    
    // thanks to connor for finding the following two detections
    ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_illusionary" ) ) != 0 )
    {
        if( pev( ent, pev_skin ) ==  CONTENTS_WATER )
        {
            if( !g_bWaterFound )
            {
                g_bWaterFound = true;
            }
    
            g_bWaterEntity[ent] = true;
        }
    }
    
    ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_conveyor" ) ) != 0 )
    {
        if( pev( ent, pev_spawnflags ) == 3 )
        {
            if( !g_bWaterFound )
            {
                g_bWaterFound = true;
            }
    
            g_bWaterEntity[ent] = true;
        }
    }
}

public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset )
{
    if( player && g_bPlayerInvisible[host] && host != ent && ent != g_iSpectatedId[host] && get_user_team(host) == get_user_team(ent) )
    {
        static const Float:corner[8][3] = 
        {
            { -4096.0, -4096.0, -4096.0 },
            { -4096.0, -4096.0, 4096.0 },
            { -4096.0, 4096.0, -4096.0 },
            { -4096.0, 4096.0, 4096.0 },
            { 4096.0, -4096.0, -4096.0 },
            { 4096.0, -4096.0, 4096.0 },
            { 4096.0, 4096.0, -4096.0 },
            { 4096.0, 4096.0, 4096.0 }
        };
        
        // rounded; distance from the map's center to the corners; sqrt( 4096^2 + 4096^2 + 4096^2 )
        static const Float:map_distance = 7094.480108;
        
        static Float:origin[3];
        get_es( es_handle, ES_Origin, origin );
        
        static i;
        while( get_distance_f( origin, corner ) > map_distance )
        { 
            if( ++i >= sizeof( corner ) )
            {
                // better to nullify the varibale now then doing it each time before the loop
                i = 0;
            }
        }
        
        set_es( es_handle, ES_Origin, corner );
        set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
    }
    else if( g_bWaterInvisible[host] && g_bWaterEntity[ent])
    {
        set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
    }
}

public hamSpawnPlayer_Post( id )
{
    g_iSpectatedId[id] = 0;
}

// thanks to xPaw who told me about this event
public eventSpecHealth2( id )
{
    g_iSpectatedId[id] = read_data( 2 );
}

public menuInvisDisplay( id )
{
    static menu[256];

    new len = formatex( menu, 255, "\r[FPS] - \wInvizibilitate^n^n" );
    
    len += formatex( menu[len], 255 - len, "\r1. \wCoechipierii: \y%s^n", g_bPlayerInvisible[id] ? "Invizibili" : "Vizibili" );
    
    if( g_bWaterFound )
    {
        len += formatex( menu[len], 255 - len, "\r2. \wApa: \y%s^n", g_bWaterInvisible[id] ? "Invizibila" : "Vizibila" );
    }
    else
    {
        len += formatex( menu[len], 255 - len, "\r2. \wApa: \yNu exista apa pe harta!^n" );
    }

    len += formatex( menu[len], 255 - len, "^n\r0. \wIesire" );
    len += formatex( menu[len], 255 - len, "^n\r%s", g_szForum );
    
    show_menu( id, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );
        
    return PLUGIN_HANDLED;
}

public menuInvisAction( id, key )
{
    switch( key )
    {
        case 0:
        {
            g_bPlayerInvisible[id] = !g_bPlayerInvisible[id];
            menuInvisDisplay( id );
        }
        case 1:
        {
            if( g_bWaterFound )
            {
                g_bWaterInvisible[id] = !g_bWaterInvisible[id];
            }
            
            menuInvisDisplay( id );
        }
        case 9: show_menu( id, 0, "" );
    }
}

public client_connect( id )
{
    g_bPlayerInvisible[id] = false;
    g_bWaterInvisible[id] = false;
    g_iSpectatedId[id] = 0;
}

public client_putinserver( id )
{
    set_task( 5.0, "menuInvisDisplay", id );
}

public Event_CurWeapon ( id ) {
    
    if ( g_bPlayerInvisible [ id ] ) {
        
        set_pev ( id, pev_viewmodel2, "" );
    }
} [/code]
User avatar
codrutzz
Membru, skill +2
Membru, skill +2
Posts: 539
Joined: 29 Jan 2014, 18:27
Detinator Steam: Da
CS Status: Nu citesc forumu xtreamCS* =]]]
Detinator server CS: In curand
SteamID: Personal
Location: Iasi<3
Has thanked: 68 times
Been thanked: 9 times
Contact:

07 Apr 2014, 15:41

Poti pune sa nu se mai deschida dupa 2 sec ce am schimbat mapa,adica schimb mapa sau intru pe server si apare si nu vreau sa mai apara
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

07 Apr 2014, 21:08

şterge:

Code: Select all

public client_putinserver( id )
{
    set_task( 5.0, "menuInvisDisplay", id );
} 
User avatar
codrutzz
Membru, skill +2
Membru, skill +2
Posts: 539
Joined: 29 Jan 2014, 18:27
Detinator Steam: Da
CS Status: Nu citesc forumu xtreamCS* =]]]
Detinator server CS: In curand
SteamID: Personal
Location: Iasi<3
Has thanked: 68 times
Been thanked: 9 times
Contact:

08 Apr 2014, 17:21

Merge,mersi mult,daca poti sa ma ajuti si aici http://www.extreamcs.com/forum/cereri-c ... 41818.html ar fi super :)>-
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Petal [Bot], Yandex [Bot] and 31 guests