Simple DeathMatch 1.0
#1
Simple Death Match 1.0


Contenido:
Código:
Rangos Por Horas;
Sistema Re Regalos ( Solo Salen Regalos Si es HappyHour );
Sistema De Niveles;
Sistema De Resets;

Guardado Advanced Vault;

;Se Agregaran mas Cosas en la siguiente Versión

Créditos:
Código:
Kikizon2;
Destro;

Contenido Seal Version:
Código:
Version Clasica sin niveles

Código
Código PHP:
#include < amxmodx.inc >
#include < amxmisc.inc >
#include < cstrike.inc >
#include < hamsandwich.inc >
#include < engine.inc >
#include < fun.inc >
#include < fakemeta.inc >
#include < adv_vault.inc >

/* ==============================================================^n
>>>>>>>>>>>>>>>>> INICIA SECCION MODIFICABLE <<<<<<<<<<<<<<<<<<<<<
=================================================================*/

/* ===================================================
        Stuff World Defines
=====================================================*/

#define GetExp(%1)     ( ( %1 * %1 ) + 10 / 2  )
#define ID_HUD (taskid-TASK_HUD)

/* ===================================================
         Enumeradores & Constantes
=====================================================*/

enum _:_STRUCT_PCVARS RESPAWN 0GUARDMAX_LEVEL }; 
enum _:DATA_WEAPONS WEAPON_REQUIRED 0WEAPON_NAME90 ], WEAPON_90 ], WEAPON_CSWWEAPON_AMMOUNT };
enum _:TYPE_WEAPONS PRIM 0SEC };
enum _:_STRUCT_RANGE RNAME90 ], HOURS_REQUIRED };
enum _:_STRUCT_TIME SEGUNDOS 0MINUTOSHORAS };
enum FIELD_TIMES 0FIELD_RANGESFIELD_RESETFIELD_NIVELFIELD_EXPMAX_FIELDS };

new const 
g_szRangos[ ][ _STRUCT_RANGE ] =
{
    { 
"Miembro Nuevo"},
    { 
"Miembro Reconocido"},
    { 
"Miembro Sr."10 },
    { 
"Miembro Heroe"15 },
    { 
"Veterano"20 },
    { 
"Suck My Cock"25 },
    { 
"The Boss"30 },
    { 
""999999 // Fix Bug del Hud
};

new const 
g_szWeaponsPrim[ ][ _:DATA_WEAPONS ] = 
{
    { 
0,  "Ingram MAC-10""weapon_mac10"CSW_MAC10999 },
    { 
5,  "Schmidt TMP""weapon_tmp"CSW_TMP999 },
    { 
15"UMP 45""weapon_ump45"CSW_UMP45999 },
    { 
20"MP5 Navy""weapon_mp5navy"CSW_MP5NAVY },
    { 
30"Famas""weapon_famas"CSW_FAMAS999 },
    { 
40"SG-552 Commando""weapon_sg552"CSW_SG552999 },
    { 
50"M4A1 Carbine""weapon_m4a1"CSW_M4A1999 },
    { 
60"AK-47 Kalashnikov""weapon_ak47"CSW_AK47999 }
};

new const 
g_szWeaponsSec[ ][ _:DATA_WEAPONS ] =
{
    { 
0,  "USP .45 ACP Tactical""weapon_usp"CSW_USP999 },
    { 
5,  "Glock 18C""weapon_glock18"CSW_GLOCK18999 },
    { 
10"P228 Compact""weapon_p228"CSW_P228999 },
    { 
20"FiveseveN""weapon_fiveseven"CSW_FIVESEVEN999 },
    { 
30"Desert Eagle .50 AE""weapon_deagle"CSW_DEAGLE999 },
    { 
50"Dual Elite Berettas""weapon_elite"CSW_ELITE999 }
};

const 
TASK_HUD 2015;

new const 
g_iHHTIMES[ ][ ] = { "00""04""06""20""22""18" };

new const 
g_iBlock[ ] = 

    
"buy""buyammo1""buyammo2""buyequip""cl_autobuy""cl_rebuy""cl_setautobuy""drop"
};

new const 
g_szPromoved[ ]     = { "sound/bDM_Sounds/Promoved.mp3" };
new const 
g_szRPromoved[ ]     = { "sound/bDM_Sounds/Promoved_Range.wav" };
new const 
g_szAutor[ ][ ]     = { "bDM""b1.0""I'mBuggimen" };
new const 
g_szPrefix[ ]         = { "| bDM |" };
new const 
g_szEntityModel[ ]     = { "models/regalito.mdl" };
new const 
g_szEntityName[ ]     = { "Rewards_For_Kills" };

/* ===================================================
        Intergers & Vars Globals 
=====================================================*/

new g_iRangos33 ];
new 
g_iTime33 ][ _STRUCT_TIME ];
new 
g_iPlayerName33 ][ 32 char ];
new 
g_iFieldsMAX_FIELDS ];
new 
pcvars_dm_STRUCT_PCVARS ];
new 
g_iExperiencia33 ];
new 
g_iNiveles33 ];
new 
g_iReset33 ];
new 
g_szWeaponSelected33 ][ _:TYPE_WEAPONS ];
new 
g_szText500 ];

// =================================================================

new g_iHudMessages;
new 
g_bHH;
new 
g_iEntity;
new 
g_iGuardado;

