18/10/2015, 06:41 PM
(Última modificación: 19/10/2015, 03:59 PM por I'mBuggimen.)
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 = 0, GUARD, MAX_LEVEL };
enum _:DATA_WEAPONS { WEAPON_REQUIRED = 0, WEAPON_NAME[ 90 ], WEAPON_[ 90 ], WEAPON_CSW, WEAPON_AMMOUNT };
enum _:TYPE_WEAPONS { PRIM = 0, SEC };
enum _:_STRUCT_RANGE { RNAME[ 90 ], HOURS_REQUIRED };
enum _:_STRUCT_TIME { SEGUNDOS = 0, MINUTOS, HORAS };
enum { FIELD_TIMES = 0, FIELD_RANGES, FIELD_RESET, FIELD_NIVEL, FIELD_EXP, MAX_FIELDS };
new const g_szRangos[ ][ _STRUCT_RANGE ] =
{
{ "Miembro Nuevo", 0 },
{ "Miembro Reconocido", 3 },
{ "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_MAC10, 999 },
{ 5, "Schmidt TMP", "weapon_tmp", CSW_TMP, 999 },
{ 15, "UMP 45", "weapon_ump45", CSW_UMP45, 999 },
{ 20, "MP5 Navy", "weapon_mp5navy", CSW_MP5NAVY },
{ 30, "Famas", "weapon_famas", CSW_FAMAS, 999 },
{ 40, "SG-552 Commando", "weapon_sg552", CSW_SG552, 999 },
{ 50, "M4A1 Carbine", "weapon_m4a1", CSW_M4A1, 999 },
{ 60, "AK-47 Kalashnikov", "weapon_ak47", CSW_AK47, 999 }
};
new const g_szWeaponsSec[ ][ _:DATA_WEAPONS ] =
{
{ 0, "USP .45 ACP Tactical", "weapon_usp", CSW_USP, 999 },
{ 5, "Glock 18C", "weapon_glock18", CSW_GLOCK18, 999 },
{ 10, "P228 Compact", "weapon_p228", CSW_P228, 999 },
{ 20, "FiveseveN", "weapon_fiveseven", CSW_FIVESEVEN, 999 },
{ 30, "Desert Eagle .50 AE", "weapon_deagle", CSW_DEAGLE, 999 },
{ 50, "Dual Elite Berettas", "weapon_elite", CSW_ELITE, 999 }
};
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_iRangos[ 33 ];
new g_iTime[ 33 ][ _STRUCT_TIME ];
new g_iPlayerName[ 33 ][ 32 char ];
new g_iFields[ MAX_FIELDS ];
new pcvars_dm[ _STRUCT_PCVARS ];
new g_iExperiencia[ 33 ];
new g_iNiveles[ 33 ];
new g_iReset[ 33 ];
new g_szWeaponSelected[ 33 ][ _:TYPE_WEAPONS ];
new g_szText[ 500 ];
// =================================================================
new g_iHudMessages;
new g_bHH;
new g_iEntity;
new g_iGuardado;
public plugin_init( )
{
register_plugin( g_szAutor[ 0 ], g_szAutor[ 1 ], g_szAutor[ 2 ] );
// Fordwards
RegisterHam( Ham_Killed, "player", "Ham_PlayerKilled", 1 );
RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawn", 1 );
register_forward( FM_Touch, "fw_Touch_entity" );
// Comandos
for( new _block_num = 0; _block_num < sizeof( g_iBlock ); ++_block_num )
register_clcmd( g_iBlock[ _block_num ], "BlockCommands" );
register_clcmd( "client_buy_open", "BlockShopMenu" );
register_clcmd( "say /menu", "Menu_General" );
register_menu( "Descripcion", ( 1 << 9 ), "Inf_Keygen" );
// Eventos
register_event( "HLTV", "eRoundStart", "a", "1=0", "2=0" );
// Asignate Values
pcvars_dm[ GUARD ] = register_cvar( "dm_guardtime", "3.0" );
pcvars_dm[ RESPAWN ] = register_cvar( "dm_respawndelay", "3.0" );
pcvars_dm[ MAX_LEVEL ] = register_cvar( "dm_maxlevel", "100" );
g_iHudMessages = CreateHudSyncObj( );
g_iEntity = engfunc( EngFunc_AllocString, "info_target" );
g_iGuardado = adv_vault_open( "GuardadoRanges", false );
g_iFields[ FIELD_TIMES ] = adv_vault_register_field( g_iGuardado, "Times", DATATYPE_ARRAY, 3 );
g_iFields[ FIELD_RANGES ] = adv_vault_register_field( g_iGuardado, .fieldname = "Ranges" );
g_iFields[ FIELD_RESET ] = adv_vault_register_field( g_iGuardado, .fieldname = "Resets" );
g_iFields[ FIELD_NIVEL ] = adv_vault_register_field( g_iGuardado, .fieldname = "Niveles" );
g_iFields[ FIELD_EXP ] = adv_vault_register_field( g_iGuardado, .fieldname = "Experiencia" );
adv_vault_init( g_iGuardado );
}
public plugin_precache( )
{
precache_sound( g_szRPromoved );
precache_generic( g_szPromoved );
precache_model( g_szEntityModel );
}
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;
iCargar( index );
g_szWeaponSelected[ index ][ PRIM ] = g_szWeaponSelected[ index ][ SEC ] = 0 ;
g_iNiveles[ index ] = 1;
g_iReset[ index ] = 0;
g_iExperiencia[ index ] = 0;
set_task( 1.0, "InfPlayer", index + TASK_HUD, _, _, .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_HUD );
iGuardar( index );
}
public Ham_PlayerSpawn( index )
{
if ( !is_user_connected( index ) || !is_user_alive( index ) ) return;
set_task( 0.4, "drop_weapons", index );
}
public drop_weapons( index )
{
strip_user_weapons( index );
give_item( index, "weapon_knife" );
Weapons( index );
}
public Ham_PlayerKilled( iVictim, iAttacker, shouldgib )
{
if( !is_user_alive( iAttacker ) || !is_user_connected( iAttacker ) ) return HAM_IGNORED;
static vOrigin[ 3 ], Float:fOrigin[ 3 ];
if( g_bHH )
{
get_user_origin( iVictim, vOrigin );
IVecFVec( vOrigin, fOrigin );
Create_RewardEntity( fOrigin );
}
set_experiencia( iAttacker, g_bHH ? 5 * 2 : 5 );
if( iAttacker == iVictim ) set_task( get_pcvar_float( pcvars_dm[ RESPAWN ] ), "Respawn_And_Guard", iVictim );
set_task( get_pcvar_float( pcvars_dm[ RESPAWN ] ), "Respawn_And_Guard", iVictim );
return HAM_HANDLED;
}
public fw_Touch_entity( index, iEntity )
{
if( !is_user_alive( index ) || !pev_valid( iEntity ) ) return FMRES_IGNORED;
static Get_EntityName[ 32 ];
pev( iEntity, pev_classname, Get_EntityName, 31 );
if( equal( Get_EntityName, g_szEntityName ) )
{
get_reward( index );
set_pev( iEntity, pev_effects, EF_NODRAW );
set_pev( iEntity, pev_solid, SOLID_NOT );
}
return FMRES_IGNORED;
}
public Respawn_And_Guard( index )
{
ExecuteHamB( Ham_CS_RoundRespawn, index );
set_user_godmode( index, .godmode = true );
static CsTeams:Teams;
Teams = cs_get_user_team( index );
switch( Teams )
{
case CS_TEAM_CT: set_rendering( index, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 50 );
case CS_TEAM_T: set_rendering( index, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 50 );
}
set_task( get_pcvar_float( pcvars_dm[ GUARD ] ), "Remove_Guard", index );
}
public Remove_Guard( index )
{
set_user_godmode( index, .godmode = false );
set_rendering( index );
}
public BlockCommands( index ) return PLUGIN_HANDLED;
public BlockShopMenu( index )
{
static iMsgBuy;
iMsgBuy = get_user_msgid( "BuyClose" );
message_begin( MSG_ONE, iMsgBuy, _, index );
message_end( );
return PLUGIN_HANDLED;
}
public InfPlayer( taskid )
{
static index; index = ID_HUD;
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, 200, 100, 1.0, 0.20, 1 );
ShowSyncHudMsg( index, g_iHudMessages, "[ %s ]^nNivel[ %d/%d ]^nExperiencia[ %d/%d ]^nResets[ %d ]^nHappyHour[ O%s ]",
g_szRangos[ g_iRangos[ index ] ][ RNAME ], g_iNiveles[ index ], get_pcvar_num( pcvars_dm[ MAX_LEVEL ] ), g_iExperiencia[ index ],
GetExp( g_iNiveles[ index ] ), g_iReset[ index ] , g_bHH ? "N":"FF");
}
/* ====================================================================================
.::ARSENAL DE ARMAS::.
======================================================================================*/
public Menu_General( index )
{
static iMenu, Get_Name[ 33 ];
get_user_name( index, Get_Name, 32 );
formatex( g_szText, charsmax( g_szText ), "\w%s Menu \yPrincipal^n\r%s", g_szPrefix, Get_Name[ index ] )
iMenu = menu_create( g_szText, "mh_Gen" );
menu_additem( iMenu, "Configuraciones" );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
}
Cfg( index )
{
static iMenu, Get_Name[ 33 ];
get_user_name( index, Get_Name, 32 );
formatex( g_szText, charsmax( g_szText ), "\w%s Menu de \yConfiguraciones^n\r%s", g_szPrefix, Get_Name[ index ] )
iMenu = menu_create( g_szText, "mh_Cfg" );
menu_additem( iMenu, "Ver Info" );
menu_additem( iMenu, "Hacer Reset" );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
}
ResetMenu( index )
{
static iMenu;
formatex( g_szText, charsmax( g_szText ), "\r=====================================^nNota:^nExperiencia & Nivel Reseteados a 0 ^nPero Tendras Privilegios Especiales^nNivel Requerido: %d^nTu Nivel: %d^n=====================================",
get_pcvar_num( pcvars_dm[ MAX_LEVEL ] ), g_iNiveles[ index ] );
iMenu = menu_create( g_szText, "RMenu" );
formatex( g_szText, charsmax( g_szText ), ( g_iNiveles[ index ] >= get_pcvar_num( pcvars_dm[ MAX_LEVEL ] ) ) ? "Resetear Ahora":"\dAun No Puedes Resetear" );
menu_additem( iMenu, g_szText );
menu_display( index, iMenu, 0 );
}
public Weapons( index )
{
static iMenu;
iMenu = menu_create( "\d| \yWeapon Arsenal \d|", "Mh_Arsenal" );
formatex( g_szText, charsmax( g_szText ), "\wArsenal Primario: \d| \y%s \d|",
g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_NAME ] );
menu_additem( iMenu, g_szText );
formatex( g_szText, charsmax( g_szText ), "\wArsenal Secundario: \d| \y%s \d|^n^n",
g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_NAME ] );
menu_additem( iMenu, g_szText );
menu_additem( iMenu, "\d| \yLoad Combo \d|" );
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
return PLUGIN_HANDLED;
}
ClasesWeaponSec( index )
{
static iMenu;
iMenu = menu_create( "\y[ \wSeleccione Su Arsenal Secundario \y]", "Mh_ClasesWeaponSec" );
for( new num = 0; num < sizeof( g_szWeaponsSec ); num++ )
{
if( g_iNiveles[ index ] >= g_szWeaponsSec[ num ][ WEAPON_REQUIRED ] )
{
formatex( g_szText, charsmax( g_szText ), "%s", g_szWeaponsSec[ num ][ WEAPON_NAME ] );
}
else
{
formatex( g_szText, charsmax( g_szText ), "\d( Nivel \r%d \d)", g_szWeaponsSec[ num ][ WEAPON_REQUIRED ] );
}
menu_additem( iMenu, g_szText );
}
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
}
ClasesWeapon( index )
{
static iMenu;
iMenu = menu_create( "\y[ \wSeleccione Su Arsenal Primario \y]", "Mh_ClasesWeapons" );
for( new num = 0; num < sizeof( g_szWeaponsPrim ); num++ )
{
if( g_iNiveles[ index ] >= g_szWeaponsPrim[ num ][ WEAPON_REQUIRED ] )
{
formatex( g_szText, charsmax( g_szText ), "%s", g_szWeaponsPrim[ num ][ WEAPON_NAME ] );
}
else
{
formatex( g_szText, charsmax( g_szText ), "\d( Nivel \r%d \d)", g_szWeaponsPrim[ num ][ WEAPON_REQUIRED ] );
}
menu_additem( iMenu, g_szText );
}
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
}
public Info_Menu( index )
{
static len, Get_Name[ 33 ]; len = 0;
get_user_name( index, Get_Name, 32 );
len += formatex( g_szText[ len ], charsmax( g_szText ) - len, "\wInformacion De La Cuenta \y[ \w%s \y]^n^n", Get_Name[ index ] );
len += formatex( g_szText[ len ], charsmax( g_szText ) - len, "\wRango\y[ \w%s \y]^n", g_szRangos[ g_iRangos[ index ] ][ RNAME ] );
len += formatex( g_szText[ len ], charsmax( g_szText ) - len, "\wHoras Jugadas \y[ \w%d \y]^n", g_iTime[ index ][ HORAS ] );
len += formatex( g_szText[ len ], charsmax( g_szText ) - len, "\wMinutos Jugados \y[ \w%d \y]^n^n", g_iTime[ index ][ MINUTOS ] );
len += formatex( g_szText[ len ], charsmax( g_szText ) - len, "\r0.\w Atras" );
show_menu( index, 1 << 9, g_szText, -1, "Descripcion" );
}
/* ====================================================================================
.::HANDLERS::.
======================================================================================*/
public mh_Cfg( index, iMenu, iItem )
{
if( iItem == MENU_EXIT || !is_user_connected( index ) )
{
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
switch( iItem )
{
case 0: Info_Menu( index );
case 1: ResetMenu( index );
}
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
public mh_Gen( index, iMenu, iItem )
{
if( iItem == MENU_EXIT || !is_user_connected( index ) )
{
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
switch( iItem )
{
case 0: Cfg( index );
}
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
public Inf_Keygen( index, iKeygen ) Cfg( index );
public Mh_Arsenal( index, iMenu, iItem )
{
switch( iItem )
{
case 0: ClasesWeapon( index );
case 1: ClasesWeaponSec( index );
case 2: LoadArsenal( index );
}
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
public Mh_ClasesWeapons( index, iMenu, iItem )
{
if( !is_user_connected( index ) )
{
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
if( g_iNiveles[ index ] >= g_szWeaponsPrim[ iItem ][ WEAPON_REQUIRED ] )
{
g_szWeaponSelected[ index ][ PRIM ] = iItem;
Weapons( index );
}
else
{
ClasesWeapon( index );
return PLUGIN_HANDLED;
}
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
public Mh_ClasesWeaponSec( index, iMenu, iItem )
{
if( !is_user_connected( index ) )
{
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
if( g_iNiveles[ index ] >= g_szWeaponsSec[ iItem ][ WEAPON_REQUIRED ] )
{
g_szWeaponSelected[ index ][ SEC ] = iItem;
Weapons( index );
}
else
{
ClasesWeaponSec( index );
return PLUGIN_HANDLED;
}
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
public RMenu( index, iMenu, iItem )
{
if( iItem == MENU_EXIT || !is_user_connected( index ) )
{
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
if( g_iNiveles[ index ] >= get_pcvar_num( pcvars_dm[ MAX_LEVEL ] ) )
{
g_iReset[ index ]++;
g_iExperiencia[ index ] = 0;
g_iNiveles[ index ] = 0;
iChat( index, "^4%s ^3Conseguiste un Reset", g_szPrefix );
menu_destroy( iMenu );
}
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
/* ====================================================================================
.::PRIVATES::.
======================================================================================*/
LoadArsenal( index )
{
if( !is_user_alive( index ) || !is_user_connected( index ) ) return;
strip_user_weapons( index );
give_item( index, "weapon_knife" );
give_item( index, g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_ ] );
cs_set_user_bpammo( index, g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_CSW ],
g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_AMMOUNT ] );
give_item( index, g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_ ] );
cs_set_user_bpammo( index, g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_CSW ],
g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_AMMOUNT ] );
}
Create_RewardEntity( const Float:fOrigin[ 3 ] )
{
static iEntity;
iEntity = engfunc( EngFunc_CreateNamedEntity, g_iEntity );
set_pev( iEntity, pev_classname, g_szEntityName );
engfunc( EngFunc_SetModel, iEntity , g_szEntityModel );
set_pev( iEntity , pev_mins , Float:{ -10.0, -10.0, 0.0 } );
set_pev( iEntity , pev_maxs , Float:{ 10.0, 10.0, 25.0 } );
set_pev( iEntity , pev_size , Float:{ -10.0, -10.0, 0.0, 10.0, 10.0, 25.0 } );
engfunc( EngFunc_SetSize, iEntity, Float:{ -10.0,-10.0,0.0 } , Float:{ 10.0,10.0,25.0 } );
set_pev( iEntity, pev_solid, SOLID_BBOX );
set_pev( iEntity, pev_movetype, MOVETYPE_TOSS );
set_pev( iEntity, pev_origin, fOrigin );
set_pev( iEntity, pev_renderfx, kRenderFxGlowShell );
drop_to_floor( iEntity );
set_pev( iEntity, pev_rendercolor, Float:{ 0.0, 0.0, 255.0 } );
}
get_nivel( index )
{
static MaxLevel, Update;
Update = false;
MaxLevel = get_pcvar_num( pcvars_dm[ MAX_LEVEL ] );
while( g_iExperiencia[ index ] >= GetExp( g_iNiveles[ index ] ) && g_iNiveles[ index ] < MaxLevel )
{
Update = true;
g_iNiveles[ index ]++;
}
if( Update )
{
iChat( index, "^4%s ^3Haz Avanzado de Nivel Papu", g_szPrefix );
iPlaySound( index, g_szPromoved );
}
}
public eRoundStart( )
{
get_HH( );
}
get_HH( )
{
g_bHH = false;
static iHTime[ 3 ], iHH;
get_time( "%H", iHTime, charsmax( iHTime ) );
for( iHH = 0; iHH < sizeof ( g_iHHTIMES ); iHH++ )
{
if( equal( iHTime, g_iHHTIMES[ iHH ] ) )
g_bHH = true;
}
}
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, "^4%s ^3Haz Sido Promovido a %s", g_szPrefix, g_szRangos[ g_iRangos[ index ] ][ RNAME ] )
Range_Up = false;
iPlaySound( index, g_szRPromoved );
}
}
get_reward( index )
{
switch( random_num( 0, 5 ) )
{
case 0:
{
client_print( index, print_center, "+ 1 Experiencia" );
g_iExperiencia[ index ] += 1;
}
case 1:
{
client_print( index, print_center, "+ 2 Experiencia" );
g_iExperiencia[ index ] += 2;
}
case 2:
{
client_print( index, print_center, "+ 3 Experiencia" );
g_iExperiencia[ index ] += 3;
}
case 3:
{
client_print( index, print_center, "+ 4 Experiencia" );
g_iExperiencia[ index ] += 4;
}
case 4:
{
client_print( index, print_center, "+ 5 Experiencia" );
g_iExperiencia[ index ] += 5;
}
case 5:
{
client_print( index, print_center, "+ 6 Experiencia" );
g_iExperiencia[ index ] += 6;
}
}
}
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_field( g_iGuardado, g_iFields[ FIELD_RESET ], g_iReset[ index ] );
adv_vault_set_field( g_iGuardado, g_iFields[ FIELD_EXP ], g_iExperiencia[ index ] );
adv_vault_set_field( g_iGuardado, g_iFields[ FIELD_NIVEL ], g_iNiveles[ index ] );
adv_vault_set_end( g_iGuardado, 0, g_iPlayerName[ index ] );
}
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 ] );
g_iReset[ index ] = adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_RESET ] );
g_iExperiencia[ index ] = adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_EXP ] );
g_iNiveles[ index ] = adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_NIVEL ] );
adv_vault_get_field( g_iGuardado, g_iFields[ FIELD_TIMES ], g_iTime[ index ], sizeof ( g_iTime[ ] ) );
}
/* ====================================================================================
.::STOCKS::.
======================================================================================*/
stock set_experiencia( index, num )
{
g_iExperiencia[ index ] += clamp( num, 0, get_pcvar_num( pcvars_dm[ MAX_LEVEL ] ) );
get_nivel( index );
}
stock get_weapon_ent_owner( iEnt )
{
if ( ~pev_valid( iEnt ) & 2 ) return -1;
return get_pdata_cbase( iEnt, 41, 4 );
}
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( );
}
stock iPlaySound( index, const sound[ ] )
{
if( !index )
{
if ( equal( sound[ strlen( sound ) - 4 ], ".mp3" ) )
client_cmd( 0, "mp3 play %s", sound );
else
client_cmd( 0, "spk ^"%s^"", sound ) ;
}
else
{
if( is_user_connected( index ) )
{
if ( equal( sound[ strlen( sound ) - 4 ], ".mp3" ) )
client_cmd( index, "mp3 play %s", sound );
else
client_cmd( index, "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 = 0, GUARD, MAX_LEVEL };
enum _:DATA_WEAPONS { WEAPON_NAME[ 90 ], WEAPON_[ 90 ], WEAPON_CSW, WEAPON_AMMOUNT };
enum _:TYPE_WEAPONS { PRIM = 0, SEC };
new const g_szWeaponsPrim[ ][ _:DATA_WEAPONS ] =
{
{ "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 },
{ "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 g_szWeaponsSec[ ][ _:DATA_WEAPONS ] =
{
{ "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 }
};
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_szWeaponSelected[ 33 ][ _:TYPE_WEAPONS ];
new g_szText[ 500 ];
// =================================================================
public plugin_init( )
{
register_plugin( g_szAutor[ 0 ], g_szAutor[ 1 ], g_szAutor[ 2 ] );
// Fordwards
RegisterHam( Ham_Killed, "player", "Ham_PlayerKilled", 1 );
RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawn", 1 );
// Comandos
for( new _block_num = 0; _block_num < sizeof( g_iBlock ); ++_block_num )
register_clcmd( g_iBlock[ _block_num ], "BlockCommands" );
register_clcmd( "client_buy_open", "BlockShopMenu" );
// Eventos
register_event( "HLTV", "eRoundStart", "a", "1=0", "2=0" );
// Asignate Values
pcvars_dm[ GUARD ] = register_cvar( "dm_guardtime", "3.0" );
pcvars_dm[ RESPAWN ] = register_cvar( "dm_respawndelay", "3.0" );
pcvars_dm[ MAX_LEVEL ] = register_cvar( "dm_maxlevel", "100" );
}
public client_putinserver( index )
{
g_szWeaponSelected[ index ][ PRIM ] = g_szWeaponSelected[ index ][ SEC ] = 0 ;
}
public Ham_PlayerSpawn( index )
{
if ( !is_user_connected( index ) || !is_user_alive( index ) ) return;
set_task( 0.3, "drop_weapons", index );
}
public drop_weapons( index )
{
strip_user_weapons( index );
give_item( index, "weapon_knife" );
Weapons( index );
}
public Ham_PlayerKilled( iVictim, iAttacker, shouldgib )
{
if( !is_user_alive( iAttacker ) || !is_user_connected( iAttacker ) ) return HAM_IGNORED;
if( iAttacker == iVictim ) set_task( get_pcvar_float( pcvars_dm[ RESPAWN ] ), "Respawn_And_Guard", iVictim );
set_task( get_pcvar_float( pcvars_dm[ RESPAWN ] ), "Respawn_And_Guard", iVictim );
return HAM_HANDLED;
}
public Respawn_And_Guard( index )
{
ExecuteHamB( Ham_CS_RoundRespawn, index );
set_user_godmode( index, .godmode = true );
static CsTeams:Teams;
Teams = cs_get_user_team( index );
switch( Teams )
{
case CS_TEAM_CT: set_rendering( index, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 50 );
case CS_TEAM_T: set_rendering( index, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 50 );
}
set_task( get_pcvar_float( pcvars_dm[ GUARD ] ), "Remove_Guard", index );
}
public Remove_Guard( index )
{
set_user_godmode( index, .godmode = false );
set_rendering( index );
}
public BlockCommands( index ) return PLUGIN_HANDLED;
public BlockShopMenu( index )
{
static iMsgBuy;
iMsgBuy = get_user_msgid( "BuyClose" );
message_begin( MSG_ONE, iMsgBuy, _, index );
message_end( );
return PLUGIN_HANDLED;
}
/* ====================================================================================
.::ARSENAL DE ARMAS::.
======================================================================================*/
public Weapons( index )
{
static iMenu;
iMenu = menu_create( "\d| \yWeapon Arsenal \d|", "Mh_Arsenal" );
formatex( g_szText, charsmax( g_szText ), "\wArsenal Primario: \d| \y%s \d|",
g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_NAME ] );
menu_additem( iMenu, g_szText );
formatex( g_szText, charsmax( g_szText ), "\wArsenal Secundario: \d| \y%s \d|^n^n",
g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_NAME ] );
menu_additem( iMenu, g_szText );
menu_additem( iMenu, "\d| \yLoad Combo \d|" );
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
return PLUGIN_HANDLED;
}
ClasesWeaponSec( index )
{
static iMenu;
iMenu = menu_create( "\y[ \wSeleccione Su Arsenal Secundario \y]", "Mh_ClasesWeaponSec" );
for( new num = 0; num < sizeof( g_szWeaponsSec ); num++ )
{
formatex( g_szText, charsmax( g_szText ), "%s", g_szWeaponsSec[ num ][ WEAPON_NAME ] );
menu_additem( iMenu, g_szText );
}
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
}
ClasesWeapon( index )
{
static iMenu;
iMenu = menu_create( "\y[ \wSeleccione Su Arsenal Primario \y]", "Mh_ClasesWeapons" );
for( new num = 0; num < sizeof( g_szWeaponsPrim ); num++ )
{
formatex( g_szText, charsmax( g_szText ), "%s", g_szWeaponsPrim[ num ][ WEAPON_NAME ] );
menu_additem( iMenu, g_szText );
}
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_setprop( iMenu, MPROP_NUMBER_COLOR, "\y" );
menu_display( index, iMenu, 0 );
}
/* ====================================================================================
.::HANDLERS::.
======================================================================================*/
public Mh_Arsenal( index, iMenu, iItem )
{
switch( iItem )
{
case 0: ClasesWeapon( index );
case 1: ClasesWeaponSec( index );
case 2: LoadArsenal( index );
}
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
public Mh_ClasesWeapons( index, iMenu, iItem )
{
if( !is_user_connected( index ) )
{
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
g_szWeaponSelected[ index ][ PRIM ] = iItem;
Weapons( index );
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
public Mh_ClasesWeaponSec( index, iMenu, iItem )
{
if( !is_user_connected( index ) )
{
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
g_szWeaponSelected[ index ][ SEC ] = iItem;
Weapons( index );
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
/* ====================================================================================
.::PRIVATES::.
======================================================================================*/
LoadArsenal( index )
{
if( !is_user_alive( index ) || !is_user_connected( index ) ) return;
strip_user_weapons( index );
give_item( index, "weapon_knife" );
give_item( index, g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_ ] );
cs_set_user_bpammo( index, g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_CSW ],
g_szWeaponsPrim[ g_szWeaponSelected[ index ][ PRIM ] ][ WEAPON_AMMOUNT ] );
give_item( index, g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_ ] );
cs_set_user_bpammo( index, g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_CSW ],
g_szWeaponsSec[ g_szWeaponSelected[ index ][ SEC ] ][ WEAPON_AMMOUNT ] );
}
/* ====================================================================================
.::STOCKS::.
======================================================================================*/
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( );
}
NOTA:
Si vas a Comentar;
1. Solo Criticas Constructivas;
2. Solo Responderé Preguntas Si son del Thread;
~Digito ergo sum~