Jump to content

    Rangos Por Horas

    I'mBuggimen.
    Por I'mBuggimen.

    Rangos Por Horas

     

    Explicación:

     

    Para el Rango 1: Necesitas 5 Horas;

    Para el Rango 2: Necesitas 10 Horas;

     

    Pd: Las Horas Se Ganan Jugando en el Servidor

     

    Changelog:

    /*
    Changelog:
    	- 1.0 - Lanzamiento Oficial
    	- 1.5 - Re estructurando partes del codigo 
    	- 1.7 - Agregando Privilegios a los Jugadores
    */
    

     

    Mejoras en la 1.7:

    - Habilidades Especiales ( desbloqueables por Rangos & Actiavar/Desactivar al gusto del jugador );

     

     

    CVARS:

    - rh_habilidades - 1/0 Activas/Desactivas - [ Habilidades Especiales ]

     

     

    Créditos:

     

    Jollero = Idea,

    Destro = Su ingenioso Advanced_vault;

     

    Necesitas:

     

    Advanced Vault LINK: https://amxmodx-es.com/Thread-API-Advanc...#pid104596

     

    #include < amxmodx >
    #include < adv_vault >
    
    #define HUD_ID (taskid-TASK_HOURS)
    #define TASK_HOURS 100
    
    new const g_iCredits[ ][ ] = { "Rangos Por Horas", "1.0b", "ImBuggimen" };
    
    /* ===================================================== 
    * <<<<<<<<<<<<    INICIA SECCION MODIFICABLE >>>>>>>>>>>>> 
    * ===================================================*/
    
    enum _:_STRUCT_RANGE { RNAME[ 90 ], HOURS_REQUIRED };
    enum _:_STRUCT_TIME { SEGUNDOS, MINUTOS, HORAS };
    enum { FIELD_TIMES, FIELD_RANGES, MAX_FIELDS };
    
    
    #pragma semicolon 1
    
    new const g_szRangos[ ][ _STRUCT_RANGE ] =
    {
       { "Miembro Nuevo", 0 },
       { "Miembro Reconocido", 3 },
       { "Miembro Sr.", 10 },
       { "Miembro Heroe", 15 },
       { "Veterano", 20 },
       { "", 999999 } // Fix Bug del Hud
    };
    
    
    new g_iRangos[ 33 ];
    new g_iTime[ 33 ][ _STRUCT_TIME ];
    new g_iPlayerName[ 33 ][ 32 char ];
    new g_iFields[ MAX_FIELDS ];
    
    new g_iHud;
    new g_iGuardado;
    
    public plugin_init( ) 
    {
       register_plugin( g_iCredits[ 0 ], g_iCredits[ 1 ], g_iCredits[ 2 ] );
    
       g_iHud = CreateHudSyncObj( );
    
       g_iGuardado = adv_vault_open( "GuardadoRanges", false );
    
       g_iFields[ FIELD_RANGES ] = adv_vault_register_field( g_iGuardado, "Ranges" );
       g_iFields[ FIELD_TIMES ]  = adv_vault_register_field( g_iGuardado, "Times", DATATYPE_ARRAY, 3 );
    
       adv_vault_init( g_iGuardado );
    }
    
    public client_putinserver( index )
    {
       get_user_name( index, g_iPlayerName[ index ], charsmax( g_iPlayerName[ ] ) );
       arrayset( g_iTime[ index ], 0, sizeof( g_iTime[ ] ) );
       g_iRangos[ index ] = 0;
       set_task( 1.0, "ShowHRangos", index+TASK_HOURS, _, _, .flags = "b" );
       iCargar( index );
    }
    
    public client_infochanged( index )
    {
       if( !is_user_connected( index ) ) return;
    
       static NewName[ 32 ];
       get_user_info( index, "name", NewName, 31 );
    
       if( !equal( NewName, g_iPlayerName[ index ] ) )
       {
           copy( g_iPlayerName[ index ], 31, NewName );
           iCargar( index );
       }
    }
    
    public client_disconnect( index ) 
    {
       remove_task( index+TASK_HOURS );
       iGuardar( index );
    }
    
    public ShowHRangos( taskid )
    {
       static index; index = HUD_ID;
    
       if( is_user_connected( index ) )
       {
           if( g_iTime[ index ][ SEGUNDOS ] > 59 )
           {
               g_iTime[ index ][ SEGUNDOS ] = 0;
               g_iTime[ index ][ MINUTOS ]++;
           }
           else g_iTime[ index ][ SEGUNDOS ]++;
    
           if( g_iTime[ index ][ MINUTOS ] > 59 )
           {
               g_iTime[ index ][ MINUTOS ] = 0;
               g_iTime[ index ][ HORAS ]++;
               Range_check( index );
           }
       }
       set_hudmessage( 200, 100,  0, 0.1, 0.03, 1 );
       ShowSyncHudMsg( index, g_iHud, "[ Rango: %s ]^n^n[ Tiempo Jugado ]^n[ Segundos: %d ]^n[ Minutos: %d ]^n[ Horas: %d ]",
       g_szRangos[ g_iRangos[ index ] ][ RNAME ], g_iTime[ index ][ SEGUNDOS ], g_iTime[ index ][ MINUTOS ], g_iTime[ index ][ HORAS ] );
    }
    
    public Range_check( index )
    {
       new Range_Up = false;
    
       if( g_iTime[ index ][ HORAS ] >= g_szRangos[ g_iRangos[ index ] ][ HOURS_REQUIRED ] )
       {
           g_iRangos[ index ]++;
           Range_Up = true;
       }
       if( Range_Up ) iChat( index, "^4Haz Sido Promovido a %s", g_szRangos[ g_iRangos[ index ] ][ RNAME ] ), Range_Up = false;
    }
    
    public iGuardar( index )
    {
       adv_vault_set_start( g_iGuardado );
    
       adv_vault_set_field( g_iGuardado, g_iFields[ FIELD_TIMES ], g_iTime[ index ] );
       adv_vault_set_field( g_iGuardado, g_iFields[ FIELD_RANGES ], g_iRangos[ index ] );
    
       adv_vault_set_end( g_iGuardado, 0, g_iPlayerName[ index ] );
    }
    
    public iCargar( index )
    {
       if( !adv_vault_get_prepare( g_iGuardado, _, g_iPlayerName[ index ] ) ) return;
    
       g_iRangos[ index ] = adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_RANGES ] );
       adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_TIMES ], g_iTime[ index ], sizeof ( g_iTime[ ] ) );    
    }
    
    stock iChat( index, const input[ ], any:... )
    {
       static iSayText, sziMsg[ 191 ];
    
       if ( !iSayText )
       iSayText = get_user_msgid( "SayText" );
    
       replace_all( sziMsg, 190, "!g", "^4" );
       replace_all( sziMsg, 190, "!y", "^1" );
       replace_all( sziMsg, 190, "!team", "^3" );
    
       vformat( sziMsg, 190, input, 3 );
       message_begin( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = index );
       write_byte( index ? index : 33 );
       write_string( sziMsg );
       message_end( );
    
    }

     

    Version 1.7:

     

    /*
    Changelog:
    	- 1.0 - Lanzamiento Oficial
    	- 1.5 - Re estructurando partes del codigo 
    	- 1.7 - Agregando Privilegios a los Jugadores
    */
    
    new const g_szCustom[ ] = { "Rangos Por Horas", "1.7b", "I'mBuggimen." };
    
    #include < amxmodx.inc >
    #include < amxmisc.inc >
    #include < fun.inc >
    #include < hamsandwich.inc >
    #include < fakemeta.inc >
    #include < adv_vault.inc >
    
    
    // =========================[~~]===========================
    
    #define TASK_HOURS 1212
    #define HUD_ID ( taskid - TASK_HOURS )
    
    #define SetPlayerBit(%0,%1)	( %0 |= ( 1 << ( %1 & 31 ) ) )
    #define GetPlayerBit(%0,%1)	( %0 & ( 1 << ( %1 & 31 ) ) )
    #define ClearPlayerBit(%0,%1)	( %0 &= ~( 1 << ( %1 & 31 ) ) )
    
    #define ClearString(%0)		( %0[ 0 ] = EOS )
    #define GET_SIZE(%0)		( sizeof( %0 ) - 1 )
    
    // =========================[~~]===========================
    
    enum
    {
    LOAD = 0,
    SAVE
    };
    
    enum
    {
    FIELD_TIMES,
    FIELD_RANGES,
    
    MAX_FIELDS
    };
    
    enum _: TIME_STRUCTURE
    {
    SECS = 0,
    MINS,
    HOURS
    };
    
    enum _: RANGE_STRUCTURE
    {
    RANGE_NAME[ 32 ],
    RANGE_REQUIRED
    };
    
    enum _: HABS_STRUCTURE 
    { 
    Updates_Name[ 32 ],
    Updates_Desc[ 150 ],
    Updates_Required
    } ;
    
    // =========================[~~]===========================
    
    new const g_szRangos[ 6 ][ RANGE_STRUCTURE ] =
    {
    { "Miembro Nuevo", 0 },
    { "Miembro Reconocido", 3 },
    { "Miembro Sr.", 10 },
    { "Miembro Heroe", 15 },
    { "Veterano", 20 },
    { "Miembro Destacado", 25 }
    };
    
    new const g_szMejoras[ ][ HABS_STRUCTURE ] = 
    {
    { "Bullet's Damage", "Esta Habilidad Es Muy Util^nTe Permite Ver El Daño INFLINGIDO", 1 },
    { "BunnyHop", "Esta Habilidad te va a permitir Saltar Sucesivamente Como Conejo^nTendras mas control del mapa", 2 },
    { "Probabilidad de Daño Critico!", "Dicha Habilidad Hara que Aumente un probabilidad de Daño critico^nEs decir si pegas 50 normal con critico pegas 100", 3 }
    };
    
    
    // =========================[~~]===========================
    
    new g_iRangos[ 33 ];
    new g_iTime[ 33 ][ TIME_STRUCTURE ];
    new g_szPN[ 33 ][ 32 ];
    new g_iFields[ MAX_FIELDS ];
    
    new sycn;
    
    new g_iHud;
    new g_iGuardado;
    
    new g_bConnected;
    new g_bAlive;
    
    new KEYUPDT =  ( 1 << 0 )|( 1 << 9 )  ;
    
    new g_szTxt[ 500 ];
    
    new g_iIdMejoras[ 32 + 1 ] ;
    new g_iMejoras[ 32 + 1 ][ sizeof( g_szMejoras[ ] ) ];
    
    new g_Mp;
    
    const XO_PLAYER =	 5
    const m_iTeam =		114
    
    new g_iTeam[ 33 ];
    
    new pcvar_allowhabs;
    
    public plugin_init( ) 
    {
    register_plugin( g_szCustom[ 0 ], g_szCustom[ 1 ], g_szCustom[ 2 ] );
    
    RegisterHam( Ham_Spawn, "player", "fHam_Spawn_Post", 1 )
    RegisterHam( Ham_Player_Jump, "player", "fHam_Jump_Pre", 0 ) ;
    RegisterHam( Ham_TakeDamage, "player", "fHam_TakeDamage_Pre", 0 );
    
    register_menu( "Menu Habilidades" , KEYUPDT , "mh_mejoras_inf" ) ;
    
    register_clcmd( "say /habilidades", "func_habilities" );
    
    g_iHud = CreateHudSyncObj( );
    
    g_Mp = get_maxplayers( );
    
    pcvar_allowhabs = create_cvar( "rh_habilidades", "1", _, "< 1/0 Activas/Desactivas - [ Habilidades Especiales ] >"  );
    
    Adv_Initialize( );
    
    sycn = CreateHudSyncObj( );
    }
    
    public Adv_Initialize( )
    {
    g_iGuardado = adv_vault_open( "GuardadoRangos", false );
    
    g_iFields[ FIELD_RANGES ] = adv_vault_register_field( g_iGuardado, "Ranges" );
    g_iFields[ FIELD_TIMES ]  = adv_vault_register_field( g_iGuardado, "Times", DATATYPE_ARRAY, 3 );
    
    adv_vault_init( g_iGuardado );
    }
    
    public fHam_Spawn_Post( const index )
    {
    if( GetPlayerBit( g_bConnected, index ) && !( GetPlayerBit( g_bAlive, index ) ) && is_user_alive( index	) )
    	SetPlayerBit( g_bAlive, index );
    
    if( GetPlayerBit( g_bAlive, index ) )
    {
    	g_iTeam[ index ] = get_pdata_int( index, m_iTeam, XO_PLAYER );
    }
    }
    
    public fHam_Killed_Post( const iVictim, const iKiller, const bool: bShouldgib )
    {
    if( iVictim == iKiller || !iKiller || g_iTeam[ iKiller ] == g_iTeam[ iVictim ] )
    	return HAM_IGNORED;
    
    ClearPlayerBit( g_bAlive, iVictim );
    
    return HAM_IGNORED;
    }
    
    public fHam_Jump_Pre( const index )
    {
    
    if( !get_pcvar_num( pcvar_allowhabs ) )
    	return HAM_IGNORED;
    
    if ( GetPlayerBit( g_bAlive, index ) && g_iMejoras[ index ][ 1 ] )
    {
    	pev( index, pev_fuser2, 0.0 ) ;
    
    	static flags ; flags = pev( index, pev_flags );
    
    	if ( ( flags & FL_WATERJUMP ) || !( flags & FL_ONGROUND ) || pev( index , pev_waterlevel ) >= 2 )
    	return HAM_IGNORED ;
    
    	static Float: vec[ 3 ] ; pev( index, pev_velocity, vec ) ;
    
    	vec[ 2 ] += 250.0 ;
    
    	set_pev( index , pev_velocity, vec ) ;
    
    }
    return HAM_HANDLED;
    }
    
    public fHam_TakeDamage_Pre( const victim, const Inflictor, const attacker, const Float:damage, const damage_type )
    {
    if ( victim == attacker || !( 1 <= attacker <= g_Mp && GetPlayerBit( g_bConnected , attacker ) ) )
    	return HAM_IGNORED ;
    
    if ( !( 1 <= victim <= g_Mp ) || g_iTeam[ attacker ] == g_iTeam[ victim ] )
    	return HAM_IGNORED ; 
    
    if( !get_pcvar_num( pcvar_allowhabs )  )
    	return HAM_IGNORED;
    
    if ( g_iMejoras[ attacker ][ 2 ] )
    {
    	if( random_num( 0, 100 ) < random_num( 0, 100 ) < random_num( 0, 100 ) )
    	{
    		SetHamParamFloat( 4, damage * 2 );
    		set_hudmessage( 0, 255, 0, -1.0, -1.0, 0, 6.0, 1.1, 3.0, 3.0, 3 );
    		show_hudmessage( attacker, "Golpe Critico!!!!" ) ;
    	}
    }
    
    if( g_iMejoras[ attacker ][ 0 ] )
    {		
    	set_hudmessage( 255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1 );
    	ShowSyncHudMsg( attacker, sycn, "Daño Inflingido: %i^n", floatround( damage ) );		
    }
    
    return HAM_HANDLED;
    }
    
    public func_habilities( const index )
    {
    if( !get_pcvar_num( pcvar_allowhabs ) )
    	return PLUGIN_CONTINUE;
    
    ShowHabs( index );
    
    return PLUGIN_HANDLED;
    }
    
    public ShowHabs( const index )
    {
    ClearString( g_szTxt );
    static menu , r ; 
    
    formatex( g_szTxt, GET_SIZE( g_szTxt ), "Lista de \yHabilidades" );
    
    menu = menu_create( g_szTxt , "mh_mejoras" ) ;
    
    for ( r = 0 ; r < sizeof( g_szMejoras ) ; ++ r )
    	menu_additem( menu, g_szMejoras[ r ][ Updates_Name ] ) ;
    
    menu_setprop( menu, MPROP_NUMBER_COLOR, "\y" );
    
    menu_setprop( menu, MPROP_NEXTNAME, "Siguiente" );
    menu_setprop( menu, MPROP_BACKNAME, "Atras" );
    
    menu_setprop( menu, MPROP_EXITNAME, "Salir" );
    
    menu_display( index, menu ) ;
    
    }
    
    public mh_mejoras( const index, const menu , const item )
    {
    if ( item == MENU_EXIT || get_pcvar_num( pcvar_allowhabs ) < 1 ) { menu_destroy( menu ) ; return PLUGIN_HANDLED; }
    
    g_iIdMejoras[ index ] = item ;
    
    mejoras_inf( index , item ) ;
    
    menu_destroy( menu ) ;
    return PLUGIN_HANDLED;
    }
    
    public mejoras_inf( const index , const item )
    {
    ClearString( g_szTxt );
    static len ; len = 0 ;
    
    len += formatex( g_szTxt[ len ] , GET_SIZE( g_szTxt ) - len, "\y%s \dHabilidad:^n\y%s^n^n", 
    g_iMejoras[ index ][ item ] ? "Habilitar \wo \rDesahabilitar" : "Viendo",
    g_szMejoras[ item ][ Updates_Name ] ) ;
    
    len += formatex( g_szTxt[ len ] , GET_SIZE( g_szTxt ) - len, "\yDESCRIPCION:^n\d %s^n^n", g_szMejoras[ item	][ Updates_Desc ] );
    
    if( g_iRangos[ index ] < g_szMejoras[ item ][ Updates_Required ] )
    {
    	len += formatex( g_szTxt[ len ] , GET_SIZE( g_szTxt ) - len, "\yNECESARIO:^n" ) ;
    
    	len += formatex( g_szTxt[ len ] , GET_SIZE( g_szTxt ) - len, "\y-\d Rango Requerido: \w%s ^n^n", g_szRangos[ g_szMejoras[ item ][ Updates_Required ] ][ RANGE_NAME ] ) ;
    }
    else
    {
    	len += formatex( g_szTxt[ len ] , GET_SIZE( g_szTxt ) - len, "\y[ \w1 \y]. \w%s \yHabilidad^n^n" , 
    	g_iMejoras[ index ][ item ] ? "Deshabilitar" : "Habilitar" );
    }
    
    
    len += formatex( g_szTxt[ len ] , GET_SIZE( g_szTxt ) - len, "\y[ \w0 \y]. \wAtras" ) ;
    
    show_menu( index, KEYUPDT, g_szTxt, -1 , "Menu Habilidades" );
    } 
    
    public mh_mejoras_inf( index , key )
    {
    switch( key )
    {
    	case 0 :
    	{
    		g_iMejoras[ index ][ g_iIdMejoras[ index ] ] = 1 - g_iMejoras[ index ][ g_iIdMejoras[ index ] ] ;
    		mejoras_inf( index, g_iIdMejoras[ index ] ) ;
    
    	}
    	case 9 : 
    	{
    		func_habilities( index ) ;
    	}
    
    }
    return PLUGIN_HANDLED ;
    }
    
    public client_putinserver( index )
    {
    SetPlayerBit( g_bConnected, index );
    
    get_user_name( index, g_szPN[ index ], charsmax( g_szPN[ ] ) );
    
    arrayset( g_iTime[ index ], 0, sizeof( g_iTime[ ] ) );
    
    g_iRangos[ index ] = 0;
    
    set_task( 1.0, "ShowHRangos", index+TASK_HOURS, _, _, .flags = "b" );
    
    func_management( index, LOAD );
    }
    
    public client_infochanged( index )
    {
    if( !is_user_connected( index ) ) return;
    
    static NewName[ 32 ];
    get_user_info( index, "name", NewName, 31 );
    
    if( !equal( NewName, g_szPN[ index ] ) )
    {
    	copy( g_szPN[ index ], 31, NewName );
    	func_management( index, SAVE );
    }
    }
    
    public client_disconnect( index ) 
    {
    remove_task( index + TASK_HOURS );
    
    ClearPlayerBit( g_bConnected, index ); 
    func_management( index, SAVE );
    }
    
    public ShowHRangos( taskid )
    {
    static index; index = HUD_ID;
    
    if( GetPlayerBit( g_bConnected, index ) )
    {
    	if( g_iTime[ index ][ SECS ] >= 59 )
    	{
    		g_iTime[ index ][ SECS ] = 0;
    		g_iTime[ index ][ MINS ]++;
    	}
    	else 
    		g_iTime[ index ][ SECS ]++;
    
    	if( g_iTime[ index ][ MINS ] >= 59 )
    	{
    		g_iTime[ index ][ MINS ] = 0;
    		g_iTime[ index ][ HOURS ]++;
    		Range_check( index );
    	}
    }
    set_hudmessage( 200, 100,  0, 0.1, 0.03, 1 );
    ShowSyncHudMsg( index, g_iHud, "Rango: [ %s ]^n^n[ Tiempo Jugado ]^n[ Segundos: %d ]^n[ Minutos: %d ]^n[ Horas: %d ]",
    g_szRangos[ g_iRangos[ index ] ][ RANGE_NAME ], g_iTime[ index ][ SECS ], g_iTime[ index ][ MINS ], g_iTime[ index ][ HOURS ] );
    }
    
    public Range_check( index )
    {
    static Range_Up, iLimit; Range_Up = false;
    
    iLimit = ( GET_SIZE( g_szRangos ) );
    
    if( g_iTime[ index ][ HOURS ] >= g_szRangos[ g_iRangos[ index ] ][ RANGE_REQUIRED ] && g_iRangos[ index ] < iLimit )
    {
    	g_iRangos[ index ] += clamp( 1, 0, iLimit ) ;
    	Range_Up = true;
    }
    if( Range_Up )
    {	
    	CC( 0, "^4%s a sido promovido a ^1%s", g_szPN[ index ], g_szRangos[ g_iRangos[ index ] ][ RANGE_NAME ] );
    	func_management( index, 0 );
    	Range_Up = false;
    }
    }
    
    public func_management( index, iWhat )
    {
    switch( iWhat )
    {
    	case LOAD:
    	{
    		if( !adv_vault_get_prepare( g_iGuardado, _, g_szPN[ index ] ) ) 
    			return;
    
    		g_iRangos[ index ] = adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_RANGES ] );
    		adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_TIMES ], g_iTime[ index ], sizeof ( g_iTime[ ] ) ); 
    	}
    	case SAVE:
    	{	
    		adv_vault_set_start( g_iGuardado );
    
    		adv_vault_set_field( g_iGuardado, g_iFields[ FIELD_TIMES ], g_iTime[ index ] );
    		adv_vault_set_field( g_iGuardado, g_iFields[ FIELD_RANGES ], g_iRangos[ index ] );
    
    		adv_vault_set_end( g_iGuardado, 0, g_szPN[ index ] );			
    	}
    }
    }
    
    stock CC( index, const input[ ], any:... )
    {
    static iSayText, sziMsg[ 191 ];
    
    if ( !iSayText )
    iSayText = get_user_msgid( "SayText" );
    
    replace_all( sziMsg, 190, "!g", "^4" );
    replace_all( sziMsg, 190, "!y", "^1" );
    replace_all( sziMsg, 190, "!team", "^3" );
    
    vformat( sziMsg, 190, input, 3 );
    message_begin( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = index );
    write_byte( index ? index : 33 );
    write_string( sziMsg );
    message_end( );
    
    } 
    

     

    Criticas Constructivas y/o Sugerencias.


    Cuando te caes en una carrera y tu moto quiere seguir

    MulocK
    Por MulocK

    Hi!!!

    kikizon
    Por kikizon

    Hola, vengo a este foro a "tratar" de aprender de mapping, ya que tengo un par de proyectos a futuro donde necesitare interaccion entre plugin-mapa.

     

    Saludos (;


    Duelos/Agites 1vs1 MULOCK [ImperiumAO 1.5]

    MulocK
    Por MulocK

    Video de hace unos meses antes de que deje de jugar al IAO aunque actualmente estoy queriendo volver un poco mas al gamming ya que me está sobrando tiempo para el foro, boludeces y demás

     


    Aim_duster [Mapa del mes]

    Carnacleos
    Por Carnacleos

    Descripción: Un simple mapa con un toque de polvo (¿)

     

    Titulo del mapa: Aim_duster

     

    Tipo: Aim_

     

    Slots: 10 TT - 10 CT

     

    Tamaño: Chico

     

    Descarga: http://www.mediafire.com/download/8un2tqts0r88t8c/aim_duster.rar

     

    Imágenes y comentarios: 04A9ED8B1.jpg

     

    3473C5716.jpg

     

    59FA46CFD.jpg


    Tu película porno favorita?

    Vodka[95]
    Por Vodka[95]

    La mía es missign texture del Garrys mod,pero cual es la tuya?whistling


    Cómo utilizar la entidad "light_spot"

    DanielMap
    Por DanielMap

    Cómo utilizar la entidad "light_spot".

    light_spot3.thumb.jpg.84fa171faf2bcbe5c2cab51a68e5b41c.jpg

    QroojCx.jpg
    Fm5yhy5.jpg
    RMF: Proximamente

     

    De ser necesario, ire actualizando el post


    Martin Jensen Tropical Duck Army

    MulocK
    Por MulocK


    Mod Chainsaw [1.7]

    Skylar
    Por Skylar

    Nombre del mod: Mod Chainsaw

    Autor/Creador del mod: Skylar

    Versión del mod: 1.7

    Imágenes: No tengo.

     

    Descripción: Al comenzar la ronda, se elegirá al azar/random un usuario que será elegido cómo el Chainsaw, la función del Chainsaw será matar a todos los humanos.

     

    Créditos:

    Kikizon2 = Algunos plugins suyos, y fixs.

    Matians = Algunos bugs/problemas en el código.

    Nazi.- = Algunas cosas de sus códigos.

    Luchito = Optimizaciones.

    NkkI = Bloquear linterna, y algunas otras cosas.

    I'mBuggimen = Bitsum y otras cosas.

     

    El changelog del mod, está dentro del archivo .sma.

     

    Recursos:http://www.mediafire.com/download/2jb1941bu8ucw7q/ArchivosModChainsaw.rar

     

    Archivo .sma: https://amxmodx-es.com/attachment.php?aid=3276

    Include: https://amxmodx-es.com/attachment.php?aid=3188

     

    Bug, error, log, comenten, lo arreglaré enseguida.

     

    No sé subír archivos adjuntos, así que dejo el código en php y también dejo el .sma para descargar.

     

    Gracias :D

     

    /* ==============================================================================================
    
    			[ Mod Chainsaw ]
    
    			Changelog
    
    			 1.0 - Creación del modo.
    
    			 1.1 - 
    			       Agregado conteo
    			       Model al humano y al chainsaw. 
    
    			 1.2 - Corregido algunos bugs.
    
    			 1.3 - 
    			       Corregido algunos bugs.
    			       Agregado model y sound al knife chainsaw.
    			       Agregado menú de armas.
    			       Agregado model al knife humano.
    
    			 1.4 -
    			       Corregido algunos bugs.
    			       Bloqueado chooseteam.
    
    			 1.5 -
    			       Corregido mas bugs.
    			       Bloqueado c4.
    			       Algunas optimizaciones.
    
    			 1.6 -
    			       Agregado bitsum.
    			       Bloqueada linterna para el chainsaw.
    
    			 1.7 -
    			       Corregido bugs.
    
    ============================================================================================== */
    
    // Includes
    #include <amxmodx>
    #include <amxmisc>
    #include <cstrike>
    #include <colorchat>
    #include <engine>
    #include <fakemeta>
    #include <fun>
    #include <hamsandwich>
    
    // Register Plugin
    new const RegisterPlugin[][] = { "Mod Chainsaw", "1.7", "Skylar" };
    
    // Prefix
    new const sPrefix[] = "^3[ M. Chainsaw ]^1";
    
    // Defines
    #define TIEMPO 40.0
    
    // Bitsum
    #define BitTrue(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) ) 
    #define IsBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) ) 
    #define BitFalse(%1,%2) ( %1 &= ~ ( 1 << ( %2 & 31 ) ) ) 
    
    /* =================================================================================
    
    ================================================================================= */
    
    new gChainsaw[33];
    new gTiempoConteo, gConteoHud;
    new gVarHud, iMaxP;
    new gUsuarioConectado, gUsuarioVivo;
    
    enum (+=100) { TASK_CONTEO = 2000 };
    enum _:ARMAS
    {
    NOMBRE[90],
    ARMA[90],
    CSW,
    BPAMMO
    }
    
    const gVidaHumano = 200;
    const gArmorHumano = 200;
    const Float:gSpeedHumano = 260.0;
    const Float:gGravHumano = 0.5;
    new const ModelHumano[] = "Player_Humano";
    new const ModelKnifeHumano[] = "models/ModChainsaw/vKnifeHumano.mdl";
    
    const gVidaChainsaw = 5000;
    const Float:gSpeedChainsaw = 270.0;
    const Float:gGravChainsaw = 0.3;
    new const ModelChainsaw[] = "Player_Chainsaw";
    new const ModelKnifeChainsaw[] = "models/ModChainsaw/vKnifeChainsaw.mdl";
    
    new const gSonidosConteo[][] = 
    { 
    0,
    "ModChainsaw/Conteo/one.wav",
    "ModChainsaw/Conteo/two.wav",
    "ModChainsaw/Conteo/three.wav",
    "ModChainsaw/Conteo/four.wav",
    "ModChainsaw/Conteo/five.wav",
    "ModChainsaw/Conteo/six.wav",
    "ModChainsaw/Conteo/seven.wav",
    "ModChainsaw/Conteo/eight.wav",
    "ModChainsaw/Conteo/nine.wav",
    "ModChainsaw/Conteo/ten.wav"
    };
    
    new const gChainsawSounds[][] = 
    { 
    "ModChainsaw/Knife/chainsaw2_miss.wav", 
    "ModChainsaw/Knife/chainsaw1_miss.wav", 
    "ModChainsaw/Knife/chainsaw2_miss.wav", 
    "ModChainsaw/Knife/chainsaw1_hit.wav", 
    "ModChainsaw/Knife/chainsaw2_hit.wav", 
    "ModChainsaw/Knife/chainsaw1_hit.wav", 
    "ModChainsaw/Knife/chainsaw1_miss.wav", 
    "ModChainsaw/Knife/chainsaw2_miss.wav", 
    "ModChainsaw/Knife/chainsaw1_hit.wav" 
    };
    
    new const gKnifeSounds[][] = 
    { 
    "weapons/knife_deploy1.wav", 
    "weapons/knife_hit1.wav", 
    "weapons/knife_hit2.wav", 
    "weapons/knife_hit3.wav", 
    "weapons/knife_hit4.wav", 
    "weapons/knife_hitwall1.wav", 
    "weapons/knife_slash1.wav", 
    "weapons/knife_slash2.wav", 
    "weapons/knife_stab.wav" 
    };
    
    new const SoundAmbient[] = "sound/ModChainsaw/Ambient.mp3";
    
    new const BlockWeapon[][] = { "weaponbox", "armoury_entity", "weapon_shield" };
    
    new const PRIMARIAS[][ARMAS] =
    {
    { "Ingram MAC-10", "weapon_mac10", CSW_MAC10, 999 },
    { "Schmidt TMP", "weapon_tmp", CSW_TMP, 999 },
    { "UMP 45", "weapon_ump45", CSW_UMP45, 999 },
    { "MP5 Navy", "weapon_mp5navy", CSW_MP5NAVY, 999 },
    { "ES P90", "weapon_p90", CSW_P90, 999 },
    { "IMI Galil", "weapon_galil", CSW_GALIL, 999 },
    { "Famas", "weapon_famas", CSW_FAMAS, 999 },
    { "SG-552 Commando", "weapon_sg552", CSW_SG552, 999 },
    { "M4A1 Carbine", "weapon_m4a1", CSW_M4A1, 999 },
    { "AK-47 Kalashnikov", "weapon_ak47", CSW_AK47, 999 }
    };
    new const SECUNDARIAS[][ARMAS] =
    {
    { "USP .45 ACP Tactical", "weapon_usp", CSW_USP, 999 },
    { "Glock 18C", "weapon_glock18", CSW_GLOCK18, 999 },
    { "P228 Compact", "weapon_p228", CSW_P228, 999 },
    { "FiveseveN", "weapon_fiveseven", CSW_FIVESEVEN, 999 },
    { "Desert Eagle .50 AE", "weapon_deagle", CSW_DEAGLE, 999 },
    { "Dual Elite Berettas", "weapon_elite", CSW_ELITE, 999 }
    };
    
    new const MensajesMod[][] =
    {
    "%s Mod creado por^4 Skylar^1.",
    "%s Puedes encontrar el mod en^4 amxmodx-es.com^1.",
    "%s Nombre:^4 Chainsaw Mod ^3||^1 Version:^4 1.7^1."
    };
    
    const PEV_SPEC_TARGET = pev_iuser2;
    const IMPULSE_FLASHLIGHT = 100;
    
    /* =================================================================================
    
    ================================================================================= */
    
    public client_putinserver(id) BitTrue(gUsuarioConectado, id);
    
    public client_disconnect(id)
    {
    BitFalse(gUsuarioConectado, id);
    BitFalse(gUsuarioVivo, id);
    }
    
    public plugin_precache()
    {
    static i;
    
    set_lights("b");
    
    static gPrecache[64];
    
    formatex(gPrecache, charsmax(gPrecache), "models/player/%s/%s.mdl", ModelHumano, ModelHumano);
    precache_model(gPrecache);
    
    formatex(gPrecache, charsmax(gPrecache), "models/player/%s/%s.mdl", ModelChainsaw, ModelChainsaw);
    precache_model(gPrecache);
    
    precache_model(ModelKnifeHumano);
    precache_model(ModelKnifeChainsaw);
    
    for(i = 0; i < sizeof gSonidosConteo; i++)
    	engfunc(EngFunc_PrecacheSound, gSonidosConteo[i]);
    
    for(i = 0; i < sizeof gChainsawSounds; i++) 
    	precache_sound(gChainsawSounds[i]);
    
    precache_sound(SoundAmbient);
    }
    
    public plugin_init()
    {
    register_plugin(RegisterPlugin[0], RegisterPlugin[1], RegisterPlugin[2]);
    
    register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0" );
    register_logevent("event_RoundEnd", 2, "1=Round_End");
    
    register_clcmd("drop", "ClcmdBlock");
    register_clcmd("kill", "ClcmdBlock");
    register_clcmd("chooseteam", "ClcmdBlockJoin");
    
    RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn");
    RegisterHam(Ham_Item_PreFrame, "player", "ham_Item_Preframe");
    for(new i = 0; i < sizeof BlockWeapon; ++i)
    	RegisterHam(Ham_Touch, BlockWeapon[i], "ham_TouchWeapon");
    RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_Item_Deploy_Post", 1)
    RegisterHam(Ham_Spawn, "weapon_c4", "BlockC4", true);
    
    register_forward(FM_EmitSound, "fw_EmitSound");
    
    register_message(get_user_msgid("StatusIcon"), "message_statusicon");
    
    register_impulse(IMPULSE_FLASHLIGHT, "BloquearLinterna")
    
    gConteoHud = CreateHudSyncObj();
    gVarHud = CreateHudSyncObj();
    iMaxP = get_maxplayers();
    
    set_task(TIEMPO, "MensajesRandom", .flags = "b");
    set_task(1.0, "plugin_cfg");
    }
    
    public plugin_cfg()
    {
    set_cvar_num("mp_autoteambalance", 0);
    set_cvar_num("mp_freezetime", 0);
    set_cvar_num("mp_flashlight", 1);
    set_cvar_num("mp_roundtime", 8);
    }
    
    public event_RoundStart()
    {
    new gPlayers[32], gNum, gPlayer;
    get_players(gPlayers, gNum);
    
    for(new i = 0; i < gNum; i++)
    {
    	gPlayer = gPlayers[i];
    	gChainsaw[gPlayer] = false;
    }
    
    remove_task(TASK_CONTEO);
    gTiempoConteo = 10;
    set_task(1.0, "IniciarConteo", TASK_CONTEO , .flags="b");
    }
    
    public event_RoundEnd()
    {
    client_cmd(0, "mp3 stop");
    
    for(new id = 1 ; id <= iMaxP ; id++)
    {
    	if (!IsBit(gUsuarioConectado, id)) continue;
    
    	set_user_rendering(id);
    	cs_reset_user_model(id);
    }
    }
    
    public ham_PlayerSpawn(id)
    {
    if (IsBit(gUsuarioConectado, id) && !IsBit(gUsuarioVivo, id) && is_user_alive(id))
    	BitTrue(gUsuarioVivo, id);
    
    if (IsBit(gUsuarioVivo, id))
    {
    	set_task(0.4, "DarAtrib");
    }
    }
    
    public ham_Item_Preframe(id)
    {
    if (!IsBit(gUsuarioVivo, id)) return;
    
    set_user_gravity(id, (!gChainsaw[id]) ? gGravHumano : gGravChainsaw);
    set_user_maxspeed(id, (!gChainsaw[id]) ? gSpeedHumano : gSpeedChainsaw);
    }
    
    public ham_TouchWeapon(wpn, id)
    {
    if (!IsBit(gUsuarioConectado, id))
    	return HAM_IGNORED;
    
    return HAM_SUPERCEDE;
    }
    
    public ham_Item_Deploy_Post(wpn)
    {
    static id; id = get_weapon_ent_owner(wpn);
    
    if (!pev_valid(id) || !IsBit(gUsuarioVivo, id)) return;
    
    static WeaponID; WeaponID = cs_get_weapon_id(wpn);
    
    if (WeaponID != CSW_KNIFE) return;
    
    set_pev(id, pev_viewmodel2, (gChainsaw[id]) ? ModelKnifeChainsaw : ModelKnifeHumano);
    }
    
    public BlockC4(ent)
    {
    static const OBJETIVOS[][] =
    {
    	"func_bomb_target", "info_bomb_target", "info_vip_start", 
    	"func_vip_safetyzone", "func_escapezone", "hostage_entity",
    	"monster_scientist", "func_hostage_rescue", "info_hostage_rescue", 
    	"env_fog", "env_rain", "env_snow", "item_longjump", "func_vehicle", "weapon_c4"
    };
    
    if (!is_valid_ent(ent)) return;
    
    static classname[32], i;
    entity_get_string(ent, EV_SZ_classname, classname, charsmax(classname));
    
    for (i = 0; i < sizeof(OBJETIVOS); i++)
    {
    	if (equal(OBJETIVOS[i], classname))
    	{
    		remove_entity(ent);
    		return;
    	}
    }
    }
    
    public fw_EmitSound(id, channel, const sound[])
    {
    if (!IsBit(gUsuarioVivo, id) || !gChainsaw[id]) return FMRES_IGNORED;
    
    for(new i = 0; i < sizeof gChainsawSounds; i++)
    {
    	if (equal(sound, gKnifeSounds[i])) 
    	{
    		emit_sound(id, channel, gChainsawSounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
    		return FMRES_SUPERCEDE;
    	}
    }
    
    return FMRES_IGNORED;
    }
    
    public message_statusicon(msg_id, msg_dest, id)
    {
    static szIcon[8];
    get_msg_arg_string(2, szIcon, charsmax(szIcon));
    
    if (equal(szIcon, "buyzone") && get_msg_arg_int(1))
    {
    	set_pdata_int(id, 235, get_pdata_int(id, 235) & ~(1<<0));
    	return PLUGIN_HANDLED;
    }
    
    return PLUGIN_CONTINUE;
    } 
    
    public BloquearLinterna(id)
    {
    if (gChainsaw[id])
    	return PLUGIN_HANDLED;
    
    return PLUGIN_CONTINUE;
    }
    
    /* =================================================================================
    
    ================================================================================= */
    
    public ClcmdBlock(id) return PLUGIN_HANDLED;
    
    public DarAtrib(id)
    {
    if (!IsBit(gUsuarioVivo, id)) return;
    
    strip_user_weapons(id);
    give_item(id, "weapon_knife");
    
    if (gChainsaw[id])
    {
    	set_user_health(id, gVidaChainsaw);
    	cs_set_user_model(id, ModelChainsaw);
    	set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 20);
    }
    else
    {
    	set_user_health(id, gVidaHumano);
    	set_user_armor(id, gArmorHumano);
    	cs_set_user_model(id, ModelHumano);
    }
    }
    
    public IniciarConteo()
    {   
    emit_sound(0, CHAN_VOICE, gSonidosConteo[gTiempoConteo], 1.0, ATTN_NORM, 0, PITCH_NORM);
    
    set_hudmessage(0, 255, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
    ShowSyncHudMsg(0, gConteoHud, "------ [ MODO EN %i ] ------", gTiempoConteo);
    
    gTiempoConteo--;
    
    if (!gTiempoConteo)
    {
    	ModoChainsaw();
    	remove_task(TASK_CONTEO);
    }
    }
    
    public ModoChainsaw()
    {
    new gCName[32];
    
    new gPlayers[32], gNum, gPlayer;
    get_players(gPlayers, gNum, "a");
    
    for(new i = 0; i < gNum; i++)
    {
    	gPlayer = gPlayers[i];
    	cs_set_user_team(gPlayer, CS_TEAM_CT);
    	DarAtrib(gPlayer);
    }
    
    new gMChainsaw = ElegirChainsaw("a");
    get_user_name(gMChainsaw, gCName, charsmax(gCName));
    
    DarChainsaw(gMChainsaw);
    set_hudmessage(255, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
    ShowSyncHudMsg(0, gVarHud, "EL CHAINSAW ES %s.", gCName);
    
    client_cmd(0, "mp3 play ^"%s^"", SoundAmbient);
    
    for(new id = 1 ; id <= iMaxP ; id++)
    {
    	if (!IsBit(gUsuarioConectado, id) || gChainsaw[id]) continue;
    	if (cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED) 
    		continue;
    
    	set_task(0.5, "MenuArmas", id);
    }
    }
    
    ElegirChainsaw(const Flags[]="", const Team[]="")
    {
    static gPlayers[32], gNum;
    get_players(gPlayers, gNum, Flags, Team);
    
    return (gNum > 0) ? gPlayers[random(gNum)] : 0;
    }
    
    DarChainsaw(id)
    {
    if (!IsBit(gUsuarioVivo, id)) return;
    
    gChainsaw[id] = true;
    
    cs_set_user_team(id, CS_TEAM_T);
    strip_user_weapons(id);
    give_item(id, "weapon_knife");
    
    cs_set_user_nvg(id, 1);
    
    DarAtrib(id);
    }
    
    public MenuArmas(id)
    {
    if (!IsBit(gUsuarioVivo, id)) return;
    
    new i, menu, text[100], temp[16];
    menu = menu_create("\r[\dM. Chainsaw\r]\w Menu de Armas \r(\dPrimarias\r)", "HandPriMenuArmas");
    
    for(i = 0; i < sizeof PRIMARIAS; i++)
    {
    	formatex(text, charsmax(text), "\w%s", PRIMARIAS[i][NOMBRE]);
    	num_to_str(i, temp, 2);
    	menu_additem(menu, text, temp);
    }
    menu_setprop(menu, MPROP_EXITNAME, "Salir");
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu);
    }
    public HandPriMenuArmas(id, menu, item)
    {
    if(item == MENU_EXIT)
    {
    	menu_destroy(menu);
    	return PLUGIN_HANDLED;
    }
    
    strip_user_weapons(id);
    give_item(id, "weapon_knife");
    give_item(id, PRIMARIAS[item][ARMA]);
    cs_set_user_bpammo(id, PRIMARIAS[item][CSW], PRIMARIAS[item][bPAMMO]);
    ColorChat(id, NORMAL, "%s Elegiste la arma primaria:^4 %s^1.", sPrefix, PRIMARIAS[item][NOMBRE]);
    ArmasSec(id);
    
    return PLUGIN_HANDLED;
    }
    
    public ArmasSec(id)
    {
    if (!IsBit(gUsuarioVivo, id)) return;
    
    new i, menu, text[100], temp[16];
    menu = menu_create("\r[\dM. Chainsaw\r]\w Menu de Armas \r(\dSecundarias\r)", "HandSecundarias");
    
    for(i = 0; i < sizeof SECUNDARIAS; i++)
    {
    	formatex(text, charsmax(text), "\w%s", SECUNDARIAS[i][NOMBRE]);
    	num_to_str(i, temp, 2);
    	menu_additem(menu, text, temp);
    }
    menu_setprop(menu, MPROP_EXITNAME, "Salir");
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu);
    }
    
    public HandSecundarias(id, menu, item)
    {
    if(item == MENU_EXIT)
    {
    	menu_destroy(menu);
    	return PLUGIN_HANDLED;
    }
    
    give_item(id, SECUNDARIAS[item][ARMA]) 
    cs_set_user_bpammo(id, SECUNDARIAS[item][CSW], SECUNDARIAS[item][bPAMMO]);
    ColorChat(id, NORMAL, "%s Elegiste la arma secundaria:^4 %s^1.", sPrefix, SECUNDARIAS[item][NOMBRE]);
    
    return PLUGIN_HANDLED;
    }
    
    public MensajesRandom() ColorChat(0, NORMAL, MensajesMod[random(sizeof MensajesMod-1)], sPrefix);
    
    public ClcmdBlockJoin() return PLUGIN_HANDLED;
    
    /* =================================================================================
    
    ================================================================================= */
    
    stock get_weapon_ent_owner(ent)
    {
    if (pev_valid(ent) != 2)
    	return -1;
    
    return get_pdata_cbase(ent, 41, 4);
    }
    


    Luz volumetrica (func_illusionary)

    DanielMap
    Por DanielMap

    volumetrica.thumb.jpg.aca3ebc42b53d7769cf6f18f46c34fec.jpg

    Creado por danielmap para mundomapping.net
     

    También te puede interesar este post :

    hOYqLI8.jpg
    Fm5yhy5.jpg


Portal by DevFuse · Based on IP.Board Portal by IPS
×
×
  • Crear nuevo...

Información importante

Al utilizar nuestra web, aceptas nuestras Política de privacidad estás de acuerdo con las condiciones establecidas.