public 
plugin_init( )
{
    
register_pluging_szAutor], g_szAutor], g_szAutor] );
    
    
// Fordwards
    
RegisterHamHam_Killed"player""Ham_PlayerKilled");
    
RegisterHamHam_Spawn"player""Ham_PlayerSpawn");    

    
register_forwardFM_Touch"fw_Touch_entity" );
    
    
// Comandos 
    
for( new _block_num 0_block_num sizeofg_iBlock ); ++_block_num )
    
register_clcmdg_iBlock_block_num ], "BlockCommands" );
    
register_clcmd"client_buy_open""BlockShopMenu" );    
    
register_clcmd"say /menu""Menu_General" );
    
    
register_menu"Descripcion", ( << ), "Inf_Keygen" );
    
    
// Eventos
    
register_event"HLTV""eRoundStart""a""1=0""2=0" );
    
    
// Asignate Values
    
pcvars_dmGUARD ]     = register_cvar"dm_guardtime""3.0" );
    
pcvars_dmRESPAWN ]     = register_cvar"dm_respawndelay""3.0" );
    
pcvars_dmMAX_LEVEL ]     = register_cvar"dm_maxlevel""100" );
    
g_iHudMessages        CreateHudSyncObj( );
    
    
g_iEntity         engfuncEngFunc_AllocString"info_target" );
    
    
g_iGuardado             adv_vault_open"GuardadoRanges"false );
    
    
g_iFieldsFIELD_TIMES ]      = adv_vault_register_fieldg_iGuardado"Times"DATATYPE_ARRAY);
    
g_iFieldsFIELD_RANGES ]     = adv_vault_register_fieldg_iGuardado, .fieldname "Ranges" );
    
g_iFieldsFIELD_RESET ]      = adv_vault_register_fieldg_iGuardado, .fieldname "Resets" );
    
g_iFieldsFIELD_NIVEL ]      = adv_vault_register_fieldg_iGuardado, .fieldname "Niveles" );
    
g_iFieldsFIELD_EXP ]          = adv_vault_register_fieldg_iGuardado, .fieldname "Experiencia" );
    
    
adv_vault_initg_iGuardado );
}

public 
plugin_precache( )
{
    
precache_soundg_szRPromoved );
    
precache_genericg_szPromoved );
    
precache_modelg_szEntityModel );
}

public 
client_putinserverindex )
{
    
get_user_nameindexg_iPlayerNameindex ], charsmaxg_iPlayerName[ ] ) );
    
arraysetg_iTimeindex ], 0sizeofg_iTime[ ] ) );
    
g_iRangosindex ] = 0;
    
iCargarindex );
    
g_szWeaponSelectedindex ][ PRIM ] = g_szWeaponSelectedindex ][ SEC ] = 
    
g_iNivelesindex ] = 1;
    
g_iResetindex ] = 0;
    
g_iExperienciaindex ] = 0;
    
set_task1.0"InfPlayer"index TASK_HUD__, .flags "b" );
    
    
iCargarindex );
}

public 
client_infochangedindex )
{
    if( !
is_user_connectedindex ) ) return;

    static 
NewName32 ];
    
get_user_infoindex"name"NewName31 );

    if( !
equalNewNameg_iPlayerNameindex ] ) )
    {
        
copyg_iPlayerNameindex ], 31NewName );
        
iCargarindex );
    }
}

public 
client_disconnectindex )
{
    
remove_taskindex TASK_HUD );
    
iGuardarindex );
}

public 
Ham_PlayerSpawnindex 
{
    if ( !
is_user_connectedindex ) || !is_user_aliveindex ) ) return;
    
        
set_task0.4"drop_weapons"index );
}

public 
drop_weaponsindex )
{
        
strip_user_weaponsindex );
    
give_itemindex"weapon_knife" );
    
Weaponsindex );
}

public 
Ham_PlayerKillediVictimiAttackershouldgib )
{
    if( !
is_user_aliveiAttacker ) || !is_user_connectediAttacker ) ) return HAM_IGNORED;
    
    static 
vOrigin], Float:fOrigin];

    if( 
g_bHH )
    {
        
get_user_originiVictimvOrigin );
        
IVecFVecvOriginfOrigin );    
        
Create_RewardEntityfOrigin );
    }
    
    
set_experienciaiAttackerg_bHH 5  );
    
    if( 
iAttacker == iVictim set_taskget_pcvar_floatpcvars_dmRESPAWN ] ), "Respawn_And_Guard"iVictim );
    
    
set_taskget_pcvar_floatpcvars_dmRESPAWN ] ), "Respawn_And_Guard"iVictim );
    
    return 
HAM_HANDLED;
}

public 
fw_Touch_entityindexiEntity )
{
    if( !
is_user_aliveindex ) || !pev_validiEntity ) ) return FMRES_IGNORED;

    static 
Get_EntityName32 ];

    
peviEntitypev_classnameGet_EntityName31 );

    if( 
equalGet_EntityNameg_szEntityName ) )
    {
        
get_rewardindex );
        
set_peviEntitypev_effectsEF_NODRAW );
        
set_peviEntitypev_solidSOLID_NOT );
    }
    return 
FMRES_IGNORED;
}

public 
Respawn_And_Guardindex )
{
    
ExecuteHamBHam_CS_RoundRespawnindex );
    
set_user_godmodeindex, .godmode true );
    
    static 
CsTeams:Teams;
    
Teams cs_get_user_teamindex );
    
    switch( 
Teams )
    {
        case 
CS_TEAM_CTset_renderingindexkRenderFxGlowShell00255kRenderNormal50 );
        case 
CS_TEAM_T:  set_renderingindexkRenderFxGlowShell25500kRenderNormal50 );
    }
    
set_taskget_pcvar_floatpcvars_dmGUARD ] ), "Remove_Guard"index );
}

public 
Remove_Guardindex )
{
    
set_user_godmodeindex, .godmode false );
    
set_renderingindex );
}

public 
BlockCommandsindex ) return PLUGIN_HANDLED;

public 
BlockShopMenuindex 
{
    static 
iMsgBuy;
    
    
iMsgBuy get_user_msgid"BuyClose" );
    
message_beginMSG_ONEiMsgBuy_index );
    
message_end( );
    
    return 
PLUGIN_HANDLED;
}

public 
InfPlayertaskid )
{
    static 
indexindex ID_HUD;
    
    if( 
is_user_connectedindex ) )
    {
        if( 
g_iTimeindex ][ SEGUNDOS ] > 59 )
        {
            
g_iTimeindex ][ SEGUNDOS ] = 0;
            
g_iTimeindex ][ MINUTOS ]++;
        }
        else 
g_iTimeindex ][ SEGUNDOS ]++;
        
        if( 
g_iTimeindex ][ MINUTOS ] > 59 )
        {
            
g_iTimeindex ][ MINUTOS ] = 0;
            
g_iTimeindex ][ HORAS ]++;
            
Range_checkindex );
        }
    }
    
set_hudmessage2002001001.00.20);
    
ShowSyncHudMsgindexg_iHudMessages"[ %s ]^nNivel[ %d/%d ]^nExperiencia[ %d/%d ]^nResets[ %d ]^nHappyHour[ O%s ]",
    
g_szRangosg_iRangosindex ] ][ RNAME ], g_iNivelesindex ], get_pcvar_numpcvars_dmMAX_LEVEL ] ), g_iExperienciaindex ],
    
GetExpg_iNivelesindex ] ), g_iResetindex ] , g_bHH "N":"FF");
    
}

/* ====================================================================================
                .::ARSENAL DE ARMAS::.
======================================================================================*/

public Menu_Generalindex )
{
    static 
iMenuGet_Name33 ];
    
    
get_user_nameindexGet_Name32 );
    
    
formatexg_szTextcharsmaxg_szText ), "\w%s Menu \yPrincipal^n\r%s"g_szPrefixGet_Nameindex ] )
    
iMenu menu_createg_szText"mh_Gen" );
    
    
menu_additemiMenu"Configuraciones" );
    
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
}

Cfgindex )
{
    static 
iMenuGet_Name33 ];
    
    
get_user_nameindexGet_Name32 );
    
    
formatexg_szTextcharsmaxg_szText ), "\w%s Menu de \yConfiguraciones^n\r%s"g_szPrefixGet_Nameindex ] )
    
iMenu menu_createg_szText"mh_Cfg" );
    
    
menu_additemiMenu"Ver Info" );
    
menu_additemiMenu"Hacer Reset" );
    
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
}

ResetMenuindex )
{
    static 
iMenu;
    
    
formatexg_szTextcharsmaxg_szText ), "\r=====================================^nNota:^nExperiencia & Nivel Reseteados a 0 ^nPero Tendras Privilegios Especiales^nNivel Requerido: %d^nTu Nivel: %d^n=====================================",
    
get_pcvar_numpcvars_dmMAX_LEVEL ] ), g_iNivelesindex ] );
    
    
iMenu menu_createg_szText"RMenu" );
    
    
formatexg_szTextcharsmaxg_szText ), ( g_iNivelesindex ] >= get_pcvar_numpcvars_dmMAX_LEVEL ] ) ) ? "Resetear Ahora":"\dAun No Puedes Resetear" );
    
menu_additemiMenug_szText );
    
    
menu_displayindexiMenu);
}

public 
Weaponsindex )
{    
    static 
iMenu;
    
    
iMenu menu_create"\d| \yWeapon Arsenal \d|""Mh_Arsenal" );
    
    
formatexg_szTextcharsmaxg_szText ), "\wArsenal Primario: \d| \y%s \d|",
    
g_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_NAME ] );
    
menu_additemiMenug_szText  );
    
    
formatexg_szTextcharsmaxg_szText ), "\wArsenal Secundario: \d| \y%s \d|^n^n",
    
g_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_NAME ] );
    
menu_additemiMenug_szText );
        
    
menu_additemiMenu"\d| \yLoad Combo \d|" );
    
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
    return 
PLUGIN_HANDLED;
}

ClasesWeaponSecindex )
{        
    static 
iMenu;
    
    
iMenu menu_create"\y[ \wSeleccione Su Arsenal Secundario \y]""Mh_ClasesWeaponSec" );
    
    for( new 
num 0num sizeofg_szWeaponsSec ); num++ )
    {
        if( 
g_iNivelesindex ] >= g_szWeaponsSecnum ][ WEAPON_REQUIRED ] )
        {
            
formatexg_szTextcharsmaxg_szText ), "%s"g_szWeaponsSecnum ][ WEAPON_NAME ] );
        }
        else
        {
            
formatexg_szTextcharsmaxg_szText ), "\d( Nivel \r%d \d)"g_szWeaponsSecnum ][ WEAPON_REQUIRED ] );
        }
        
menu_additemiMenug_szText );
    }
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
    
}

ClasesWeaponindex )
{        
    static 
iMenu;
    
    
iMenu menu_create"\y[ \wSeleccione Su Arsenal Primario \y]""Mh_ClasesWeapons" );
    
    for( new 
num 0num sizeofg_szWeaponsPrim ); num++ )
    {
        if( 
g_iNivelesindex ] >= g_szWeaponsPrimnum ][ WEAPON_REQUIRED ] )
        {
            
formatexg_szTextcharsmaxg_szText ), "%s"g_szWeaponsPrimnum ][ WEAPON_NAME ] );
        }
        else
        {
            
formatexg_szTextcharsmaxg_szText ), "\d( Nivel \r%d \d)"g_szWeaponsPrimnum ][ WEAPON_REQUIRED ] );
        }
        
menu_additemiMenug_szText );
    } 
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
}

public 
Info_Menuindex )
{
    static 
lenGet_Name33 ]; len 0;
    
    
get_user_nameindexGet_Name32 );
        
    
len += formatexg_szTextlen ], charsmaxg_szText ) - len"\wInformacion De La Cuenta \y[ \w%s \y]^n^n"Get_Nameindex ]  );
    
len += formatexg_szTextlen ], charsmaxg_szText ) - len"\wRango\y[ \w%s \y]^n"g_szRangosg_iRangosindex ] ][ RNAME ] );
    
len += formatexg_szTextlen ], charsmaxg_szText ) - len"\wHoras Jugadas \y[ \w%d \y]^n"g_iTimeindex ][ HORAS ] );
    
len += formatexg_szTextlen ], charsmaxg_szText ) - len"\wMinutos Jugados \y[ \w%d \y]^n^n"g_iTimeindex ][ MINUTOS ] );

    
len += formatexg_szTextlen ], charsmaxg_szText ) - len"\r0.\w Atras" );
    
    
show_menuindex<< 9g_szText, -1"Descripcion" );
}
    
/* ====================================================================================
                .::HANDLERS::.
======================================================================================*/

public mh_CfgindexiMenuiItem )
{
    if( 
iItem == MENU_EXIT || !is_user_connectedindex ) )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    switch( 
iItem )
    {
        case 
0Info_Menuindex );
        case 
1ResetMenuindex );
    }
    
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
mh_GenindexiMenuiItem )
{
    if( 
iItem == MENU_EXIT || !is_user_connectedindex ) )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    switch( 
iItem )
    {
        case 
0Cfgindex );
    }
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Inf_KeygenindexiKeygen Cfgindex );

public 
Mh_ArsenalindexiMenuiItem )
{    
    switch( 
iItem )
    {
        case 
0ClasesWeaponindex );
        case 
1ClasesWeaponSecindex );
        case 
2LoadArsenalindex );
    }    
    
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Mh_ClasesWeaponsindexiMenuiItem )
{    
    if( !
is_user_connectedindex ) )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    if( 
g_iNivelesindex ] >= g_szWeaponsPrimiItem ][ WEAPON_REQUIRED ] )
    {
        
g_szWeaponSelectedindex ][ PRIM ] = iItem;
        
Weaponsindex );
    }
    else
    {
        
ClasesWeaponindex );
        return 
PLUGIN_HANDLED;
    }
        
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Mh_ClasesWeaponSecindexiMenuiItem )
{    
    if( !
is_user_connectedindex ) )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    if( 
g_iNivelesindex ] >= g_szWeaponsSeciItem ][ WEAPON_REQUIRED ] )
    {
        
g_szWeaponSelectedindex ][ SEC ] = iItem;
        
Weaponsindex );
    }
    else
    {
        
ClasesWeaponSecindex );
        return 
PLUGIN_HANDLED;
    }
        
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
RMenuindexiMenuiItem )
{
    if( 
iItem == MENU_EXIT || !is_user_connectedindex ) )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    if( 
g_iNivelesindex ] >= get_pcvar_numpcvars_dmMAX_LEVEL ] ) ) 
    {
        
g_iResetindex ]++;
        
g_iExperienciaindex ] = 0;
        
g_iNivelesindex ] = 0;
        
iChatindex"^4%s ^3Conseguiste un Reset"g_szPrefix );
        
menu_destroyiMenu );
    }
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

/* ====================================================================================
                .::PRIVATES::.
======================================================================================*/

LoadArsenalindex )
{
    if( !
is_user_aliveindex ) || !is_user_connectedindex ) ) return;
    
    
strip_user_weaponsindex );
    
    
give_itemindex"weapon_knife" );
    
    
give_itemindexg_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_ ] );
    
cs_set_user_bpammoindexg_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_CSW ],
    
g_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_AMMOUNT ] );
    
    
give_itemindexg_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_ ] );
    
cs_set_user_bpammoindexg_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_CSW ],
    
g_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_AMMOUNT ] );
    
}

Create_RewardEntity( const Float:fOrigin] )
{
    static 
iEntity;

    
iEntity engfuncEngFunc_CreateNamedEntityg_iEntity );

    
set_peviEntitypev_classnameg_szEntityName );

    
engfuncEngFunc_SetModeliEntity g_szEntityModel );

    
set_peviEntity pev_mins Float:{ -10.0, -10.00.0 } );
    
set_peviEntity pev_maxs Float:{ 10.010.025.0 } );
    
set_peviEntity pev_size Float:{ -10.0, -10.00.010.010.025.0 } );
    
engfuncEngFunc_SetSizeiEntityFloat:{ -10.0,-10.0,0.0 } , Float:{ 10.0,10.0,25.0 } );

    
set_peviEntitypev_solidSOLID_BBOX );
    
set_peviEntitypev_movetypeMOVETYPE_TOSS );

    
set_peviEntitypev_originfOrigin );

    
set_peviEntitypev_renderfxkRenderFxGlowShell );
    
drop_to_flooriEntity );

    
set_peviEntitypev_rendercolorFloat:{ 0.00.0255.0 } ); 
}

get_nivelindex )
{
    static 
MaxLevelUpdate;
    
Update false;
    
MaxLevel get_pcvar_numpcvars_dmMAX_LEVEL ] );
    
    while( 
g_iExperienciaindex ] >= GetExpg_iNivelesindex ] ) && g_iNivelesindex ] < MaxLevel )
    {
        
Update true;
        
g_iNivelesindex ]++;
    }
    if( 
Update 
    {
        
iChatindex"^4%s ^3Haz Avanzado de Nivel Papu"g_szPrefix );
        
iPlaySoundindexg_szPromoved );
    }
}


public 
eRoundStart( )
{
    
get_HH( );

}

get_HH( )
{
    
g_bHH false;
    
    static 
iHTime], iHH;
    
    
get_time"%H"iHTimecharsmaxiHTime ) );
    
    for( 
iHH 0iHH sizeof g_iHHTIMES ); iHH++ ) 
    {
        if( 
equaliHTimeg_iHHTIMESiHH ] ) ) 
        
g_bHH true;
    }
}

Range_checkindex )
{
    new 
Range_Up false;
    
    if( 
g_iTimeindex ][ HORAS ] >= g_szRangosg_iRangosindex ] ][ HOURS_REQUIRED ] )
    {
        
g_iRangosindex ]++;
        
Range_Up true;
    }
    if( 
Range_Up )
    {
        
iChatindex"^4%s ^3Haz Sido Promovido a %s"g_szPrefixg_szRangosg_iRangosindex ] ][ RNAME ] )
        
Range_Up false;
        
iPlaySoundindexg_szRPromoved ); 
    }
}

get_rewardindex )
{
    switch( 
random_num0) )
    {
        case 
0:
        {
            
client_printindexprint_center"+ 1 Experiencia" );
            
g_iExperienciaindex ] += 1;
        }
        case 
1:
        {
            
client_printindexprint_center"+ 2 Experiencia" );
            
g_iExperienciaindex ] += 2;
        }
        case 
2:
        {
            
client_printindexprint_center"+ 3 Experiencia" );
            
g_iExperienciaindex ] += 3;
        }
        case 
3:
        {
            
client_printindexprint_center"+ 4 Experiencia" );
            
g_iExperienciaindex ] += 4;
        }
        case 
4:
        {
            
client_printindexprint_center"+ 5 Experiencia" );
            
g_iExperienciaindex ] += 5;
        }
        case 
5:
        {
            
client_printindexprint_center"+ 6 Experiencia" );
            
g_iExperienciaindex ] += 6;
        }        
    }
}

iGuardarindex )
{
    
adv_vault_set_startg_iGuardado );
    
    
adv_vault_set_fieldg_iGuardadog_iFieldsFIELD_TIMES ], g_iTimeindex ] );
    
adv_vault_set_fieldg_iGuardadog_iFieldsFIELD_RANGES ], g_iRangosindex ] );
    
adv_vault_set_fieldg_iGuardadog_iFieldsFIELD_RESET ], g_iResetindex ] );
    
adv_vault_set_fieldg_iGuardadog_iFieldsFIELD_EXP ], g_iExperienciaindex ] );
    
adv_vault_set_fieldg_iGuardadog_iFieldsFIELD_NIVEL ], g_iNivelesindex ] );

    
adv_vault_set_endg_iGuardado0g_iPlayerNameindex ] );
}

iCargarindex )
{
    if( !
adv_vault_get_prepareg_iGuardado_g_iPlayerNameindex ] ) ) return;
    
    
g_iRangosindex ] = adv_vault_get_fieldg_iGuardadog_iFieldsFIELD_RANGES ] );
    
g_iResetindex ] = adv_vault_get_fieldg_iGuardadog_iFieldsFIELD_RESET ] );
    
g_iExperienciaindex ] = adv_vault_get_fieldg_iGuardadog_iFieldsFIELD_EXP ] );
    
g_iNivelesindex ] = adv_vault_get_fieldg_iGuardadog_iFieldsFIELD_NIVEL ] );
    
adv_vault_get_fieldg_iGuardadog_iFieldsFIELD_TIMES ], g_iTimeindex ], sizeof g_iTime[ ] ) );    
}
    

/* ====================================================================================
                .::STOCKS::.
======================================================================================*/

stock set_experienciaindexnum )
{
    
g_iExperienciaindex ] += clampnum0get_pcvar_numpcvars_dmMAX_LEVEL ] ) );
    
    
get_nivelindex );
}

stock get_weapon_ent_owneriEnt )
{
    if ( ~
pev_validiEnt ) & ) return -1;
    
    return 
get_pdata_cbaseiEnt41); 


stock iChatindex, const input[ ], any:... )
{
    static 
iSayTextsziMsg191 ];

    if ( !
iSayText )
    
iSayText get_user_msgid"SayText" );

    
replace_allsziMsg190"!g""^4" );
    
replace_allsziMsg190"!y""^1" );
    
replace_allsziMsg190"!team""^3" );

    
vformatsziMsg190input);
    
message_beginindex MSG_ONE_UNRELIABLE MSG_BROADCASTiSayText, .player index );
    
write_byteindex index 33 );
    
write_stringsziMsg );
    
message_end( );

}

stock iPlaySoundindex, const sound[ ] ) 
{
    if( !
index 
    {
        if ( 
equalsoundstrlensound ) - ], ".mp3" ) )
        
client_cmd0"mp3 play %s"sound );
        else
        
client_cmd0"spk ^"%s^""sound ) ;
    } 
    else
    {
        if( 
is_user_connectedindex ) ) 
        {
            if ( 
equalsoundstrlensound ) - ], ".mp3" ) )
            
client_cmdindex"mp3 play %s"sound );
            else
            
client_cmdindex"spk ^"%s^""sound );    
        }    
    }


VERSIÓN CLASICA:
Código PHP:
#include < amxmodx.inc >
#include < cstrike.inc >
#include < hamsandwich.inc >
#include < fun.inc >
#include < engine.inc >

/* ==============================================================^n
>>>>>>>>>>>>>>>>> INICIA SECCION MODIFICABLE <<<<<<<<<<<<<<<<<<<<<
=================================================================*/

/* ===================================================
        Stuff World Defines
=====================================================*/

#define ID_HUD (taskid-TASK_HUD)

/* ===================================================
         Enumeradores & Constantes
=====================================================*/

enum _:_STRUCT_PCVARS RESPAWN 0GUARDMAX_LEVEL }; 
enum _:DATA_WEAPONS WEAPON_NAME90 ], WEAPON_90 ], WEAPON_CSWWEAPON_AMMOUNT };
enum _:TYPE_WEAPONS PRIM 0SEC };


new const 
g_szWeaponsPrim[ ][ _:DATA_WEAPONS ] = 
{
    { 
"Ingram MAC-10""weapon_mac10"CSW_MAC10999 },
    { 
"Schmidt TMP""weapon_tmp"CSW_TMP999 },
    { 
"UMP 45""weapon_ump45"CSW_UMP45999 },
    { 
"MP5 Navy""weapon_mp5navy"CSW_MP5NAVY },
    { 
"Famas""weapon_famas"CSW_FAMAS999 },
    { 
"SG-552 Commando""weapon_sg552"CSW_SG552999 },
    { 
"M4A1 Carbine""weapon_m4a1"CSW_M4A1999 },
    { 
"AK-47 Kalashnikov""weapon_ak47"CSW_AK47999 }
};

new const 
g_szWeaponsSec[ ][ _:DATA_WEAPONS ] =
{
    { 
"USP .45 ACP Tactical""weapon_usp"CSW_USP999 },
    { 
"Glock 18C""weapon_glock18"CSW_GLOCK18999 },
    { 
"P228 Compact""weapon_p228"CSW_P228999 },
    { 
"FiveseveN""weapon_fiveseven"CSW_FIVESEVEN999 },
    { 
"Desert Eagle .50 AE""weapon_deagle"CSW_DEAGLE999 },
    { 
"Dual Elite Berettas""weapon_elite"CSW_ELITE999 }
};

const 
TASK_HUD 2015;

new const 
g_iBlock[ ] = 

    
"buy""buyammo1""buyammo2""buyequip""cl_autobuy""cl_rebuy""cl_setautobuy""drop"
};

new const 
g_szAutor[ ][ ]     = { "bDM""b1.0""I'mBuggimen" };

/* ===================================================
        Intergers & Vars Globals 
=====================================================*/


new pcvars_dm_STRUCT_PCVARS ];
new 
g_szWeaponSelected33 ][ _:TYPE_WEAPONS ];
new 
g_szText500 ];

// =================================================================


public plugin_init( )
{
    
register_pluging_szAutor], g_szAutor], g_szAutor] );
    
    
// Fordwards
    
RegisterHamHam_Killed"player""Ham_PlayerKilled");
    
RegisterHamHam_Spawn"player""Ham_PlayerSpawn");    
    
    
// Comandos 
    
for( new _block_num 0_block_num sizeofg_iBlock ); ++_block_num )
    
register_clcmdg_iBlock_block_num ], "BlockCommands" );
    
register_clcmd"client_buy_open""BlockShopMenu" );        
    
    
// Eventos
    
register_event"HLTV""eRoundStart""a""1=0""2=0" );
    
    
// Asignate Values
    
pcvars_dmGUARD ]     = register_cvar"dm_guardtime""3.0" );
    
pcvars_dmRESPAWN ]     = register_cvar"dm_respawndelay""3.0" );
    
pcvars_dmMAX_LEVEL ]     = register_cvar"dm_maxlevel""100" );
    
}


public 
client_putinserverindex )
{
    
g_szWeaponSelectedindex ][ PRIM ] = g_szWeaponSelectedindex ][ SEC ] = 
}

public 
Ham_PlayerSpawnindex 
{
    if ( !
is_user_connectedindex ) || !is_user_aliveindex ) ) return;
    
        
set_task0.3"drop_weapons"index );
}

public 
drop_weaponsindex )
{
        
strip_user_weaponsindex );
    
give_itemindex"weapon_knife" );
    
Weaponsindex );
}

public 
Ham_PlayerKillediVictimiAttackershouldgib )
{
    if( !
is_user_aliveiAttacker ) || !is_user_connectediAttacker ) ) return HAM_IGNORED;

    if( 
iAttacker == iVictim set_taskget_pcvar_floatpcvars_dmRESPAWN ] ), "Respawn_And_Guard"iVictim );
    
    
set_taskget_pcvar_floatpcvars_dmRESPAWN ] ), "Respawn_And_Guard"iVictim );
    
    return 
HAM_HANDLED;
}

public 
Respawn_And_Guardindex )
{
    
ExecuteHamBHam_CS_RoundRespawnindex );
    
set_user_godmodeindex, .godmode true );
    
    static 
CsTeams:Teams;
    
Teams cs_get_user_teamindex );
    
    switch( 
Teams )
    {
        case 
CS_TEAM_CTset_renderingindexkRenderFxGlowShell00255kRenderNormal50 );
        case 
CS_TEAM_T:  set_renderingindexkRenderFxGlowShell25500kRenderNormal50 );
    }
    
set_taskget_pcvar_floatpcvars_dmGUARD ] ), "Remove_Guard"index );
}

public 
Remove_Guardindex )
{
    
set_user_godmodeindex, .godmode false );
    
set_renderingindex );
}

public 
BlockCommandsindex ) return PLUGIN_HANDLED;

public 
BlockShopMenuindex 
{
    static 
iMsgBuy;
    
    
iMsgBuy get_user_msgid"BuyClose" );
    
message_beginMSG_ONEiMsgBuy_index );
    
message_end( );
    
    return 
PLUGIN_HANDLED;
}

/* ====================================================================================
                .::ARSENAL DE ARMAS::.
======================================================================================*/

public Weaponsindex )
{    
    static 
iMenu;
    
    
iMenu menu_create"\d| \yWeapon Arsenal \d|""Mh_Arsenal" );
    
    
formatexg_szTextcharsmaxg_szText ), "\wArsenal Primario: \d| \y%s \d|",
    
g_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_NAME ] );
    
menu_additemiMenug_szText  );
    
    
formatexg_szTextcharsmaxg_szText ), "\wArsenal Secundario: \d| \y%s \d|^n^n",
    
g_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_NAME ] );
    
menu_additemiMenug_szText );
        
    
menu_additemiMenu"\d| \yLoad Combo \d|" );
    
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
    return 
PLUGIN_HANDLED;
}

ClasesWeaponSecindex )
{        
    static 
iMenu;
    
    
iMenu menu_create"\y[ \wSeleccione Su Arsenal Secundario \y]""Mh_ClasesWeaponSec" );
    
    for( new 
num 0num sizeofg_szWeaponsSec ); num++ )
    {
        
formatexg_szTextcharsmaxg_szText ), "%s"g_szWeaponsSecnum ][ WEAPON_NAME ] );
        
menu_additemiMenug_szText );
    }
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
    
}

ClasesWeaponindex )
{        
    static 
iMenu;
    
    
iMenu menu_create"\y[ \wSeleccione Su Arsenal Primario \y]""Mh_ClasesWeapons" );
    
    for( new 
num 0num sizeofg_szWeaponsPrim ); num++ )
    {
        
formatexg_szTextcharsmaxg_szText ), "%s"g_szWeaponsPrimnum ][ WEAPON_NAME ] );
        
menu_additemiMenug_szText );
    } 
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_setpropiMenuMPROP_NUMBER_COLOR"\y" );
    
menu_displayindexiMenu);
}

/* ====================================================================================
                .::HANDLERS::.
======================================================================================*/

public Mh_ArsenalindexiMenuiItem )
{    
    switch( 
iItem )
    {
        case 
0ClasesWeaponindex );
        case 
1ClasesWeaponSecindex );
        case 
2LoadArsenalindex );
    }    
    
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Mh_ClasesWeaponsindexiMenuiItem )
{    
    if( !
is_user_connectedindex ) )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    
g_szWeaponSelectedindex ][ PRIM ] = iItem;
    
Weaponsindex );

    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Mh_ClasesWeaponSecindexiMenuiItem )
{    
    if( !
is_user_connectedindex ) )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    
g_szWeaponSelectedindex ][ SEC ] = iItem;
    
Weaponsindex );
    
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}


/* ====================================================================================
                .::PRIVATES::.
======================================================================================*/

LoadArsenalindex )
{
    if( !
is_user_aliveindex ) || !is_user_connectedindex ) ) return;
    
    
strip_user_weaponsindex );
    
    
give_itemindex"weapon_knife" );
    
    
give_itemindexg_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_ ] );
    
cs_set_user_bpammoindexg_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_CSW ],
    
g_szWeaponsPrimg_szWeaponSelectedindex ][ PRIM ] ][ WEAPON_AMMOUNT ] );
    
    
give_itemindexg_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_ ] );
    
cs_set_user_bpammoindexg_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_CSW ],
    
g_szWeaponsSecg_szWeaponSelectedindex ][ SEC ] ][ WEAPON_AMMOUNT ] );
    
}

/* ====================================================================================
                .::STOCKS::.
======================================================================================*/
 
stock iChatindex, const input[ ], any:... )
{
    static 
iSayTextsziMsg191 ];

    if ( !
iSayText )
    
iSayText get_user_msgid"SayText" );

    
replace_allsziMsg190"!g""^4" );
    
replace_allsziMsg190"!y""^1" );
    
replace_allsziMsg190"!team""^3" );

    
vformatsziMsg190input);
    
message_beginindex MSG_ONE_UNRELIABLE MSG_BROADCASTiSayText, .player index );
    
write_byteindex index 33 );
    
write_stringsziMsg );
    
message_end( );



NOTA:

Si vas a Comentar;

1. Solo Criticas Constructivas;
2. Solo Responderé Preguntas Si son del Thread;


Archivos adjuntos
.rar   Resources.rar (Tamaño: 177.6 KB / Descargas: 225)
~Digito ergo sum~
Responder
#2
Se van al carajo poniendole niveles a un mod clásico.
Responder
#3
Ya no aporten con lvl Oh god why Roflmao Buen aporte papu

WTF TE COPIARON EL NAME O 2 CUENTA Whatdone
* Ing. Informático * Mapper * Venezolano
Responder
#4
Edit:

Se Agrego Version Clasica sin Niveles

Para que el usuario Elija a su gusto
~Digito ergo sum~
Responder
#5
No remuevas o des armas dentro del public del ham_spawn, usa un set_task. No recuerdo bien donde era que lo leí, pero era mejor no hacer ese tipo de cosas dentro de ese public.
Pacman rip :'v
Responder
#6
Fix.... Nothingdohere
~Digito ergo sum~
Responder
#7
Muy buen aporte, comente sin leer antes
Responder
#8
(18/10/2015, 08:56 PM)ImBuggimen escribió: Fix.... Nothingdohere

Dejalo como más de 0.3
Pacman rip :'v
Responder
#9
LISTO.
~Digito ergo sum~
Responder
#10
Código PHP:
Range_checkindex )
{
    new 
Range_Up false;
    
    if( 
g_iTimeindex ][ MINUTOS ] >= g_szRangosg_iRangosindex ] ][ HOURS_REQUIRED ] )
    {
        
g_iRangosindex ]++;
        
Range_Up true;
    }
    if( 
Range_Up )
    {
        
iChatindex"^4%s ^3Haz Sido Promovido a %s"g_szPrefixg_szRangosg_iRangosindex ] ][ RNAME ] )
        
Range_Up false;
        
iPlaySoundindexg_szRPromoved ); 
    }


2 cosas nada mas, no se si esta bien lo que digo peeero, tenes HorasRequeridas y en g_iTime usas minutos y no horas.

Y lo otro que, y que, a tal caso de que alguien llegue a las 99999 horas ( casi imposible pero puede pasar ), se le va a buguear, index out of bounds.
Responder
#11
(19/10/2015, 12:16 AM)Matians escribió:
Código PHP:
Range_checkindex )
{
    new 
Range_Up false;
    
    if( 
g_iTimeindex ][ MINUTOS ] >= g_szRangosg_iRangosindex ] ][ HOURS_REQUIRED ] )
    {
        
g_iRangosindex ]++;
        
Range_Up true;
    }
    if( 
Range_Up )
    {
        
iChatindex"^4%s ^3Haz Sido Promovido a %s"g_szPrefixg_szRangosg_iRangosindex ] ][ RNAME ] )
        
Range_Up false;
        
iPlaySoundindexg_szRPromoved ); 
    }


2 cosas nada mas, no se si esta bien lo que digo peeero, tenes HorasRequeridas y en g_iTime usas minutos y no horas.

Y lo otro que, y que, a tal caso de que alguien llegue a las 99999 horas ( casi imposible pero puede pasar ), se le va a buguear, index out of bounds.

estas en lo sierto eso lo puse sin querer testeando algo
Whatdone

fix
~Digito ergo sum~
Responder
#12
Jajajaja, no pasa nada, buen plugin!!
Responder
#13
Odio que le pongan niveles a modos básicos. La puta pario...
Aunque si. Buen plugin.

Te recomiendo usar un TASK_ID para el task cuando un Jugador Respawnea.
También podrías quitar otras cosas como la plata, asegurar el quite del BuyZone (Podes usar una entidad que lo mueva a un lugar inaccesible o usar StatusIcon para bloquearla).
Entre otras huevadas para mejorar la jugabilidad.
Free agent - Vendo plugins, mods o apps del foro IPB (Invision community)
Contactarme vía Discord >>> AtselTV#8202
Responder
#14
Esta muy bueno el plugin Excitedeyes

Pero con niveles no gusta Oh god why
Responder
#15
para eso deje 2 versiones
la Seal Version sin niveles ni mierdas
y la con niveles
~Digito ergo sum~
Responder
#16
(19/10/2015, 11:20 PM)ImBuggimen escribió: para eso deje 2 versiones
la Seal Version sin niveles ni mierdas
y la con niveles
No me habia dado cuenta Whatdone
Responder
#17
no me deja compilar xq? me slta que el #include < adv_vault.inc > tiene error de lectura
Responder
#18
Te falta esa librería o reeplazala, busca el post de destro
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#19
Buenas! Alguien pudo usarlo? Me pasa que cuando lo activo me tira el servidor!
Responder
#20
(21/07/2020, 03:38 PM)Viciocba escribió: Buenas! Alguien pudo usarlo? Me pasa que cuando lo activo me tira el servidor!

Te deja algunos logs?
Corazón I dream of someday being able to have your near. Corazón
[Imagen: 76561199006140497.png]
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)