Modelos para admines
#1
ayuda lo que quiero es como ponerle modelos a los siguientes admines


admin ROOT modelo banana

Admin golden modelo goku

Vip modelo modelo vip

les dejo el codigo
Código PHP:
#include amxmodx
#include hamsandwich
#include fakemeta
#include cstrike
#include engine
#include fun
#include amxmisc
#include adv_vault
#include dhudmessage
#include screenfade_util

native shop_Thanatos7(index)
native shop_janus(index)
native shop_ThanatosI(index)
native shop_Plasma(index)
    
#define HUD_ID (taskid-TASK_HUD) 
#define TASK_HUD 12312
#define TAG "[ AMXX ]"

#define MarkBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )  
#define ClearBit(%1,%2) ( %1 &= ~ ( 1 << ( %2 & 31 ) ) )  
#define IsBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )  

#define rangos_maximos 26

#define vida(%1)        (%1 * 15)   
#define chaleco(%1)     (%1 * 10)   
#define velocidad(%1)   (%1 * 0.1)  
#define gravedad(%1)    (%1 * 0.1) 

/*===============================Hecho Por; Amxmodx ===============================*/

new const INF_PLUGIN[][] = { "Rangos""1,1""GeX~" }

/*=================================================================================*/

new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame  

new const TDFW[] = "sound/td_for_what.mp3";

new 
gFrag[33], gRango33 ], Elegido33 ], gMenu[33], gDorados[33], gPrim[33], gSec[33], g_habilidad[33][ ], 
kGanancia[33], kAccountType[33][20], kHasSpeed33 ], g_player_proname[32], g_playername[33][32];

const 
UNIT_SECOND = (<< 12);

new 
g_message_hudg_uniqueg_countg_count_screensg_count_finalg_finishg_message_screenshake;
new 
g_message_screenfadeg_msgTeamInfog_msgSayTextg_conectadogHudg_maxplayersg_leveluppg_levelupp1kSynccylinderspr
dm_revivedm_proteccionm_spriteTextureg_MsgTutorg_MsgTutClose
new gSuper[33], gModgRondasg_hud_boludoboludocvar_ronda


new gBuyCommands[][] = {
    
"usp""glock""deagle""p228""elites""fn57""m3""xm1014""mp5""tmp""p90""mac10""ump45""ak47",
    
"galil""famas""sg552""m4a1""aug""scout""awp""g3sg1""sg550""m249""vest""vesthelm""flash""hegren",
    
"autoshotgun""smg""mp""c90""cv47""defender""clarion""krieg552""bullpup""magnum""d3au1""krieg550",
    
"buyammo1""buyammo2"
}
new const 
horas[] = { 0001020304050607, 08 ,09, 10 
new 
boolg_happytime

enum _
:rango rangos_nombre[64], nivel_requeridoVIDACHALECO }
enum _:DATA_K K_NOMBRE32 ], VMDL30 ], PMDL30 ], NECESARIO }
enum _:DATA_TIENDA NK[20], REQ }
enum armas_caracteristicas NAME[20], CSW_NAMEWEAPON_NAME[20], BPAMMORGNmodel_1[70], model_2[70], rrrvvvaaa}
enum _:menu_nades nombre[33], cantidad1cantidad2cantidad3nivel }
enum _:DATA_MEJORA  MEJORA_NAME10 ],   MEJORA_COSTO,  MEJORA_MAX  };  
enum _GANANCIA_DATA GD_ADM_TYPE[20], GD_ADM_FLAGGD_ADM_GNGD_ADM_GHH }
/*==GUARDADO==*/
new g_contra[33][20], g_contra2[33][20], g_cuenta[33][32];

new 
g_vault,g_MsgVguig_MsgShowMenu;
new 
g_Estado[33], g_Can[33], g_Fecha[33][32];

enum PTSRANDORHABFECHAPASSWORDDATA_M };
enum NOREGISTRADO 0REGISTRADOLOGUEADOESTADOS };
new const 
Estado[ESTADOS][] = { "Sin Registrar""Registrado""Logueado" };
new 
g_campo[DATA_M]; 
/*====*/

new const Ganancias[][GANANCIA_DATA] = {
    
//|    TIPO DE ADM     |     FLAGS    | GANANCIA NORMAL | GANANCIA EN HH
    
"Vip",         ADMIN_LEVEL_F,         2,         3     },
    { 
"Admin Golden",         ADMIN_LEVEL_G,         3,         4     },
    { 
"Admin Root",     ADMIN_LEVEL_H,         5,         6     }


new const 
rangos[rangos_maximos][rango] = {
    
// clase        rango    vida     chaleco 
    
{"Explorador ",     0,    100,     10 },
    {
"Recluta ",        10,    100,     15 },
    {
"Cabo",        55,    100,     20 },            
    {
"Cabo Mayor",        70,    100,     25 },
    {
"Sargento",        100,    100,     30 },        
    {
"Capitan",        200,    150,     35 },
    {
"Teniente",        300,    150,     40 },         
    {
"Coronel",        400,    150,     45 },
    {
"Comandante",        500,    150,     50 },        
    {
"General",        600,    200,     55 },
    {
"Asesino",        650,    200,     60 },         
    {
"Criminal",        700,    200,     65 },
    {
"Experto",        750,    200,     70 },        
    {
"Espia",        770,    250,     75 },
    {
"Super Experto",    790,    250,     80 },    
    {
"Marine",        800,    250,     85 },
    {
"Sobreviviente",    810,    300,     90 },    
    {
"Nazi",         820,    300,     95 },
    {
"Exterminador",     830,    300,     100 },        
    {
"Destripador",     850,    300,     110 },
    {
"Profecional",     860,    350,     120 },        
    {
"Matador",         870,    350,     130 },
    {
"Puta",         890,    350,     140 },            
    {
"Mega puta",         900,    350,     150 },
    {
"John Cena",         1000,    400,     150 },
    {
"",             99999999,      0,      
    
}

new const 
ItemsTienda[][DATA_TIENDA] = {
    {
"Thanatos7"18},
    {
"janus"19},
    {
"ThanatosI"20},
    {
"Plasma"23}
}

new const 
Knifes[ ][ DATA_K ] = {
    { 
"Knife Normal""v_knife""p_knife"},
    { 
"Knife feo :v""bw_knife""p_knife"15 },
    { 
"Pirata""v_pirata""p_knife"},
    { 
"Sopapo :v""v_sopapo""p_knife"},
    { 
"doble Espada""v_espadas""p_knife"},
    { 
"Sable""v_sable""p_knife"10 }
};

new const 
g_armas_prim[][armas_caracteristicas] = { 
    
// NAME en el menu | CSW_ | weapon_ | Balas | rango   | mdlv  | mdlp  | r  | v  | a   
    
"Schmidt TMP" CSW_TMP "weapon_tmp"99990"normal""normal"000},
    { 
"Ingram MAC-10" CSW_MAC10 "weapon_mac10" 99992"normal""normal"000}, 
    { 
"UMP 45" CSW_MP5NAVY "weapon_mp5navy" 99993"normal""normal"000}, 
    { 
"Navy MP5" CSW_UMP45 "weapon_ump45" 99994"normal""normal"000}, 
    { 
"M3 Super 90" CSW_M3 "weapon_m3" 99995"normal""normal"000}, 
    { 
"XM1014 M4" CSW_XM1014 "weapon_xm1014" 99996"normal""normal"000}, 
    { 
"Conejita F90" CSW_P90 "weapon_p90" 99997"models/[G]eX/v_conejita.mdl""models/[G]eX/p_conejita.mdl"2550213}, 
    { 
"Scout Master" CSW_SCOUT "weapon_scout" 99998"models/[G]eX/v_scoutmaster.mdl""models/[G]eX/p_scoutmaster.mdl"2552550}, 
    { 
"Famas" CSW_FAMAS "weapon_famas" 999910"normal""normal"000}, 
    { 
"IMI Galil" CSW_GALIL "weapon_galil" 999912"normal""normal"000}, 
    { 
"Ak Gold" CSW_AK47 "weapon_ak47" 999914"models/[G]eX/v_goldenak47.mdl""normal"2552550},
    { 
"M4A1 ReD" CSW_M4A1"weapon_m4a1"999916"models/[G]eX/v_m4a1red.mdl""normal"25500},
    { 
"SG-552 Commando" CSW_SG552 "weapon_sg552" 999918"normal""normal"000},
    { 
"Aug" CSW_AUG "weapon_aug" 9020"normal""normal"000},
    { 
"AWP Magnum Sniper" CSW_AWP "weapon_awp" 999922"normal""normal"000},
    { 
"G3SG1 Auto-Sniper" CSW_G3SG1 "weapon_g3sg1" 999923"normal""normal"00225},
    { 
"SG-550 Auto-Sniper" CSW_SG550 "weapon_sg550" 999924"normal""normal"22500},
    { 
"M249 SAW" CSW_M249 "weapon_m249" 999925"normal""normal"02250}
}

new const 
g_armas_sec[][armas_caracteristicas] = { 
    
// NAME en el menu | CSW_ | weapon_ | Balas | rango   | mdlv  | mdlp  | r  | v  | a   
    
"Glock" CSW_GLOCK18 "weapon_glock18" 99990"normal""normal"000},  
    { 
"USP" CSW_USP "weapon_usp"99995"normal""normal"000},
    { 
"P228" CSW_P228 "weapon_p228"999910"normal""normal"000},
    { 
"Deagle" CSW_DEAGLE "weapon_deagle"999915"normal""normal"22500},
    { 
"Fiveseven" CSW_FIVESEVEN "weapon_fiveseven"999920"normal""normal"00200},
    { 
"Dual Elite" CSW_ELITE "weapon_elite"999920"normal""normal"0200200},
    { 
"Elite Green" CSW_ELITE "weapon_elite"999921"normal""normal"502000}


new const 
nades[][menu_nades] = {
    {
"+ 1 HE | + 1 Flash | + 1 Smoke"111},
    {
"+ 2 HE | + 2 Flash | + 2 Smoke"222},
    {
"+ 3 HE | + 3 Flash | + 3 Smoke"33310},
    {
"+ 4 HE | + 4 Flash | + 4 Smoke"44415},
    {
"+ 5 HE | + 5 Flash | + 5 Smoke"55520}
}

new 
g_mejora_data[ ][ DATA_MEJORA ] =  {  
    { 
"Vida",         10020 },  
    { 
"Chaleco",     13010 },  
    { 
"Velocidad",     110},  
    { 
"Gravedad",     1604}  
};  

new const 
sprite_levelup[] = { "sprites/lgtning.spr" }
new const 
item_class_name[] = "dm_item";
new const 
gs_AmbienSound[] = "sound/start.mp3";
new 
g_model[] = "models/zombie_plague/regalito.mdl";

/*====== tutor cz===*/

public plugin_init(){
    
register_plugin(INF_PLUGIN[0], INF_PLUGIN[1], INF_PLUGIN[2])
    
    
dm_revive register_cvar("deathmatch_respawn""3.0")
    
dm_proteccion register_cvar("deathmatch_proteccion""5.0")
    
    
boludo register_cvar("amx_boludo""1")
    
cvar_ronda register_cvar("rondas_boludo""4")
    
    
register_event("DeathMsg""EventoM""a")
    
register_logevent("round_end"2"1=Round_End")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
register_message(get_user_msgid("StatusIcon"), "message_statusicon")
    
    
register_forward(FM_Touch"fwd_Touch");
    
    
set_msg_block get_user_msgid "ClCorpse" ), BLOCK_SET )
    
    
RegisterHamHam_Spawn,"player","fw_PlayerSpawn_Post",true );
    
RegisterHam(Ham_Killed"player""reload_playerpro"1)
    
RegisterHam(Ham_TraceAttack"worldspawn""make_tracer"1)
    
RegisterHam(Ham_Item_Deploy"weapon_knife""ham_KnifeDeployPost"1)
    
RegisterHamHam_Player_ResetMaxSpeed"player""fw_Player_ResetMaxSpeed"); 
    for( new 
0sizeof g_armas_primi++ )
        
RegisterHam(Ham_Item_Deployg_armas_prim[i][WEAPON_NAME], "Ham_AllItem"1)
    
    for( new 
0sizeof g_armas_seci++ )
        
RegisterHam(Ham_Item_Deployg_armas_sec[i][WEAPON_NAME], "Ham_AllItem"1)
        
    
/*for( new i = 0; i < sizeof g_armas_prim; i++ )
        RegisterHam(Ham_Weapon_PrimaryAttack, g_armas_prim[i][WEAPON_NAME], "Ham_AllArmas", .Post = true)
    
    for( new i = 0; i < sizeof g_armas_sec; i++ )
        RegisterHam(Ham_Weapon_PrimaryAttack, g_armas_sec[i][WEAPON_NAME], "Ham_AllArmas", .Post = true)*/
    
    
register_concmd("rg_exp""CmdExp"ADMIN_RCON"<Nombre> <Exp>")
    
    
register_clcmd("say /knife","menuknifes")
    
register_clcmd("buy","menuknifes")
    
register_clcmd"say /puntos" "show_menu_puntos" ); 
    
register_clcmd("say""clcmd_say")
    
    
    for (new 
0sizeof (gBuyCommands); i++) 
        
register_clcmd(gBuyCommands[i], "BlockBuyCommands")
    
    
register_clcmd("INGRESAR_PASSWORD""Contra");
    
register_clcmd("say /cuenta""ShowLogMenu");
    
    
g_MsgVgui get_user_msgid("VGUIMenu");
    
g_MsgShowMenu get_user_msgid("ShowMenu");
    
register_message(g_MsgVgui"message_VGUImenu");
    
register_message(g_MsgShowMenu"message_VGUImenu");
    
    
g_vault adv_vault_open("Cuentas"false);
    
g_campo[PTS]    = adv_vault_register_field(g_vault"pts")
    
g_campo[RAN]    = adv_vault_register_field(g_vault"rango")
    
g_campo[DOR]    = adv_vault_register_field(g_vault"dorados")
    
g_campo[HAB]    = adv_vault_register_field(g_vault"habs")
    
g_campo[FECHA] = adv_vault_register_field(g_vault"FECHA"DATATYPE_STRING32);
    
g_campo[PASSWORD] = adv_vault_register_field(g_vault"PW"DATATYPE_STRING20);
    
adv_vault_init(g_vault);
    
    
gHud CreateHudSyncObj() 
    
kSync CreateHudSyncObj();
    
g_hud_boludo CreateHudSyncObj();
    
g_maxplayers get_maxplayers()
    
    
remove_entity_name"armoury_entity" );  
    
g_message_screenshake get_user_msgid("ScreenShake");
    
g_message_screenfade get_user_msgid("ScreenFade");
    
    
g_message_hud CreateHudSyncObj();
    
    
g_msgTeamInfo get_user_msgid"TeamInfo" );
    
g_msgSayText get_user_msgid"SayText" ); 
    
    
set_task(20.0"concmd_RockFinal");
    
}

public 
CmdExp(idlevelcid) { 
    if (!
cmd_access(idlevelcid2)) return PLUGIN_HANDLED
    
    static 
arg[32], arg2[6], playercantidad
    
    read_argv
(1argsizeof arg 1
    
read_argv(2arg2sizeof arg2 1
    
player cmd_target(idargCMDTARGET_NO_BOTS CMDTARGET_ALLOW_SELF
    
    if (!
player) return PLUGIN_HANDLED
    
    
cantidad = (str_to_num(arg2)) 
    
ColorChat(player"%s Te dieron^4 %d^1 de frags(s) !!"TAGcantidad
    
//tutorMake(player, TUTOR_GREEN, 4.0, "%s Te dieron^4 %d^1 de frags(s) !!", TAG, cantidad) 
    
gFrag[player] += cantidad
    
    chequear_rango
(id)
    
    return 
PLUGIN_HANDLED


public 
plugin_precache() {
    
    
set_lights("b")
    static 
ibuffer[300];
    
    
    for(
0sizeof Knifes; ++i){
        
formatexbuffercharsmax(buffer), "models/%s.mdl"Knifes][ VMDL ] );
        
precache_modelbuffer );
        
        
formatexbuffercharsmax(buffer), "models/%s.mdl"Knifes][ PMDL ] );
        
precache_modelbuffer );
    }
    for(
sizeof g_armas_prim i++)
    {
        if(!(
equal(g_armas_prim[i][model_1], "normal")))
            
precache_model(g_armas_prim[i][model_1])
        
        if(!(
equal(g_armas_prim[i][model_2], "normal")))
            
precache_model(g_armas_prim[i][model_2])
    }
    
    for(
sizeof g_armas_sec i++)
    {
        if(!(
equal(g_armas_sec[i][model_1], "normal")))
            
precache_model(g_armas_sec[i][model_1])
        
        if(!(
equal(g_armas_sec[i][model_2], "normal")))
            
precache_model(g_armas_sec[i][model_2])
    }
        
    
g_levelupp engfunc(EngFunc_PrecacheModelsprite_levelup)
    
precache_genericTDFW );
    
precache_model(g_model);
    
precache_sound("t_2c2/tcs_one.wav");
    
precache_sound("t_2c2/tcs_two.wav");
    
precache_sound("t_2c2/tcs_three.wav");
    
precache_sound("t_2c2/tcs_four.wav");
    
precache_sound("t_2c2/tcs_five.wav");
    
precache_genericgs_AmbienSound );
    
precache_sound("weapons/c4_explode1.wav");
    
    
precache_generic("sound/t_2c2/px2.mp3");
    
m_spriteTexture engfunc(EngFunc_PrecacheModel"sprites/laserbeam.spr")
    
cylinderspr precache_model("sprites/shockwave.spr");
}
    

public 
event_round_start() {
    if (!
boludo) return;
    
client_cmd(0"mp3 play %s"gs_AmbienSound
    
client_print(0print_chat"MOD EDITADO POR  %s"INF_PLUGIN[2])
    if (
gRondas == get_pcvar_num(cvar_ronda))
    {
        
gMod true
        gRondas 
1
        set_task
(2.0"llamar_funcion_boludo")
    }
    else
    {
        
gRondas++
        
client_print(0print_chat"Faltan %d Ronda%s."get_pcvar_num(cvar_ronda) - gRondas 1gRondas >= "" "s")
    }
    
    for (new 
id 1id <= g_maxplayersid++){
        
kHasSpeed[id] = false
    
}
    
    
set_task(0.1,"happyhour")
    
    new 
ent FM_NULLENT
    
static string_class[] = "classname"
    
    
while ((ent engfunc(EngFunc_FindEntityByStringentstring_classitem_class_name))) 
        
set_pev(entpev_flagsFL_KILLME)
}
public 
round_end(){
    if (
gMod)
        for (new 
id 1id <= g_maxplayersid++){
        
gSuper[id] = false
        gMod 
false
        
    
}
}

public 
BlockBuyCommands(id){
    if (!
gMod)
        return 
PLUGIN_CONTINUE;
    
    return 
PLUGIN_HANDLED;
}
public 
ham_KnifeDeployPost(wpn) {
    static 
idid get_weapon_ent_owner(wpn);
    
    if (!
pev_valid(id) || !is_user_aliveid )) return;
    
    static 
WeaponIDWeaponID cs_get_weapon_id(wpn); 
    
    static 
buffer[128];
    
    if(
WeaponID == CSW_KNIFE){
        
formatexbuffercharsmaxbuffer ), "models/%s.mdl"Knifes[Elegido[id]][VMDL]);
        
set_pev(idpev_viewmodel2buffer );
        
        
formatexbuffercharsmaxbuffer ), "models/%s.mdl"Knifes[Elegido[id]][PMDL]);
        
set_pev(idpev_weaponmodel2buffer);
    }
}
public 
Ham_AllItem(Weapon)
{
    static 
OwnerIDWeapon
    
    IDWeapon 
cs_get_weapon_id(Weapon)
    
Owner get_weapon_ent_owner(Weapon)
    
    if (!
pev_valid(Owner) || !is_user_alive(Owner)) return HAM_IGNORED
    
    
if(IDWeapon == g_armas_prim[gPrim[Owner]][CSW_NAME])
    {    
        if (!
equal(g_armas_prim[gPrim[Owner]][model_1], "normal"))
        
set_pev(Ownerpev_viewmodel2g_armas_prim[gPrim[Owner]][model_1])
        if (!
equal(g_armas_prim[gPrim[Owner]][model_2], "normal"))
        
set_pev(Ownerpev_weaponmodel2g_armas_prim[gPrim[Owner]][model_2])
    }
    if(
IDWeapon == g_armas_sec[gSec[Owner]][CSW_NAME])
    {    
        if (!
equal(g_armas_sec[gSec[Owner]][model_1], "normal"))
        
set_pev(Ownerpev_viewmodel2g_armas_sec[gSec[Owner]][model_1])
        if (!
equal(g_armas_sec[gSec[Owner]][model_2], "normal"))
        
set_pev(Ownerpev_weaponmodel2g_armas_sec[gSec[Owner]][model_2])
    }
    return 
HAM_HANDLED;
}


public 
menuknifesid ) {
    if (
gSuper[id] || !is_user_alive(id)) return 
    static 
kmenustring[80]; menu menu_create"\rMenu de Cuchillos""menu_cuchi" );
    
    for( 
0sizeof Knifes; ++){
        if(
gRangoid ] >= Knifes][ NECESARIO ] )
            
menu_additemmenuKnifes][ K_NOMBRE ], "" );
        else
        {
            
formatexstringcharsmax( string ), "\d%s \y[ \r%s \y]"Knifes][ K_NOMBRE ], rangosKnifes[k][NECESARIO]][rangos_nombre] );
            
menu_additemmenustring"" );
        }
    }
    
    
menu_displayidmenu );
    
//return PLUGIN_HANDLED;
}

public 
menu_cuchiidmenuitem ){
    if(
item == MENU_EXIT){ 
        
menu_destroymenu 
        return 
PLUGIN_HANDLED 
    
}
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRangoid ] < Knifesitem ][ NECESARIO ] ){
        
ColorChatid"Necesitas ser rango: !g^"%s^" !npara usar este knife"rangosKnifes[item][NECESARIO]][rangos_nombre]);
        
menuknifesid );
        return 
PLUGIN_HANDLED;
    }
    
Elegidoid ] = item;
    
engclient_cmdid"weapon_knife");
    
show_guns_prim(id)
    
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
}
show_guns_prim(id) {
    if (
gSuper[id] || !is_user_alive(id)) return;
    new 
len[50], menu menu_create("Eliga su arma primaria""handler_prim"
    for(new 
0sizeof g_armas_primi++) 
    { 
        if(
gRango[id] >= g_armas_prim[i][RGN] ) menu_additem(menug_armas_prim[i][NAME], ""
        else { 
            
formatex(lencharsmax(len), "\r[ \yRango Requerido: \d%s \r]"rangos[g_armas_prim[i][RGN]][rangos_nombre] )
            
menu_additem(menulen"")
        }
    }
    
menu_display(idmenu0)
}
/*
public Ham_AllArmas(all) {
    new id = get_pdata_cbase(all, 41, 4)
    if(is_user_alive(id) && gPrim[id] == 2 || gPrim[id] == 5 || gPrim[id] == 8) 
    {
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        
    }
    if(is_user_alive(id) && gSec[id] == 2 || gSec[id] == 5 || gSec[id] == 6) 
    {
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        
    }
    return HAM_IGNORED
}

*/

public handler_prim(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu
        return 
PLUGIN_HANDLED
    }
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRango[id] < g_armas_prim[item][RGN] ) { 
        
//tutorMake(id, TUTOR_GREEN, 4.0, "Bloqued rango: %s", rangos[g_armas_prim[item][RGN]][rangos_nombre]) 
        
client_print(idprint_center"Bloqued rango: %s"rangos[g_armas_prim[item][RGN]][rangos_nombre]) 
        
show_guns_prim(id
        return 
PLUGIN_HANDLED
    }
    
strip_user_weapons(id
    
gPrim[id] = item;
    
give_item(id"weapon_knife"
    
give_item(idg_armas_prim[item][WEAPON_NAME]) 
    
cs_set_user_bpammo(idg_armas_prim[item][CSW_NAME], g_armas_prim[item][BPAMMO]) 
    
gMenu[id] = 1
    show_guns_sec
(id
    return 
PLUGIN_HANDLED
}
show_guns_sec(id) {
    if (
gSuper[id] || !is_user_alive(id)) return;
    new 
len[50], menu menu_create("Eliga su arma secundaria""handler_sec"
    for(new 
0sizeof g_armas_seci++) { 
        if(
gRango[id] >= g_armas_sec[i][RGN] ) menu_additem(menug_armas_sec[i][NAME], ""
        else { 
            
formatex(lencharsmax(len), "\r[ \yRango Requerido: \d%s \r]"rangos[g_armas_sec[i][RGN]][rangos_nombre] )
            
menu_additem(menulen"")
        }
    }
    
menu_display(idmenu0
}
public 
handler_sec(idmenuitem) {
    if(
item == MENU_EXIT) {  
        
menu_destroy(menu
        return 
PLUGIN_HANDLED
    }
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRango[id] < g_armas_sec[item][RGN]) { 
        
//tutorMake(id, TUTOR_GREEN, 4.0, "Bloqued Rango: %s", rangos[g_armas_sec[item][RGN]][rangos_nombre]) 
        
client_print(idprint_center"Bloqued Rango: %s"rangos[g_armas_sec[item][RGN]][rangos_nombre]) 
        
show_guns_sec(id
        return 
PLUGIN_HANDLED
    }
    
gSec[id] = item;
    
give_item(idg_armas_sec[item][WEAPON_NAME]) 
    
cs_set_user_bpammo(idg_armas_sec[item][CSW_NAME], g_armas_sec[item][BPAMMO]) 
    
gMenu[id] = 
    show_menu_granadas
(id)
    return 
PLUGIN_HANDLED
}
public 
menu_tienda(id) {
    if (
gSuper[id] || !is_user_alive(id)) return;
    new 
imenutext[100]
    
menu menu_create("\r Armas Especiales""handler_tienda")
    
    for(
0sizeof(ItemsTienda); i++) {
        if(
gRango[id] < ItemsTienda[i][REQ]) {
            
formatex(textcharsmax(text), "\d%s \r[ Rango %s ]"ItemsTienda[i][NK], rangos[ItemsTienda[i][REQ]][rangos_nombre])
            } else {
            
formatex(textcharsmax(text), "\w%s \y[ Rango %s ]"ItemsTienda[i][NK], rangos[ItemsTienda[i][REQ]][rangos_nombre] )
        }
        
menu_additem(menutext__menu_makecallback("tienda_callback"))
    }
    
menu_display(idmenu)
}
public 
tienda_callback(idmenuitem) {
    if(
gRango[id] < ItemsTienda[item][REQ])
        return 
ITEM_DISABLED;
    
    return 
ITEM_ENABLED;
}

public 
handler_tienda(idmenuitem) {
    if(
item == MENU_EXIT)
        return 
PLUGIN_HANDLED;
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    switch(
item) {
        case 
0:shop_Thanatos7(id)
            case 
1shop_janus(id)
            case 
2shop_ThanatosI(id)
            case 
3shop_Plasma(id)
        }
    
//tutorMake(id, TUTOR_GREEN, 4.0, "%s^1 Compraste:^4 %s.", TAG, ItemsTienda[item][NK])
    
ColorChat(id"%s^1 Compraste:^4 %s."TAGItemsTienda[item][NK])
    return 
PLUGIN_HANDLED;

public 
show_menu_granadas(id) {   
    if (
gSuper[id] || !is_user_alive(id)) return; 
    new 
menu menu_create("\wMenu de bombas""menu_bombas_handler"
    
    new 
num[3], len[1024]
    for (new 
0sizeof nadesi++) {
        
num_to_str(inum2)
        if(
gRango[id] >= nades[i][nivel] ) 
            
formatex(lensizeof len 1"\y [\w%s\y]" nades[i][nombre])
        else 
formatex(lensizeof len 1"\d [%s] \r[Rango: %s]" nades[i][nombre] , rangosnades[i][nivel]][rangos_nombre])
        
menu_additem(menulennum)
    }
    
    
menu_setprop(menuMPROP_BACKNAME"\yAtras"
    
menu_setprop(menuMPROP_NEXTNAME"\ySiguiente"
    
menu_setprop(menuMPROP_EXITNAME"\ySalir"
    
menu_display(idmenu0
}
public 
EventoM(){
    new 
attacker read_data(1
    new 
victim read_data(2)
    new 
kni get_user_weapon(attacker)
    
    if(
attacker == victim || !is_user_connected(attacker) || !is_user_connected(victim))
        return 
    if(
kni == CSW_KNIFE)  {
        
gFrag[attacker]+= g_happytime kGanancia[attacker
        
Funcvictim attacker )
    }
    
    
gFrag[attacker]+= g_happytime kGanancia[attacker
    
gDorados[attacker]+= g_happytime 1  kGanancia[attacker
    
    new 
random random_num(08)
    
    if (
random == || random == || random == 6)
    {
        new 
origin[3];
        
get_user_origin(victimorigin0);
        
addItem(origin);
    }
    
    
chequear_rango(attacker
    
    
    
set_task(get_pcvar_float(dm_revive), "RevivirJugador"victim)
}
public 
menu_bombas_handler(idmenuitem) {
    if(
item == MENU_EXIT || !is_user_connected(id)) { 
        
menu_destroy(menu
        return 
PLUGIN_HANDLED 
    

    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRango[id] < nades[item][nivel] ) {    
        
//ColorChat(id, "Para este pack tu rango debe ser:^x04 %s.", rangos[ nades[item][nivel]][rangos_nombre])
        
show_menu_granadas(id)
        return 
PLUGIN_HANDLED;
    }
    
    
give_item(id"weapon_hegrenade")
    
cs_set_user_bpammo(idCSW_HEGRENADEnades[item][cantidad1])
    
give_item(id"weapon_flashbang")
    
cs_set_user_bpammo(idCSW_FLASHBANGnades[item][cantidad2])
    
give_item(id"weapon_smokegrenade")
    
cs_set_user_bpammo(idCSW_SMOKEGRENADEnades[item][cantidad3])
    
    
menu_destroy(menu)
    
menu_tienda(id)
    return 
PLUGIN_CONTINUE;
}

public 
fw_PlayerSpawn_Postindex )
{
    if( !
IsBitg_conectadoindex ) )  
        return 
HAM_IGNORED;  
    
menuknifes(index)
    
    if (
gSuper[index])
    {
        
gSuper[index] = false
        kHasSpeed
[index] = false
        
    
}
    
    
//tutorMake(index, TUTOR_GREEN, 4.0, "Menu de Armas Abierto No lo Desperdicies")
    
ColorChat(index"MENU DE ARMAS ABIERTO ESCRIBE SAY /knife PARA ABRIR EL MENU.")
    
    
set_user_gravityindexget_user_gravityindex ) - gravedadg_habilidadindex ][ ] ) );  
    
set_user_health(indexget_user_health(index) + vidag_habilidadindex ][ ] ) + rangos[index][VIDA])
    
set_user_armor(indexget_user_armor(index) + chalecog_habilidadindex ][ ] ) + rangos[index][CHALECO])
    
    
    return 
HAM_IGNORED
}

public 
fw_Player_ResetMaxSpeedid ) {
    if(
is_user_connected(id))   
        
set_user_maxspeed(idget_user_maxspeedid ) + velocidadg_habilidadid ][ ] ) );
    
    
set_player_speed(id);
}

public 
client_putinserver(id) {
    
    
    
MarkBitg_conectadoid ); 
    
    
get_user_name(idg_playername[id], charsmax(g_playername[]));    
    
    
kHasSpeedid ] = false;
    
gSec[id] = false;
    
gPrim[id] = false
    
    get_user_name
(idg_cuenta[id], 31);
    
get_time("%c"g_Fecha[id], 31);
    
g_contra[id][0] = '^0';
    
g_Estado[id] = NOREGISTRADO;
        
    
g_Can[id] = 0;
    
    
    
Load_AdminTypes(id);
    
    
gRango[id] = gDorados[id] = gFrag[id] = 
    set_task
(1.0"ShowHUD"id+TASK_HUD__"b"
    
gSuper[id] = false
    
if (!is_user_alive(id)) {
        
//if (cs_get_user_team(id) != CS_TEAM_SPECTATOR) return;
        
set_task(get_pcvar_float(dm_revive), "Revive"id)
    }
    
        
    
Cargar(id); 
    

}
public 
fwd_Touch(touchertouched)
{
    if (!
is_user_alive(toucher) || !pev_valid(touched))
        return 
FMRES_IGNORED;
    
    new 
classname[32];
    
pev(touchedpev_classnameclassname31);
    
    if (!
equal(classnameitem_class_name))
        return 
FMRES_IGNORED;
    
    
    
    
give_box(toucher);
    
set_pev(touchedpev_effectsEF_NODRAW);
    
set_pev(touchedpev_solidSOLID_NOT);
    
    return 
FMRES_IGNORED;
}
public 
removeEntity(ent)
{
    if (
pev_valid(ent))
        
engfunc(EngFunc_RemoveEntityent)
}

public 
addItem(origin[3])
{
    static 
entent create_entity("info_target");
    
set_pev(entpev_classnameitem_class_name);
    
    
engfunc(EngFunc_SetModel,entg_model);
    
    
set_pev(ent,pev_mins,Float:{-10.0,-10.0,0.0});
    
set_pev(ent,pev_maxs,Float:{10.0,10.0,25.0});
    
set_pev(ent,pev_size,Float:{-10.0,-10.0,0.0,10.0,10.0,25.0});
    
engfunc(EngFunc_SetSize,ent,Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0});
    
    
set_pev(ent,pev_solid,SOLID_BBOX);
    
set_pev(ent,pev_movetype,MOVETYPE_FLY);
    
    new 
Float:fOrigin[3];
    
IVecFVec(originfOrigin);
    
set_pev(entpev_originfOrigin);
    
    
set_pev(ent,pev_renderfx,kRenderFxGlowShell);
    
    switch(
random_num(1,4))
    {
        case 
1set_pev(ent,pev_rendercolor,Float:{0.0,0.0,255.0});
        case 
2set_pev(ent,pev_rendercolor,Float:{0.0,255.0,0.0});
        case 
3set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0});
        case 
4set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0});
    }
}

public 
give_box(id)
{
    switch (
random_num(05))
    {
        case 
0:
        {
            if(!
user_has_weapon(idCSW_M249) )
            {
                
give_item(id"weapon_m249");
                
cs_set_user_bpammo(idCSW_M249999);
            }
            else
                
ColorChat(id"!gCAJA VACIA" );
        }
        case 
1set_user_armor(idget_user_armor(id) + 100 );
            case 
2set_user_health(idget_user_health(id) + 100 )
            case 
3:
        {
            if(!
user_has_weapon(idCSW_DEAGLE) )
            {
                
give_item(id"weapon_deagle");
                
cs_set_user_bpammo(idCSW_DEAGLE999);
            }
            else
                
ColorChat(id"!gCAJA VACIA");
        }
        case 
4:
        {
            
give_item(id"weapon_hegrenade");
            
cs_set_user_bpammo(idCSW_HEGRENADE5);
        }
        case 
5:
        {
            
give_item(id"weapon_hegrenade");
            
give_item(id"weapon_flashbang");
            
cs_set_user_bpammo(idCSW_HEGRENADE5);
            
cs_set_user_bpammo(idCSW_FLASHBANG5);
        }
    }
}

set_player_speed(index) {
    if(!
is_user_aliveindex ) ) return;
    
    if( 
kHasSpeedindex ] )
        
set_pev(indexpev_maxspeed500.0 );
    else
        
set_pev(indexpev_maxspeed245.0 );
    
}
public 
client_disconnect(id){
    
ClearBitg_conectadoid ); 
    
Guardar(id);
    
remove_task(id+TASK_HUD)
    if (
gSuper[id] && gMod){
        
llamar_funcion_boludo()
    }
    
}

public 
chequear_rango(id){
    new 
gR false
    
while(gFrag[id] >= rangos[gRango[id]][nivel_requerido] && gRango[id] < rangos_maximos){
        
gRango[id]++
        
gDorados[id]+= 10
        gFrag
[id] = 
        gR 
=true
        subirrango
(id)
    }
    if(
gR) {
        
client_print(idprint_chat"Felicitaciones has ascendido al rango: %s"rangos[gRango[id]][rangos_nombre]); 
        
//tutorMake(id, TUTOR_GREEN, 4.0, "Felicitaciones has ascendido al rango: %s", rangos[gRango[id]][rangos_nombre]); 
        
gR false
    
}
    



public 
ShowHUD(taskid){
    static 
id;id HUD_ID
    
    
if(!is_user_alive(id))
        return;
    
    
set_hudmessage(25525500.020.1506.012.0)
    
ShowSyncHudMsg(idgHud"[DeathMatch + Rango]^n[Rango: %s]^n[Frags: %d]^n[Puntos: %d]^n[Happy Hour: %s]^n[Con mas score: %s]"
    
rangos[gRango[id]][rangos_nombre], gFrag[id], gDorados[id], g_happytime "Activada" "Desactivada"g_player_proname)


 

public 
show_menu_puntosid )  
{     
    new 
iLen250 ]; 
    
    new 
hadle_puntos menu_create("\y=============================^n\w    Sistema de habilidades \y=============================^n""hadle_puntos")  
    
    for( new 
0sizeof g_mejora_datai++ )  
    {  
        if( 
g_habilidadid ][ ] <= g_mejora_data][ MEJORA_MAX ] )  
        {  
            if( 
gDoradosid ] >= g_mejora_data][ MEJORA_COSTO ] )  
                
formatexiLen charsmaxiLen ) , "\wAumentar : %s [%d / %d] \y[ Costo : %d P]"g_mejora_data[i][MEJORA_NAME],g_habilidadid ][ ], g_mejora_data][ MEJORA_MAX ], g_mejora_data][ MEJORA_COSTO ] );   
            else  
                
formatexiLen charsmaxiLen ) , "\dAumentar : %s [%d / %d] \r[P.Necesarios : %d]"g_mejora_data][ MEJORA_NAME ], g_habilidadid ][ ], g_mejora_data][ MEJORA_MAX ], g_mejora_data][ MEJORA_COSTO ] );  
            
            if(
g_habilidadid ][ ] >= g_mejora_data][ MEJORA_MAX ] )  
                
formatexiLen charsmaxiLen ) , "\d[%d] %s [%d / %d] \r[COMPLETADO]"i+1g_mejora_data][ MEJORA_NAME ], g_habilidadid ][ ], g_mejora_data][ MEJORA_MAX ] );             
        }  
        
        
menu_additemhadle_puntos iLen );  
    }  
    
    
menu_setprophadle_puntos MPROP_EXITNAME,"\ySalir" );  
    
menu_displayidhadle_puntos );      
    
    return 
PLUGIN_HANDLED;  
}  

public 
hadle_puntos(id menuitem)  
{   
    
menu_destroy(menu);  
    
    if (
item == MENU_EXIT)      
        return  
    
    if(
gDoradosid ] < g_mejora_dataitem ][ MEJORA_COSTO ] )  
    {  
        
ColorChat(id"^x04%s^x01 Nesecitas^x03 %d^x01 puntos para mejorar^x03 %s^x01."TAGg_mejora_dataitem ][ MEJORA_COSTO ], g_mejora_dataitem ][ MEJORA_NAME ] );  
        
client_cmdid"spk buttons/button10.wav" );  
        return; 
    }  
    
    if(
g_habilidadid ][ item ] >= g_mejora_dataitem ][ MEJORA_MAX ] )  
    {  
        
ColorChat(id"^x04%s^x01 Subistes el maximo de puntos para la mejora:^x03 %s^x01."TAGg_mejora_dataitem ][ MEJORA_NAME ] );  
        
client_cmdid"spk buttons/button10.wav" );  
        return;  
    }  
    
    
gDoradosid ] -= g_mejora_dataitem ][ MEJORA_COSTO ];  
    
g_habilidadid ][ item ]++;   
    
ColorChat(id"^x04%s^x01 Subistes la mejora:^x03 %s^x01 ahora tenes^x03 %d^x01 /^x03 %d^x01 completada de ella. "TAGg_mejora_dataitem ][ MEJORA_NAME ], g_habilidadid ][ item ], g_mejora_dataitem ][ MEJORA_MAX ] );  
    
show_menu_puntosid );  
}  
public 
happyhour(id)
{
    new 
data[12]
    
get_time("%H"data12)
    new 
Tiempo str_to_num(data)
    
    for(new 
i=0;<= sizeof horas 1;i++)
    {
        if(
Tiempo != horas[i]) continue
        
g_happytime true
        
break;
    }
    if(
g_happytime)
    {
        
ColorChat(0"^x04[%s]^x01 Estas en^x04 Happy Hour^x01 disfruta mientas ganas el^x04 Doble^x01 de Frags"TAG)
    }

Funcid id2 ){
    static 
name][ 32 ], origin];
    
get_user_nameid name[0], 31 );
    
get_user_nameid2 name[1], 31 );
    
get_user_origin(idorigin3)
    
    
set_hudmessage204 204 0.0 0.55 4.0 4.0 );
    
ShowSyncHudMsgkSync"%s^nHA FILETIADO a:^n%s^nOOOOHH!! Turn Down For What!!!" name], name] );    
    
    
//client_cmd( 0, "MP3Volume 0.8" );
    
client_cmd"mp3 play ^"%s^""TDFW );
    
    
// Screen Shake
    
message_begin(MSG_ONEget_user_msgid("ScreenShake"), {0,0,0}, id);
    
write_short(1<<14);
    
write_short(1<<14);
    
write_short(1<<14);
    
message_end();
    
    
// Implosion ( Particulas hacia dentro )
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin);
    
write_byte(TE_IMPLOSION);
    
write_coord(origin[0]);
    
write_coord(origin[1]);
    
write_coord(origin[2]);
    
write_byte(128);
    
write_byte(20);
    
write_byte(3);
    
message_end();
    
    
// LavaSplash ( Particulas hacia fuera )
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin);
    
write_byte(TE_LAVASPLASH);
    
write_coord(origin[0]);
    
write_coord(origin[1]);
    
write_coord(origin[2]);
    
message_end();
    
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+50.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+100.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+150.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+250.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+350.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();

subirrango(id)  { 
    new 
vec1[3], vec2[3
    
get_user_origin(idvec2
    
    
vec2[2] -= 26 
    vec1
[0] = vec2[0
    
vec1[1] = vec2[1
    
vec1[2] = vec2[2] + 400 
    
    
// Rayo
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY
    
write_byte
    
write_coord(vec1[0]) 
    
write_coord(vec1[1]+30
    
write_coord(vec1[2]) 
    
write_coord(vec2[0]) 
    
write_coord(vec2[1]+30
    
write_coord(vec2[2]) 
    
write_short(g_levelupp// sprite que utilizaremos
    
write_byte(1// startframe
    
write_byte(5// flamerate
    
write_byte(2// life
    
write_byte(20// width
    
write_byte(30// noise
    
write_byte(255// colo rojo
    
write_byte(255// colo verde // si lo dejamos haci da color amarillo en el rayo, modifiquese a su gusto
    
write_byte(0// rolor azul
    
write_byte(200// brillo del rayo
    
write_byte(100// Rapidéz del rayo al caer
    
message_end()
    
    
// Thunder 2
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY
    
write_byte
    
write_coord(vec1[0]) 
    
write_coord(vec1[1]+30
    
write_coord(vec1[2]) 
    
write_coord(vec2[0]) 
    
write_coord(vec2[1]+30
    
write_coord(vec2[2]) 
    
write_short(g_levelupp1// sprite que utilizaremos
    
write_byte(1// startframe
    
write_byte(5// flamerate
    
write_byte(2// life
    
write_byte(20// width
    
write_byte(30// noise
    
write_byte(255// color rojo
    
write_byte(255//  color verde
    
write_byte(0// Icolor azul
    
write_byte(200// brillo del rayo
    
write_byte(100// Rapidéz del rayo al caer
    
message_end()

public 
message_statusicon(msg_idmsg_destid)
{
    static 
szIcon[8]
    
get_msg_arg_string(2szIconcharsmax(szIcon))
    
    if (
equal(szIcon"buyzone") && get_msg_arg_int(1))
    {
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0))
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;



Load_AdminTypes(id){
    if(
is_user_admin(id)) // Si es admin
    
{
        new 
iflags get_user_flags(id);
        
        for(
sizeof Ganancias i++ ) 
        {
            if(
flags Ganancias[i][GD_ADM_FLAG]) // Si las flags del player es igual a las que definimos arriba
            

                
// cambian "has_happyhour" por su variable de happyhour
                
if(g_happytime// Si esta la Happy Hour activa
                    
kGanancia[id] = Ganancias[i][GD_ADM_GHH]; // le damos la ganancia del admin en HH;
                
else // Si no esta activa la Happy Hour
                    
kGanancia[id] = Ganancias[i][GD_ADM_GN]; // Le damos la ganancia Normal
                
                
formatex(kAccountType[id], charsmax(kAccountType), "%s"Ganancias[i][GD_ADM_TYPE]); // Le damos formato a 'kAccountType'
                
                
                
break; // Salimos del Loopeo
            
}
        }
    }
    else 
// Si no es admin
    
{
        if(
g_happytime// Si es HappyHour
            
kGanancia[id] = 2// Le damos Ganancia por 2 a los users normales
        
else // Si no es Happy Hour
            
kGanancia[id] = 1// Ganancia por 1 (que seria lo normal)
        
        
formatex(kAccountType[id], charsmax(kAccountType), "Usuario Normal"); // Le damos formato a 'kAccountType'
    
}

public 
Revive(id) {
    if (
cs_get_user_team(id) != CS_TEAM_SPECTATOR)
            {
              
                return 
PLUGIN_HANDLED;
            }
    
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
ColorChat(id"%s Acabas de revivir."TAG)
    
    return 
PLUGIN_HANDLED;
}
public 
RevivirJugador(id) {
    
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
ColorChat(id"%s Acabas de revivir."TAG)
    
    
set_user_godmode(id1)
    
client_print(idprint_center"%s Obtienes proteccion por^4 %d segundos^1."TAGget_pcvar_num(dm_proteccion))
    
    if (
cs_get_user_team(id) == CS_TEAM_CT)
        
set_rendering(idkRenderFxGlowShell00255kRenderNormal50)
    if (
cs_get_user_team(id) == CS_TEAM_T)
        
set_rendering(idkRenderFxGlowShell25500kRenderNormal50)
    
    
set_task(get_pcvar_float(dm_proteccion), "RemoverProteccion"id)
    return 
PLUGIN_HANDLED;
}

public 
RemoverProteccion(id) {
    
set_user_godmode(id0)
    
set_rendering(id)
    
client_print(idprint_center"%s Se te acabaron los^4 %d segundos^1 de proteccion."TAGget_pcvar_num(dm_proteccion))
}

stock get_weapon_ent_owner(ent){
    if (
pev_valid(ent) != 2)
        return -
1;
    
    return 
get_pdata_cbase(ent414);
}



stock ColorChat(id, const input[], any:...)
{
    static 
szMsg[191], msgSayText;
    
    if (!
msgSayText)
        
msgSayText get_user_msgid("SayText");
    
    
replace_all(szMsg190"!g""^4");
    
replace_all(szMsg190"!y""^1");
    
replace_all(szMsg190"!team""^3");
    
    
vformat(szMsg190input3);
    
    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id);
    
write_byte(id id 33);
    
write_string(szMsg);
    
message_end();


public 
ShowLogMenu(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit), "\y[\rD\y]eathMatch + Rango ^n\wBienvenido \r%s^n\wESTADO: \r%s^n\wTu ultima visita fue: \r%s"g_cuenta[id], Estado[g_Estado[id]], g_Fecha[id]);
    
    new 
menu menu_create(Tit,"menu_log");
    
    
menu_additem(menu, (g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Loguearse":"\dLoguearse""1");
    
menu_additem(menu, (g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Registrarse^n":"\dRegistrarse^n""2");
    
menu_additem(menu, (g_Estado[id] == LOGUEADO && !g_Can[id])?"Cambiar Contra":"\dCambiar Contra""3");
    
    
menu_display(idmenu0);
}
public 
menu_log(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item) {
        case 
0: {
            if(
g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa tu PASSWORD para entrar a tu cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
                } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }
        }
        case 
1: {
            if(
g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa una PASSWORD para crear una cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
                } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }    
        }
        case 
2: {
            if(
g_Estado[id] == LOGUEADO && !g_Can[id]) {
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
                } else {
                
client_print(idprint_center"No estas logueado o ya cambiaste tu password durante el mapa");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
Confirmar(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit),"La password sera \r%s^n^n\yConfirmar?"g_contra2[id]);
    
    new 
menu menu_create(Tit,"menu_confirmar");
    
    
menu_additem(menu,"\rSi\w, confirmar","1");
    
menu_additem(menu,"\rNo\w, deseo reescribirla","2");
    
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER);
    
    
menu_display(idmenu0);
}
public 
menu_confirmar(idmenuitem) {
    switch(
item) {
        case 
0: {
            switch(
g_Estado[id]) {
                case 
LOGUEADO: {
                    
copy(g_contra[id], 19 ,g_contra2[id]);
                    
Guardar(id);
                    
client_print(idprint_center"Tu password ha sido cambiada satisfactoriamente");
                    
g_Can[id] = 1;
                }
                case 
NOREGISTRADO: {    
                    
client_print(idprint_center"Tu cuenta ha sido creada satisfactoriamente");
                    
copy(g_contra[id], 31g_contra2[id]);
                    
Guardar(id);
                    
jTeam(id);
                }
            }
        }
        case 
1: {
            
menu_destroy(menu);
            
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            if(
g_Estado[id] == LOGUEADO)
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
            else
                
client_print(idprint_center"Ingresa la PASSWORD para tu nueva cuenta");
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
Guardar(id) {
    if(!
is_user_connected(id)) return;
    
    
adv_vault_set_start(g_vault);
    
adv_vault_set_field(g_vaultg_campo[PTS], gFrag[id])
    
adv_vault_set_field(g_vaultg_campo[RAN], gRango[id])
    
adv_vault_set_field(g_vaultg_campo[DOR], gDorados[id])
    
adv_vault_set_field(g_vaultg_campo[HAB], g_habilidad[id])    
    
adv_vault_set_field(g_vaultg_campo[FECHA], g_Fecha[id]);
    
adv_vault_set_field(g_vaultg_campo[PASSWORD], g_contra[id]);
    
adv_vault_set_end(g_vault0g_cuenta[id]);
}
public 
Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_cuenta[id])) {
        
g_Estado[id] = NOREGISTRADO;
        return;
        } else {
        
g_Estado[id] = REGISTRADO;
        
        
gFrag[id] = adv_vault_get_field(g_vaultg_campo[PTS])
        
gRango[id] = adv_vault_get_field(g_vaultg_campo[RAN])
        
gDorados[id] = adv_vault_get_field(g_vaultg_campo[DOR])
        
adv_vault_set_field(g_vaultg_campo[HAB], g_habilidad[id][0], sizeof g_habilidad[][])
        
adv_vault_get_field(g_vaultg_campo[FECHA], g_Fecha[id], charsmax(g_Fecha[]));
        
adv_vault_get_field(g_vaultg_campo[PASSWORD], g_contra[id], charsmax(g_contra[]));
    }
    
}
public 
Contra(id) {
    
read_args(g_contra[id], charsmax(g_contra));
    
remove_quotes(g_contra[id]);trim(g_contra[id]);
    
    if(
equal(g_contra[id],"") || containi(g_contra[id]," ") != -) {
        
client_print(idprint_center"Tu password contiene errores");
        return 
1;
    }
    
    switch(
g_Estado[id]) {
        case 
NOREGISTRADO: {
            
client_print(idprint_center"Confirma tu password para proseguir");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
        case 
REGISTRADO: {
            new 
buffer[40];
            
adv_vault_get_prepare(g_vault_g_cuenta[id]);
            
adv_vault_get_field(g_vaultg_campo[PASSWORD], buffercharsmax(buffer));
            
            if(
equal(bufferg_contra[id])) {
                
Guardar(id);
                
client_print(idprint_center"Te logueaste satisfactoriamente en tu cuenta");
                
jTeam(id);
                } else {
                
ShowLogMenu(id);
                
client_print(idprint_center"Password Incorrecta.");
            }
        }
        case 
LOGUEADO: {
            if(
g_Can[id]) {
                
client_print(idprint_center"Ya cambiaste tu contra en este mapa");
                return 
PLUGIN_HANDLED;
            }
            
client_print(idprint_center"Confirma tu password para cambiarla...");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
message_VGUImenu(msgiddestid) {
    if(
g_Estado[id] != LOGUEADO)
        
ShowLogMenu(id);
    
    return 
1;
}
public 
jTeam(id){
    static 
teammsg_blockteammsg_block_vguirestorevgui;
    
    
restore get_pdata_int(id510);
    
vgui restore & (1<<0);
    
    if (
vgui)
        
set_pdata_int(id510restore & ~(1<<0));
    
    
teammsg_block get_msg_block(g_MsgShowMenu);
    
teammsg_block_vgui get_msg_block(g_MsgVgui);
    
    
set_msg_block(g_MsgShowMenuBLOCK_ONCE);
    
set_msg_block(g_MsgVguiBLOCK_ONCE);
    
    
engclient_cmd(id"jointeam""5");
    
engclient_cmd(id"joinclass""5");
    
    
set_msg_block(g_MsgShowMenuteammsg_block);
    
set_msg_block(g_MsgVguiteammsg_block_vgui);
    
    if (
vgui
        
set_pdata_int(id510restore);
    
    
g_Estado[id] = LOGUEADO;

public 
llamar_funcion_boludo()
{
    static 
players[32], iPlayerName[32], countiget_players(playerscount"a")
    
    if (
count)
    {
        
iPlayer players[random(count)]
        
get_user_name(iPlayerNamecharsmax(Name))
        
        
gSuper[iPlayer] = true
        
        set_hudmessage
(25500, -1.0, -1.006.012.0)
        
ShowSyncHudMsg(0g_hud_boludo"El Jugador %s es Un Sniper^nSu equipo tiene que protegerlo..."Name)
        
        
strip_user_weapons(iPlayer)
        
        
give_item(iPlayer"weapon_knife")
        
dar_vida(iPlayer)
        
        for (
1<= g_maxplayersi++)
        {
            if (!
gSuper[i])    continue;
            
            
strip_user_weapons(i)
            
kHasSpeed[iPlayer] = true
            give_item
(iPlayer"weapon_knife")
            
give_item(iPlayer"weapon_awp")
        }
    }
}

public 
dar_vida(id)
{
    if ( 
get_playersnum() >= 10set_user_health(id10000)
    
    else if ( 
get_playersnum() <= 10set_user_health(id5000)
}

public 
concmd_RockFinal(idlevelcid)
{
    if(!
cmd_access(idADMIN_LEVEL_Acid1))
        return 
PLUGIN_HANDLED;
    
    if(
g_unique)
    {
        
console_print(id"Solo se puede usar este comando una vez por mapa!");
        return 
PLUGIN_HANDLED;
    }
    
    
g_unique 1
    
    g_count 
10;
    
set_task(2.0"fn_Vale");
    
    new 
i;
    for(
1<= g_maxplayers; ++i)
    {
        if(!
is_user_connected(i))
            continue;
        
        
cs_set_user_money(i0);
        
        if(!
is_user_alive(i))
            continue;
        
        
strip_user_weapons(i);
    }
    
    return 
PLUGIN_HANDLED;
}

public 
fn_Vale()
{
    new 
sMsg[64];
    
    if(
g_count 5)
        
formatex(sMsgcharsmax(sMsg), "El juego comienza en %d segundos"g_count);
    else
    {
        new 
sSound[64];
        
        switch(
g_count)
        {
            case 
5:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_five.wav");
                
                new 
i;
                for(
1<= g_maxplayers; ++i)
                {
                    if(!
is_user_connected(i))
                        continue;
                    
                    
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
                    
write_short(UNIT_SECOND 14);
                    
write_short(UNIT_SECOND 9);
                    
write_short(UNIT_SECOND 14);
                    
message_end();
                }
                
                for(
1<= g_maxplayers; ++i)
                {
                    if(!
is_user_connected(i))
                        continue;
                    
                    
ClearSyncHud(ig_message_hud);
                }
                
                
set_lights("i");
            }
            case 
4:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_four.wav");
                
set_lights("g");
            }
            case 
3:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_three.wav");
                
set_lights("e");
            }
            case 
2:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_two.wav");
                
set_lights("c");
            }
            case 
1:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_one.wav");
                
set_lights("a");
            }
            case 
0:
            {    
                
g_count 1;
                
                
set_task(3.0"fn_PlayMusic");
                
                return;
            }
        }
        
        
client_cmd(0"spk ^"%s^""sSound);
        
        
set_dhudmessage(2552550, -1.00.300.00.30.30.3);
        
show_dhudmessage(0"%d"g_count);
    }
    
    if(
g_count 5)
    {
        
set_hudmessage(2552550, -1.00.300.03.02.01.0, -1);
        
ShowSyncHudMsg(0g_message_hud"%s"sMsg);
    }
    
    --
g_count;
    
    
set_task(1.0"fn_Vale");
}

public 
fn_PlayMusic()
{
    if(
g_count == 5)
    {
        ++
g_count;
        
        
set_task(0.3"fn_PlayMusic");
        
        return;
    }
    
    new 
sSound[64];
    
    switch(
g_count)
    {
        case 
1formatex(sSoundcharsmax(sSound), "t_2c2/tcs_one.wav");
        case 
2formatex(sSoundcharsmax(sSound), "t_2c2/tcs_two.wav");
        case 
3formatex(sSoundcharsmax(sSound), "t_2c2/tcs_three.wav");
        case 
4formatex(sSoundcharsmax(sSound), "t_2c2/tcs_four.wav");
        case 
6:
        {
            
client_cmd(0"MP3Volume 2.0");
            
client_cmd(0"mp3 play ^"sound/t_2c2/px2.mp3^"");
            
            new 
i;
            for(
1<= g_maxplayers; ++i)
            {
                if(!
is_user_connected(i))
                    continue;
                
                
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
                
write_short(UNIT_SECOND 28);
                
write_short(UNIT_SECOND 18);
                
write_short(UNIT_SECOND 28);
                
message_end();
            }
            
            
g_count 1;
            
g_count_final 1;
            
            
set_task(0.1"fn_ChangeRender");
            
set_task(5.0"fn_ChangeNumber");
            
set_task(15.0"fn_ChangeScreens");
            
set_task(30.1"fn_Finish");
            
            return;
        }
    }
    
    
client_cmd(0"spk ^"%s^""sSound);
    
    ++
g_count;
    
    
set_task(0.3"fn_PlayMusic");
}

public 
fn_ChangeRender()
{
    if(
g_count == 60 || g_finish)
        return;

    static 
i;
    static 
Float:vecOrigin[3];
    
    for(
1<= g_maxplayers; ++i)
    {
        if((
g_count 2) == 0)
        {
            if(!
is_user_connected(i))
                continue;
            
            
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
            
write_short(UNIT_SECOND 9);
            
write_short(UNIT_SECOND 6);
            
write_short(UNIT_SECOND 9);
            
message_end();
            
            if(!
is_user_alive(i))
                continue;
            
            
entity_get_vector(iEV_VEC_originvecOrigin);
            
            
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvecOrigin0);
            
write_byte(TE_DLIGHT);
            
engfunc(EngFunc_WriteCoordvecOrigin[0]);
            
engfunc(EngFunc_WriteCoordvecOrigin[1]);
            
engfunc(EngFunc_WriteCoordvecOrigin[2]);
            
write_byte(40);
            
write_byte(random_num(50250));
            
write_byte(random_num(50250));
            
write_byte(random_num(50250));
            
write_byte(50);
            
write_byte(10);
            
message_end();
        }
        
        if(!
is_user_alive(i))
            continue;
        
        
set_user_rendering(ikRenderFxGlowShellrandom_num(150250), random_num(150250), random_num(150250), kRenderNormal25);
    }
    
    ++
g_count;
    
    
set_task(0.5"fn_ChangeRender");
}

public 
fn_ChangeScreens()
{
    if(
g_count_screens == 75 || g_finish)
        return;
    
    static 
i;
    if((
g_count_screens 15) == 0)
    {
        for(
1<= g_maxplayers; ++i)
        {
            if(!
is_user_connected(i))
                continue;
            
            
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
            
write_short(UNIT_SECOND 28);
            
write_short(UNIT_SECOND 18);
            
write_short(UNIT_SECOND 28);
            
message_end();
        }
    }
    
    for(
1<= g_maxplayers; ++i)
    {
        if(!
is_user_connected(i))
            continue;
        
        
message_begin(MSG_ONE_UNRELIABLEg_message_screenfade_i)
        
write_short(UNIT_SECOND*4);
        
write_short(UNIT_SECOND*4);
        
write_short(0x0000);
        
write_byte(random_num(100250));
        
write_byte(random_num(100250));
        
write_byte(random_num(100250));
        
write_byte(200);
        
message_end();
    }
    
    ++
g_count_screens;
    
    
set_task(0.2"fn_ChangeScreens");
}

public 
fn_Finish()
{
    
g_finish 1;
    
    
client_cmd(0"mp3 stop; stopsound");
    
    
client_cmd(0"spk weapons/c4_explode1.wav");
    
client_cmd(0"spk weapons/c4_explode1.wav");
    
    
set_lights("");
    
    new 
i;
    for(
1<= g_maxplayers; ++i)
    {
        if(!
is_user_connected(i))
            continue;
        
        
message_begin(MSG_ONE_UNRELIABLEg_message_screenfade_i)
        
write_short(UNIT_SECOND*4);
        
write_short(UNIT_SECOND*4);
        
write_short(0x0000);
        
write_byte(255);
        
write_byte(255);
        
write_byte(25);
        
write_byte(255);
        
message_end();
        
        
set_user_rendering(i);
    }
    
    
set_task(0.3"fn_R");
    
set_task(2.0"fn_Restart3");
}

public 
fn_R()
    
server_cmd("sv_restart 1")

public 
fn_Restart3()
{
    
client_print(0print_chat"Inviat mas GENTE!");
}

public 
fn_ChangeNumber()
{
    if(
g_count_final == 6)
        return;
    
    new 
sSound[64];
    
    switch(
g_count_final)
    {
        case 
1formatex(sSoundcharsmax(sSound), "t_2c2/tcs_five.wav");
        case 
2formatex(sSoundcharsmax(sSound), "t_2c2/tcs_four.wav");
        case 
3formatex(sSoundcharsmax(sSound), "t_2c2/tcs_three.wav");
        case 
4formatex(sSoundcharsmax(sSound), "t_2c2/tcs_two.wav");
        case 
5formatex(sSoundcharsmax(sSound), "t_2c2/tcs_one.wav");
    }
    
    
client_cmd(0"spk ^"%s^""sSound);
    
    ++
g_count_final;
    
    
set_task(5.0"fn_ChangeNumber");
}

public 
clcmd_say(id)
{
    static 
said[191
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said)
    
replace_all(saidcharsmax(said), "%"" ")
    
    if (!
ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], prefix[91]
    
get_user_team(idcolorcharsmax(color))
    
    
formatex(prefixcharsmax(prefix), "%s [^x04%s^x01] %s^x03  %s"is_user_alive(id) ? "^x01" "^x01*MUERTO* "kAccountType[id], rangos[gRango[id]][rangos_nombre], g_playername[id])
    
    if (
is_user_admin(id)) format(saidcharsmax(said), "^x04%s"said)
    
    
format(saidcharsmax(said), "%s^x01 :  %s"prefixsaid)
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) 
    {
        if (!
is_user_connected(i)) continue;
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(id) || !is_user_alive(id) && !is_user_alive(id))
        {
            
            
get_user_team(iteamcharsmax(team))
            
            
changeTeamInfo(icolor)
            
            
writeMessage(isaid)
            
            
changeTeamInfo(iteam)
        }
    }
    
    return 
PLUGIN_HANDLED_MAIN;
}

public 
changeTeamInfo(playerteam[]){
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}

public 
writeMessage(playermessage[]){
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end()
}


stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    
    return 
false;

public 
make_tracer(victimattackerFloat:damageFloat:direction[3], tracehandledamage_type)
{
    
    new 
weapon get_user_weapon(attacker)
    new 
Float:vecEndPos[3
    
get_tr2(tracehandleTR_vecEndPosvecEndPos
    
    if(
weapon == g_armas_prim[gPrim[attacker]][CSW_NAME]) 
    {
        
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvecEndPos0
        
write_byte(TE_BEAMENTPOINT
        
write_short(attacker 0x1000
        
engfunc(EngFunc_WriteCoordvecEndPos[0]) // x 
        
engfunc(EngFunc_WriteCoordvecEndPos[1]) // x 
        
engfunc(EngFunc_WriteCoordvecEndPos[2]) // x 
        
write_short(m_spriteTexture
        
write_byte(0// framerate 
        
write_byte(0// framerate 
        
write_byte(1// framerate 
        
write_byte(50// framerate 
        
write_byte(0// framerate 
        
write_byte(g_armas_prim[gPrim[attacker]][rrr])
        
write_byte(g_armas_prim[gPrim[attacker]][vvv])
        
write_byte(g_armas_prim[gPrim[attacker]][aaa])
        
write_byte(128// brightness 
        
write_byte(0// brightness 
        
message_end() 
    }
    if(
weapon == g_armas_sec[gSec[attacker]][CSW_NAME]) 
    {
        
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvecEndPos0
        
write_byte(TE_BEAMENTPOINT
        
write_short(attacker 0x1000
        
engfunc(EngFunc_WriteCoordvecEndPos[0]) // x 
        
engfunc(EngFunc_WriteCoordvecEndPos[1]) // x 
        
engfunc(EngFunc_WriteCoordvecEndPos[2]) // x 
        
write_short(m_spriteTexture
        
write_byte(0// framerate 
        
write_byte(0// framerate 
        
write_byte(1// framerate 
        
write_byte(50// framerate 
        
write_byte(0// framerate 
        
write_byte(g_armas_sec[gSec[attacker]][rrr])
        
write_byte(g_armas_sec[gSec[attacker]][vvv])
        
write_byte(g_armas_sec[gSec[attacker]][aaa])
        
write_byte(128// brightness 
        
write_byte(0// brightness 
        
message_end() 
    }
    return 
HAM_HANDLED


public 
reload_playerpro() {
    new 
sort[33][2], count
    
for(new id 1id <= g_maxplayersid++) {
        if(
is_user_connected(id)) {
            
sort[count][0] = id
            sort
[count][1] = get_user_frags(id)
            
count++
        }
    }
    
SortCustom2D(sortcount"sort_player_frags")
    
get_user_name(sort[0][0], g_player_pronamecharsmax(g_player_proname))
}
public 
sort_player_frags(pl1[], pl2[]) {
    if(
pl1[1] > pl2[1]) 
        return -
1;
    
    else if(
pl1[1] < pl2[1]) 
        return 
1;
    
    return 
0;

Responder
#2
Prueba y dime...

Código PHP:
#include amxmodx
#include hamsandwich
#include fakemeta
#include cstrike
#include engine
#include fun
#include amxmisc
#include adv_vault
#include dhudmessage
#include screenfade_util

native shop_Thanatos7(index)
native shop_janus(index)
native shop_ThanatosI(index)
native shop_Plasma(index)
    
#define HUD_ID (taskid-TASK_HUD) 
#define TASK_HUD 12312
#define TAG "[ AMXX ]"

#define MarkBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )  
#define ClearBit(%1,%2) ( %1 &= ~ ( 1 << ( %2 & 31 ) ) )  
#define IsBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )  

#define rangos_maximos 26

#define vida(%1)        (%1 * 15)   
#define chaleco(%1)     (%1 * 10)   
#define velocidad(%1)   (%1 * 0.1)  
#define gravedad(%1)    (%1 * 0.1) 

/*===============================Hecho Por; Amxmodx ===============================*/

new const INF_PLUGIN[][] = { "Rangos""1,1""GeX~" }

/*===============================================================================?==*/

new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame  

new const TDFW[] = "sound/td_for_what.mp3";

new 
gFrag[33], gRango33 ], Elegido33 ], gMenu[33], gDorados[33], gPrim[33], gSec[33], g_habilidad[33][ ], 
kGanancia[33], kAccountType[33][20], kHasSpeed33 ], g_player_proname[32], g_playername[33][32];

const 
UNIT_SECOND = (<< 12);

new 
g_message_hudg_uniqueg_countg_count_screensg_count_finalg_finishg_message_screenshake;
new 
g_message_screenfadeg_msgTeamInfog_msgSayTextg_conectadogHudg_maxplayersg_leveluppg_levelupp1kSynccylinderspr
dm_revivedm_proteccionm_spriteTextureg_MsgTutorg_MsgTutClose
new gSuper[33], gModgRondasg_hud_boludoboludocvar_ronda


new gBuyCommands[][] = {
    
"usp""glock""deagle""p228""elites""fn57""m3""xm1014""mp5""tmp""p90""mac10""ump45""ak47",
    
"galil""famas""sg552""m4a1""aug""scout""awp""g3sg1""sg550""m249""vest""vesthelm""flash""hegren",
    
"autoshotgun""smg""mp""c90""cv47""defender""clarion""krieg552""bullpup""magnum""d3au1""krieg550",
    
"buyammo1""buyammo2"
}
new const 
horas[] = { 0001020304050607, 08 ,09, 10 
new 
boolg_happytime

enum _
:rango rangos_nombre[64], nivel_requeridoVIDACHALECO }
enum _:DATA_K K_NOMBRE32 ], VMDL30 ], PMDL30 ], NECESARIO }
enum _:DATA_TIENDA NK[20], REQ }
enum armas_caracteristicas NAME[20], CSW_NAMEWEAPON_NAME[20], BPAMMORGNmodel_1[70], model_2[70], rrrvvvaaa}
enum _:menu_nades nombre[33], cantidad1cantidad2cantidad3nivel }
enum _:DATA_MEJORA  MEJORA_NAME10 ],   MEJORA_COSTO,  MEJORA_MAX  };  
enum _GANANCIA_DATA GD_ADM_TYPE[20], GD_ADM_MDL[20], GD_ADM_FLAGGD_ADM_GNGD_ADM_GHH }
/*==GUARDADO==*/
new g_contra[33][20], g_contra2[33][20], g_cuenta[33][32];

new 
g_vault,g_MsgVguig_MsgShowMenu;
new 
g_Estado[33], g_Can[33], g_Fecha[33][32];

enum PTSRANDORHABFECHAPASSWORDDATA_M };
enum NOREGISTRADO 0REGISTRADOLOGUEADOESTADOS };
new const 
Estado[ESTADOS][] = { "Sin Registrar""Registrado""Logueado" };
new 
g_campo[DATA_M]; 
/*====*/

new const Ganancias[][GANANCIA_DATA] = {
    
//|    TIPO DE ADM     |     FLAGS    | GANANCIA NORMAL | GANANCIA EN HH
    
"Vip""Vip",         ADMIN_LEVEL_F,         2,         3     },
    { 
"Admin Golden""Goku",         ADMIN_LEVEL_G,         3,         4     },
    { 
"Admin Root""Banana",     ADMIN_LEVEL_H,         5,         6     }


new const 
rangos[rangos_maximos][rango] = {
    
// clase        rango    vida     chaleco 
    
{"Explorador ",     0,    100,     10 },
    {
"Recluta ",        10,    100,     15 },
    {
"Cabo",        55,    100,     20 },            
    {
"Cabo Mayor",        70,    100,     25 },
    {
"Sargento",        100,    100,     30 },        
    {
"Capitan",        200,    150,     35 },
    {
"Teniente",        300,    150,     40 },         
    {
"Coronel",        400,    150,     45 },
    {
"Comandante",        500,    150,     50 },        
    {
"General",        600,    200,     55 },
    {
"Asesino",        650,    200,     60 },         
    {
"Criminal",        700,    200,     65 },
    {
"Experto",        750,    200,     70 },        
    {
"Espia",        770,    250,     75 },
    {
"Super Experto",    790,    250,     80 },    
    {
"Marine",        800,    250,     85 },
    {
"Sobreviviente",    810,    300,     90 },    
    {
"Nazi",         820,    300,     95 },
    {
"Exterminador",     830,    300,     100 },        
    {
"Destripador",     850,    300,     110 },
    {
"Profecional",     860,    350,     120 },        
    {
"Matador",         870,    350,     130 },
    {
"Puta",         890,    350,     140 },            
    {
"Mega puta",         900,    350,     150 },
    {
"John Cena",         1000,    400,     150 },
    {
"",             99999999,      0,      
    
}

new const 
ItemsTienda[][DATA_TIENDA] = {
    {
"Thanatos7"18},
    {
"janus"19},
    {
"ThanatosI"20},
    {
"Plasma"23}
}

new const 
Knifes[ ][ DATA_K ] = {
    { 
"Knife Normal""v_knife""p_knife"},
    { 
"Knife feo :v""bw_knife""p_knife"15 },
    { 
"Pirata""v_pirata""p_knife"},
    { 
"Sopapo :v""v_sopapo""p_knife"},
    { 
"doble Espada""v_espadas""p_knife"},
    { 
"Sable""v_sable""p_knife"10 }
};

new const 
g_armas_prim[][armas_caracteristicas] = { 
    
// NAME en el menu | CSW_ | weapon_ | Balas | rango   | mdlv  | mdlp  | r  | v  | a   
    
"Schmidt TMP" CSW_TMP "weapon_tmp"99990"normal""normal"000},
    { 
"Ingram MAC-10" CSW_MAC10 "weapon_mac10" 99992"normal""normal"000}, 
    { 
"UMP 45" CSW_MP5NAVY "weapon_mp5navy" 99993"normal""normal"000}, 
    { 
"Navy MP5" CSW_UMP45 "weapon_ump45" 99994"normal""normal"000}, 
    { 
"M3 Super 90" CSW_M3 "weapon_m3" 99995"normal""normal"000}, 
    { 
"XM1014 M4" CSW_XM1014 "weapon_xm1014" 99996"normal""normal"000}, 
    { 
"Conejita F90" CSW_P90 "weapon_p90" 99997"models/[G]eX/v_conejita.mdl""models/[G]eX/p_conejita.mdl"2550213}, 
    { 
"Scout Master" CSW_SCOUT "weapon_scout" 99998"models/[G]eX/v_scoutmaster.mdl""models/[G]eX/p_scoutmaster.mdl"2552550}, 
    { 
"Famas" CSW_FAMAS "weapon_famas" 999910"normal""normal"000}, 
    { 
"IMI Galil" CSW_GALIL "weapon_galil" 999912"normal""normal"000}, 
    { 
"Ak Gold" CSW_AK47 "weapon_ak47" 999914"models/[G]eX/v_goldenak47.mdl""normal"2552550},
    { 
"M4A1 ReD" CSW_M4A1"weapon_m4a1"999916"models/[G]eX/v_m4a1red.mdl""normal"25500},
    { 
"SG-552 Commando" CSW_SG552 "weapon_sg552" 999918"normal""normal"000},
    { 
"Aug" CSW_AUG "weapon_aug" 9020"normal""normal"000},
    { 
"AWP Magnum Sniper" CSW_AWP "weapon_awp" 999922"normal""normal"000},
    { 
"G3SG1 Auto-Sniper" CSW_G3SG1 "weapon_g3sg1" 999923"normal""normal"00225},
    { 
"SG-550 Auto-Sniper" CSW_SG550 "weapon_sg550" 999924"normal""normal"22500},
    { 
"M249 SAW" CSW_M249 "weapon_m249" 999925"normal""normal"02250}
}

new const 
g_armas_sec[][armas_caracteristicas] = { 
    
// NAME en el menu | CSW_ | weapon_ | Balas | rango   | mdlv  | mdlp  | r  | v  | a   
    
"Glock" CSW_GLOCK18 "weapon_glock18" 99990"normal""normal"000},  
    { 
"USP" CSW_USP "weapon_usp"99995"normal""normal"000},
    { 
"P228" CSW_P228 "weapon_p228"999910"normal""normal"000},
    { 
"Deagle" CSW_DEAGLE "weapon_deagle"999915"normal""normal"22500},
    { 
"Fiveseven" CSW_FIVESEVEN "weapon_fiveseven"999920"normal""normal"00200},
    { 
"Dual Elite" CSW_ELITE "weapon_elite"999920"normal""normal"0200200},
    { 
"Elite Green" CSW_ELITE "weapon_elite"999921"normal""normal"502000}


new const 
nades[][menu_nades] = {
    {
"+ 1 HE | + 1 Flash | + 1 Smoke"111},
    {
"+ 2 HE | + 2 Flash | + 2 Smoke"222},
    {
"+ 3 HE | + 3 Flash | + 3 Smoke"33310},
    {
"+ 4 HE | + 4 Flash | + 4 Smoke"44415},
    {
"+ 5 HE | + 5 Flash | + 5 Smoke"55520}
}

new 
g_mejora_data[ ][ DATA_MEJORA ] =  {  
    { 
"Vida",         10020 },  
    { 
"Chaleco",     13010 },  
    { 
"Velocidad",     110},  
    { 
"Gravedad",     1604}  
};  

new const 
sprite_levelup[] = { "sprites/lgtning.spr" }
new const 
item_class_name[] = "dm_item";
new const 
gs_AmbienSound[] = "sound/start.mp3";
new 
g_model[] = "models/zombie_plague/regalito.mdl";

/*====== tutor cz===*/

public plugin_init(){
    
register_plugin(INF_PLUGIN[0], INF_PLUGIN[1], INF_PLUGIN[2])
    
    
dm_revive register_cvar("deathmatch_respawn""3.0")
    
dm_proteccion register_cvar("deathmatch_proteccion""5.0")
    
    
boludo register_cvar("amx_boludo""1")
    
cvar_ronda register_cvar("rondas_boludo""4")
    
    
register_event("DeathMsg""EventoM""a")
    
register_logevent("round_end"2"1=Round_End")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
register_message(get_user_msgid("StatusIcon"), "message_statusicon")
    
    
register_forward(FM_Touch"fwd_Touch");
    
    
set_msg_block get_user_msgid "ClCorpse" ), BLOCK_SET )
    
    
RegisterHamHam_Spawn,"player","fw_PlayerSpawn_Post",true );
    
RegisterHam(Ham_Killed"player""reload_playerpro"1)
    
RegisterHam(Ham_TraceAttack"worldspawn""make_tracer"1)
    
RegisterHam(Ham_Item_Deploy"weapon_knife""ham_KnifeDeployPost"1)
    
RegisterHamHam_Player_ResetMaxSpeed"player""fw_Player_ResetMaxSpeed"); 
    for( new 
0sizeof g_armas_primi++ )
        
RegisterHam(Ham_Item_Deployg_armas_prim[i][WEAPON_NAME], "Ham_AllItem"1)
    
    for( new 
0sizeof g_armas_seci++ )
        
RegisterHam(Ham_Item_Deployg_armas_sec[i][WEAPON_NAME], "Ham_AllItem"1)
        
    
/*for( new i = 0; i < sizeof g_armas_prim; i++ )
        RegisterHam(Ham_Weapon_PrimaryAttack, g_armas_prim[i][WEAPON_NAME], "Ham_AllArmas", .Post = true)
    
    for( new i = 0; i < sizeof g_armas_sec; i++ )
        RegisterHam(Ham_Weapon_PrimaryAttack, g_armas_sec[i][WEAPON_NAME], "Ham_AllArmas", .Post = true)*/
    
    
register_concmd("rg_exp""CmdExp"ADMIN_RCON"<Nombre> <Exp>")
    
    
register_clcmd("say /knife","menuknifes")
    
register_clcmd("buy","menuknifes")
    
register_clcmd"say /puntos" "show_menu_puntos" ); 
    
register_clcmd("say""clcmd_say")
    
    
    for (new 
0sizeof (gBuyCommands); i++) 
        
register_clcmd(gBuyCommands[i], "BlockBuyCommands")
    
    
register_clcmd("INGRESAR_PASSWORD""Contra");
    
register_clcmd("say /cuenta""ShowLogMenu");
    
    
g_MsgVgui get_user_msgid("VGUIMenu");
    
g_MsgShowMenu get_user_msgid("ShowMenu");
    
register_message(g_MsgVgui"message_VGUImenu");
    
register_message(g_MsgShowMenu"message_VGUImenu");
    
    
g_vault adv_vault_open("Cuentas"false);
    
g_campo[PTS]    = adv_vault_register_field(g_vault"pts")
    
g_campo[RAN]    = adv_vault_register_field(g_vault"rango")
    
g_campo[DOR]    = adv_vault_register_field(g_vault"dorados")
    
g_campo[HAB]    = adv_vault_register_field(g_vault"habs")
    
g_campo[FECHA] = adv_vault_register_field(g_vault"FECHA"DATATYPE_STRING32);
    
g_campo[PASSWORD] = adv_vault_register_field(g_vault"PW"DATATYPE_STRING20);
    
adv_vault_init(g_vault);
    
    
gHud CreateHudSyncObj() 
    
kSync CreateHudSyncObj();
    
g_hud_boludo CreateHudSyncObj();
    
g_maxplayers get_maxplayers()
    
    
remove_entity_name"armoury_entity" );  
    
g_message_screenshake get_user_msgid("ScreenShake");
    
g_message_screenfade get_user_msgid("ScreenFade");
    
    
g_message_hud CreateHudSyncObj();
    
    
g_msgTeamInfo get_user_msgid"TeamInfo" );
    
g_msgSayText get_user_msgid"SayText" ); 
    
    
set_task(20.0"concmd_RockFinal");
    
}

public 
CmdExp(idlevelcid) { 
    if (!
cmd_access(idlevelcid2)) return PLUGIN_HANDLED
    
    static 
arg[32], arg2[6], playercantidad
    
    read_argv
(1argsizeof arg 1
    
read_argv(2arg2sizeof arg2 1
    
player cmd_target(idargCMDTARGET_NO_BOTS CMDTARGET_ALLOW_SELF
    
    if (!
player) return PLUGIN_HANDLED
    
    
cantidad = (str_to_num(arg2)) 
    
ColorChat(player"%s Te dieron^4 %d^1 de frags(s) !!"TAGcantidad
    
//tutorMake(player, TUTOR_GREEN, 4.0, "%s Te dieron^4 %d^1 de frags(s) !!", TAG, cantidad) 
    
gFrag[player] += cantidad
    
    chequear_rango
(id)
    
    return 
PLUGIN_HANDLED


public 
plugin_precache() {
    
    
set_lights("b")
    static 
ibuffer[300];
    
    for(
0sizeof Ganancias; ++i){
        
formatexbuffercharsmax(buffer), "models/%s%s.mdl"Ganancias[i][GD_ADM_MDL], Ganancias[i][GD_ADM_MDL]);
        
precache_modelbuffer );
    }
    for(
0sizeof Knifes; ++i){
        
formatexbuffercharsmax(buffer), "models/%s.mdl"Knifes][ VMDL ] );
        
precache_modelbuffer );
        
        
formatexbuffercharsmax(buffer), "models/%s.mdl"Knifes][ PMDL ] );
        
precache_modelbuffer );
    }
    for(
sizeof g_armas_prim i++)
    {
        if(!(
equal(g_armas_prim[i][model_1], "normal")))
            
precache_model(g_armas_prim[i][model_1])
        
        if(!(
equal(g_armas_prim[i][model_2], "normal")))
            
precache_model(g_armas_prim[i][model_2])
    }
  
    for(
sizeof g_armas_sec i++)
    {
        if(!(
equal(g_armas_sec[i][model_1], "normal")))
            
precache_model(g_armas_sec[i][model_1])
        
        if(!(
equal(g_armas_sec[i][model_2], "normal")))
            
precache_model(g_armas_sec[i][model_2])
    }
        
    
g_levelupp engfunc(EngFunc_PrecacheModelsprite_levelup)
    
precache_genericTDFW );
    
precache_model(g_model);
    
precache_sound("t_2c2/tcs_one.wav");
    
precache_sound("t_2c2/tcs_two.wav");
    
precache_sound("t_2c2/tcs_three.wav");
    
precache_sound("t_2c2/tcs_four.wav");
    
precache_sound("t_2c2/tcs_five.wav");
    
precache_genericgs_AmbienSound );
    
precache_sound("weapons/c4_explode1.wav");
    
    
precache_generic("sound/t_2c2/px2.mp3");
    
m_spriteTexture engfunc(EngFunc_PrecacheModel"sprites/laserbeam.spr")
    
cylinderspr precache_model("sprites/shockwave.spr");
}
    

public 
event_round_start() {
    if (!
boludo) return;
    
client_cmd(0"mp3 play %s"gs_AmbienSound
    
client_print(0print_chat"MOD EDITADO POR  %s"INF_PLUGIN[2])
    if (
gRondas == get_pcvar_num(cvar_ronda))
    {
        
gMod true
        gRondas 
1
        set_task
(2.0"llamar_funcion_boludo")
    }
    else
    {
        
gRondas++
        
client_print(0print_chat"Faltan %d Ronda%s."get_pcvar_num(cvar_ronda) - gRondas 1gRondas >= "" "s")
    }
    
    for (new 
id 1id <= g_maxplayersid++){
        
kHasSpeed[id] = false
    
}
    
    
set_task(0.1,"happyhour")
    
    new 
ent FM_NULLENT
    
static string_class[] = "classname"
    
    
while ((ent engfunc(EngFunc_FindEntityByStringentstring_classitem_class_name))) 
        
set_pev(entpev_flagsFL_KILLME)
}
public 
round_end(){
    if (
gMod)
        for (new 
id 1id <= g_maxplayersid++){
        
gSuper[id] = false
        gMod 
false
        
    
}
}

public 
BlockBuyCommands(id){
    if (!
gMod)
        return 
PLUGIN_CONTINUE;
    
    return 
PLUGIN_HANDLED;
}
public 
ham_KnifeDeployPost(wpn) {
    static 
idid get_weapon_ent_owner(wpn);
    
    if (!
pev_valid(id) || !is_user_aliveid )) return;
    
    static 
WeaponIDWeaponID cs_get_weapon_id(wpn); 
    
    static 
buffer[128];
    
    if(
WeaponID == CSW_KNIFE){
        
formatexbuffercharsmaxbuffer ), "models/%s.mdl"Knifes[Elegido[id]][VMDL]);
        
set_pev(idpev_viewmodel2buffer );
        
        
formatexbuffercharsmaxbuffer ), "models/%s.mdl"Knifes[Elegido[id]][PMDL]);
        
set_pev(idpev_weaponmodel2buffer);
    }
}
public 
Ham_AllItem(Weapon)
{
    static 
OwnerIDWeapon
    
    IDWeapon 
cs_get_weapon_id(Weapon)
    
Owner get_weapon_ent_owner(Weapon)
    
    if (!
pev_valid(Owner) || !is_user_alive(Owner)) return HAM_IGNORED
    
    
if(IDWeapon == g_armas_prim[gPrim[Owner]][CSW_NAME])
    {    
        if (!
equal(g_armas_prim[gPrim[Owner]][model_1], "normal"))
        
set_pev(Ownerpev_viewmodel2g_armas_prim[gPrim[Owner]][model_1])
        if (!
equal(g_armas_prim[gPrim[Owner]][model_2], "normal"))
        
set_pev(Ownerpev_weaponmodel2g_armas_prim[gPrim[Owner]][model_2])
    }
    if(
IDWeapon == g_armas_sec[gSec[Owner]][CSW_NAME])
    {    
        if (!
equal(g_armas_sec[gSec[Owner]][model_1], "normal"))
        
set_pev(Ownerpev_viewmodel2g_armas_sec[gSec[Owner]][model_1])
        if (!
equal(g_armas_sec[gSec[Owner]][model_2], "normal"))
        
set_pev(Ownerpev_weaponmodel2g_armas_sec[gSec[Owner]][model_2])
    }
    return 
HAM_HANDLED;
}


public 
menuknifesid ) {
    if (
gSuper[id] || !is_user_alive(id)) return 
    static 
kmenustring[80]; menu menu_create"\rMenu de Cuchillos""menu_cuchi" );
    
    for( 
0sizeof Knifes; ++){
        if(
gRangoid ] >= Knifes][ NECESARIO ] )
            
menu_additemmenuKnifes][ K_NOMBRE ], "" );
        else
        {
            
formatexstringcharsmax( string ), "\d%s \y[ \r%s \y]"Knifes][ K_NOMBRE ], rangosKnifes[k][NECESARIO]][rangos_nombre] );
            
menu_additemmenustring"" );
        }
    }
    
    
menu_displayidmenu );
    
//return PLUGIN_HANDLED;
}

public 
menu_cuchiidmenuitem ){
    if(
item == MENU_EXIT){ 
        
menu_destroymenu 
        return 
PLUGIN_HANDLED 
    
}
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRangoid ] < Knifesitem ][ NECESARIO ] ){
        
ColorChatid"Necesitas ser rango: !g^"%s^" !npara usar este knife"rangosKnifes[item][NECESARIO]][rangos_nombre]);
        
menuknifesid );
        return 
PLUGIN_HANDLED;
    }
    
Elegidoid ] = item;
    
engclient_cmdid"weapon_knife");
    
show_guns_prim(id)
    
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
}
show_guns_prim(id) {
    if (
gSuper[id] || !is_user_alive(id)) return;
    new 
len[50], menu menu_create("Eliga su arma primaria""handler_prim"
    for(new 
0sizeof g_armas_primi++) 
    { 
        if(
gRango[id] >= g_armas_prim[i][RGN] ) menu_additem(menug_armas_prim[i][NAME], ""
        else { 
            
formatex(lencharsmax(len), "\r[ \yRango Requerido: \d%s \r]"rangos[g_armas_prim[i][RGN]][rangos_nombre] )
            
menu_additem(menulen"")
        }
    }
    
menu_display(idmenu0)
}
/*
public Ham_AllArmas(all) {
    new id = get_pdata_cbase(all, 41, 4)
    if(is_user_alive(id) && gPrim[id] == 2 || gPrim[id] == 5 || gPrim[id] == 8) 
    {
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        
    }
    if(is_user_alive(id) && gSec[id] == 2 || gSec[id] == 5 || gSec[id] == 6) 
    {
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        set_pdata_float(all, 46, 0.1, 4)
        
    }
    return HAM_IGNORED
}

*/

public handler_prim(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu
        return 
PLUGIN_HANDLED
    }
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRango[id] < g_armas_prim[item][RGN] ) { 
        
//tutorMake(id, TUTOR_GREEN, 4.0, "Bloqued rango: %s", rangos[g_armas_prim[item][RGN]][rangos_nombre]) 
        
client_print(idprint_center"Bloqued rango: %s"rangos[g_armas_prim[item][RGN]][rangos_nombre]) 
        
show_guns_prim(id
        return 
PLUGIN_HANDLED
    }
    
strip_user_weapons(id
    
gPrim[id] = item;
    
give_item(id"weapon_knife"
    
give_item(idg_armas_prim[item][WEAPON_NAME]) 
    
cs_set_user_bpammo(idg_armas_prim[item][CSW_NAME], g_armas_prim[item][BPAMMO]) 
    
gMenu[id] = 1
    show_guns_sec
(id
    return 
PLUGIN_HANDLED
}
show_guns_sec(id) {
    if (
gSuper[id] || !is_user_alive(id)) return;
    new 
len[50], menu menu_create("Eliga su arma secundaria""handler_sec"
    for(new 
0sizeof g_armas_seci++) { 
        if(
gRango[id] >= g_armas_sec[i][RGN] ) menu_additem(menug_armas_sec[i][NAME], ""
        else { 
            
formatex(lencharsmax(len), "\r[ \yRango Requerido: \d%s \r]"rangos[g_armas_sec[i][RGN]][rangos_nombre] )
            
menu_additem(menulen"")
        }
    }
    
menu_display(idmenu0
}
public 
handler_sec(idmenuitem) {
    if(
item == MENU_EXIT) {  
        
menu_destroy(menu
        return 
PLUGIN_HANDLED
    }
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRango[id] < g_armas_sec[item][RGN]) { 
        
//tutorMake(id, TUTOR_GREEN, 4.0, "Bloqued Rango: %s", rangos[g_armas_sec[item][RGN]][rangos_nombre]) 
        
client_print(idprint_center"Bloqued Rango: %s"rangos[g_armas_sec[item][RGN]][rangos_nombre]) 
        
show_guns_sec(id
        return 
PLUGIN_HANDLED
    }
    
gSec[id] = item;
    
give_item(idg_armas_sec[item][WEAPON_NAME]) 
    
cs_set_user_bpammo(idg_armas_sec[item][CSW_NAME], g_armas_sec[item][BPAMMO]) 
    
gMenu[id] = 
    show_menu_granadas
(id)
    return 
PLUGIN_HANDLED
}
public 
menu_tienda(id) {
    if (
gSuper[id] || !is_user_alive(id)) return;
    new 
imenutext[100]
    
menu menu_create("\r Armas Especiales""handler_tienda")
    
    for(
0sizeof(ItemsTienda); i++) {
        if(
gRango[id] < ItemsTienda[i][REQ]) {
            
formatex(textcharsmax(text), "\d%s \r[ Rango %s ]"ItemsTienda[i][NK], rangos[ItemsTienda[i][REQ]][rangos_nombre])
            } else {
            
formatex(textcharsmax(text), "\w%s \y[ Rango %s ]"ItemsTienda[i][NK], rangos[ItemsTienda[i][REQ]][rangos_nombre] )
        }
        
menu_additem(menutext__menu_makecallback("tienda_callback"))
    }
    
menu_display(idmenu)
}
public 
tienda_callback(idmenuitem) {
    if(
gRango[id] < ItemsTienda[item][REQ])
        return 
ITEM_DISABLED;
    
    return 
ITEM_ENABLED;
}

public 
handler_tienda(idmenuitem) {
    if(
item == MENU_EXIT)
        return 
PLUGIN_HANDLED;
    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    switch(
item) {
        case 
0:shop_Thanatos7(id)
            case 
1shop_janus(id)
            case 
2shop_ThanatosI(id)
            case 
3shop_Plasma(id)
        }
    
//tutorMake(id, TUTOR_GREEN, 4.0, "%s^1 Compraste:^4 %s.", TAG, ItemsTienda[item][NK])
    
ColorChat(id"%s^1 Compraste:^4 %s."TAGItemsTienda[item][NK])
    return 
PLUGIN_HANDLED;

public 
show_menu_granadas(id) {   
    if (
gSuper[id] || !is_user_alive(id)) return; 
    new 
menu menu_create("\wMenu de bombas""menu_bombas_handler"
    
    new 
num[3], len[1024]
    for (new 
0sizeof nadesi++) {
        
num_to_str(inum2)
        if(
gRango[id] >= nades[i][nivel] ) 
            
formatex(lensizeof len 1"\y [\w%s\y]" nades[i][nombre])
        else 
formatex(lensizeof len 1"\d [%s] \r[Rango: %s]" nades[i][nombre] , rangosnades[i][nivel]][rangos_nombre])
        
menu_additem(menulennum)
    }
    
    
menu_setprop(menuMPROP_BACKNAME"\yAtras"
    
menu_setprop(menuMPROP_NEXTNAME"\ySiguiente"
    
menu_setprop(menuMPROP_EXITNAME"\ySalir"
    
menu_display(idmenu0
}
public 
EventoM(){
    new 
attacker read_data(1
    new 
victim read_data(2)
    new 
kni get_user_weapon(attacker)
    
    if(
attacker == victim || !is_user_connected(attacker) || !is_user_connected(victim))
        return 
    if(
kni == CSW_KNIFE)  {
        
gFrag[attacker]+= g_happytime kGanancia[attacker
        
Funcvictim attacker )
    }
    
    
gFrag[attacker]+= g_happytime kGanancia[attacker
    
gDorados[attacker]+= g_happytime 1  kGanancia[attacker
    
    new 
random random_num(08)
    
    if (
random == || random == || random == 6)
    {
        new 
origin[3];
        
get_user_origin(victimorigin0);
        
addItem(origin);
    }
    
    
chequear_rango(attacker
    
    
    
set_task(get_pcvar_float(dm_revive), "RevivirJugador"victim)
}
public 
menu_bombas_handler(idmenuitem) {
    if(
item == MENU_EXIT || !is_user_connected(id)) { 
        
menu_destroy(menu
        return 
PLUGIN_HANDLED 
    

    if (
gSuper[id] || !is_user_alive(id))
        return 
PLUGIN_HANDLED;
    if(
gRango[id] < nades[item][nivel] ) {    
        
//ColorChat(id, "Para este pack tu rango debe ser:^x04 %s.", rangos[ nades[item][nivel]][rangos_nombre])
        
show_menu_granadas(id)
        return 
PLUGIN_HANDLED;
    }
    
    
give_item(id"weapon_hegrenade")
    
cs_set_user_bpammo(idCSW_HEGRENADEnades[item][cantidad1])
    
give_item(id"weapon_flashbang")
    
cs_set_user_bpammo(idCSW_FLASHBANGnades[item][cantidad2])
    
give_item(id"weapon_smokegrenade")
    
cs_set_user_bpammo(idCSW_SMOKEGRENADEnades[item][cantidad3])
    
    
menu_destroy(menu)
    
menu_tienda(id)
    return 
PLUGIN_CONTINUE;
}

public 
fw_PlayerSpawn_Postindex )
{
    if( !
IsBitg_conectadoindex ) )  
        return 
HAM_IGNORED;  
    
menuknifes(index)
    
    if (
gSuper[index])
    {
        
gSuper[index] = false
        kHasSpeed
[index] = false
        
    
}
    
    
//tutorMake(index, TUTOR_GREEN, 4.0, "Menu de Armas Abierto No lo Desperdicies")
    
ColorChat(index"MENU DE ARMAS ABIERTO ESCRIBE SAY /knife PARA ABRIR EL MENU.")
    
    
set_user_gravityindexget_user_gravityindex ) - gravedadg_habilidadindex ][ ] ) );  
    
set_user_health(indexget_user_health(index) + vidag_habilidadindex ][ ] ) + rangos[index][VIDA])
    
set_user_armor(indexget_user_armor(index) + chalecog_habilidadindex ][ ] ) + rangos[index][CHALECO])
    
Load_AdminTypes(index)
    
    
    return 
HAM_IGNORED
}

public 
fw_Player_ResetMaxSpeedid ) {
    if(
is_user_connected(id))   
        
set_user_maxspeed(idget_user_maxspeedid ) + velocidadg_habilidadid ][ ] ) );
    
    
set_player_speed(id);
}

public 
client_putinserver(id) {
    
    
    
MarkBitg_conectadoid ); 
    
    
get_user_name(idg_playername[id], charsmax(g_playername[]));    
    
    
kHasSpeedid ] = false;
    
gSec[id] = false;
    
gPrim[id] = false
    
    get_user_name
(idg_cuenta[id], 31);
    
get_time("%c"g_Fecha[id], 31);
    
g_contra[id][0] = '^0';
    
g_Estado[id] = NOREGISTRADO;
        
    
g_Can[id] = 0;
    
    
gRango[id] = gDorados[id] = gFrag[id] = 
    set_task
(1.0"ShowHUD"id+TASK_HUD__"b"
    
gSuper[id] = false
    
if (!is_user_alive(id)) {
        
//if (cs_get_user_team(id) != CS_TEAM_SPECTATOR) return;
        
set_task(get_pcvar_float(dm_revive), "Revive"id)
    }
    
        
    
Cargar(id); 
    

}
public 
fwd_Touch(touchertouched)
{
    if (!
is_user_alive(toucher) || !pev_valid(touched))
        return 
FMRES_IGNORED;
    
    new 
classname[32];
    
pev(touchedpev_classnameclassname31);
    
    if (!
equal(classnameitem_class_name))
        return 
FMRES_IGNORED;
    
    
    
    
give_box(toucher);
    
set_pev(touchedpev_effectsEF_NODRAW);
    
set_pev(touchedpev_solidSOLID_NOT);
    
    return 
FMRES_IGNORED;
}
public 
removeEntity(ent)
{
    if (
pev_valid(ent))
        
engfunc(EngFunc_RemoveEntityent)
}

public 
addItem(origin[3])
{
    static 
entent create_entity("info_target");
    
set_pev(entpev_classnameitem_class_name);
    
    
engfunc(EngFunc_SetModel,entg_model);
    
    
set_pev(ent,pev_mins,Float:{-10.0,-10.0,0.0});
    
set_pev(ent,pev_maxs,Float:{10.0,10.0,25.0});
    
set_pev(ent,pev_size,Float:{-10.0,-10.0,0.0,10.0,10.0,25.0});
    
engfunc(EngFunc_SetSize,ent,Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0});
    
    
set_pev(ent,pev_solid,SOLID_BBOX);
    
set_pev(ent,pev_movetype,MOVETYPE_FLY);
    
    new 
Float:fOrigin[3];
    
IVecFVec(originfOrigin);
    
set_pev(entpev_originfOrigin);
    
    
set_pev(ent,pev_renderfx,kRenderFxGlowShell);
    
    switch(
random_num(1,4))
    {
        case 
1set_pev(ent,pev_rendercolor,Float:{0.0,0.0,255.0});
        case 
2set_pev(ent,pev_rendercolor,Float:{0.0,255.0,0.0});
        case 
3set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0});
        case 
4set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0});
    }
}

public 
give_box(id)
{
    switch (
random_num(05))
    {
        case 
0:
        {
            if(!
user_has_weapon(idCSW_M249) )
            {
                
give_item(id"weapon_m249");
                
cs_set_user_bpammo(idCSW_M249999);
            }
            else
                
ColorChat(id"!gCAJA VACIA" );
        }
        case 
1set_user_armor(idget_user_armor(id) + 100 );
            case 
2set_user_health(idget_user_health(id) + 100 )
            case 
3:
        {
            if(!
user_has_weapon(idCSW_DEAGLE) )
            {
                
give_item(id"weapon_deagle");
                
cs_set_user_bpammo(idCSW_DEAGLE999);
            }
            else
                
ColorChat(id"!gCAJA VACIA");
        }
        case 
4:
        {
            
give_item(id"weapon_hegrenade");
            
cs_set_user_bpammo(idCSW_HEGRENADE5);
        }
        case 
5:
        {
            
give_item(id"weapon_hegrenade");
            
give_item(id"weapon_flashbang");
            
cs_set_user_bpammo(idCSW_HEGRENADE5);
            
cs_set_user_bpammo(idCSW_FLASHBANG5);
        }
    }
}

set_player_speed(index) {
    if(!
is_user_aliveindex ) ) return;
    
    if( 
kHasSpeedindex ] )
        
set_pev(indexpev_maxspeed500.0 );
    else
        
set_pev(indexpev_maxspeed245.0 );
    
}
public 
client_disconnect(id){
    
ClearBitg_conectadoid ); 
    
Guardar(id);
    
remove_task(id+TASK_HUD)
    if (
gSuper[id] && gMod){
        
llamar_funcion_boludo()
    }
    
}

public 
chequear_rango(id){
    new 
gR false
    
while(gFrag[id] >= rangos[gRango[id]][nivel_requerido] && gRango[id] < rangos_maximos){
        
gRango[id]++
        
gDorados[id]+= 10
        gFrag
[id] = 
        gR 
=true
        subirrango
(id)
    }
    if(
gR) {
        
client_print(idprint_chat"Felicitaciones has ascendido al rango: %s"rangos[gRango[id]][rangos_nombre]); 
        
//tutorMake(id, TUTOR_GREEN, 4.0, "Felicitaciones has ascendido al rango: %s", rangos[gRango[id]][rangos_nombre]); 
        
gR false
    
}
    



public 
ShowHUD(taskid){
    static 
id;id HUD_ID
    
    
if(!is_user_alive(id))
        return;
    
    
set_hudmessage(25525500.020.1506.012.0)
    
ShowSyncHudMsg(idgHud"[DeathMatch + Rango]^n[Rango: %s]^n[Frags: %d]^n[Puntos: %d]^n[Happy Hour: %s]^n[Con mas score: %s]"
    
rangos[gRango[id]][rangos_nombre], gFrag[id], gDorados[id], g_happytime "Activada" "Desactivada"g_player_proname)


 

public 
show_menu_puntosid )  
{     
    new 
iLen250 ]; 
    
    new 
hadle_puntos menu_create("\y=============================^n\w    Sistema de habilidades \y=============================^n""hadle_puntos")  
    
    for( new 
0sizeof g_mejora_datai++ )  
    {  
        if( 
g_habilidadid ][ ] <= g_mejora_data][ MEJORA_MAX ] )  
        {  
            if( 
gDoradosid ] >= g_mejora_data][ MEJORA_COSTO ] )  
                
formatexiLen charsmaxiLen ) , "\wAumentar : %s [%d / %d] \y[ Costo : %d P]"g_mejora_data[i][MEJORA_NAME],g_habilidadid ][ ], g_mejora_data][ MEJORA_MAX ], g_mejora_data][ MEJORA_COSTO ] );   
            else  
                
formatexiLen charsmaxiLen ) , "\dAumentar : %s [%d / %d] \r[P.Necesarios : %d]"g_mejora_data][ MEJORA_NAME ], g_habilidadid ][ ], g_mejora_data][ MEJORA_MAX ], g_mejora_data][ MEJORA_COSTO ] );  
            
            if(
g_habilidadid ][ ] >= g_mejora_data][ MEJORA_MAX ] )  
                
formatexiLen charsmaxiLen ) , "\d[%d] %s [%d / %d] \r[COMPLETADO]"i+1g_mejora_data][ MEJORA_NAME ], g_habilidadid ][ ], g_mejora_data][ MEJORA_MAX ] );             
        }  
        
        
menu_additemhadle_puntos iLen );  
    }  
    
    
menu_setprophadle_puntos MPROP_EXITNAME,"\ySalir" );  
    
menu_displayidhadle_puntos );      
    
    return 
PLUGIN_HANDLED;  
}  

public 
hadle_puntos(id menuitem)  
{   
    
menu_destroy(menu);  
    
    if (
item == MENU_EXIT)      
        return  
    
    if(
gDoradosid ] < g_mejora_dataitem ][ MEJORA_COSTO ] )  
    {  
        
ColorChat(id"^x04%s^x01 Nesecitas^x03 %d^x01 puntos para mejorar^x03 %s^x01."TAGg_mejora_dataitem ][ MEJORA_COSTO ], g_mejora_dataitem ][ MEJORA_NAME ] );  
        
client_cmdid"spk buttons/button10.wav" );  
        return; 
    }  
    
    if(
g_habilidadid ][ item ] >= g_mejora_dataitem ][ MEJORA_MAX ] )  
    {  
        
ColorChat(id"^x04%s^x01 Subistes el maximo de puntos para la mejora:^x03 %s^x01."TAGg_mejora_dataitem ][ MEJORA_NAME ] );  
        
client_cmdid"spk buttons/button10.wav" );  
        return;  
    }  
    
    
gDoradosid ] -= g_mejora_dataitem ][ MEJORA_COSTO ];  
    
g_habilidadid ][ item ]++;   
    
ColorChat(id"^x04%s^x01 Subistes la mejora:^x03 %s^x01 ahora tenes^x03 %d^x01 /^x03 %d^x01 completada de ella. "TAGg_mejora_dataitem ][ MEJORA_NAME ], g_habilidadid ][ item ], g_mejora_dataitem ][ MEJORA_MAX ] );  
    
show_menu_puntosid );  
}  
public 
happyhour(id)
{
    new 
data[12]
    
get_time("%H"data12)
    new 
Tiempo str_to_num(data)
    
    for(new 
i=0;<= sizeof horas 1;i++)
    {
        if(
Tiempo != horas[i]) continue
        
g_happytime true
        
break;
    }
    if(
g_happytime)
    {
        
ColorChat(0"^x04[%s]^x01 Estas en^x04 Happy Hour^x01 disfruta mientas ganas el^x04 Doble^x01 de Frags"TAG)
    }

Funcid id2 ){
    static 
name][ 32 ], origin];
    
get_user_nameid name[0], 31 );
    
get_user_nameid2 name[1], 31 );
    
get_user_origin(idorigin3)
    
    
set_hudmessage204 204 0.0 0.55 4.0 4.0 );
    
ShowSyncHudMsgkSync"%s^nHA FILETIADO a:^n%s^nOOOOHH!! Turn Down For What!!!" name], name] );    
    
    
//client_cmd( 0, "MP3Volume 0.8" );
    
client_cmd"mp3 play ^"%s^""TDFW );
    
    
// Screen Shake
    
message_begin(MSG_ONEget_user_msgid("ScreenShake"), {0,0,0}, id);
    
write_short(1<<14);
    
write_short(1<<14);
    
write_short(1<<14);
    
message_end();
    
    
// Implosion ( Particulas hacia dentro )
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin);
    
write_byte(TE_IMPLOSION);
    
write_coord(origin[0]);
    
write_coord(origin[1]);
    
write_coord(origin[2]);
    
write_byte(128);
    
write_byte(20);
    
write_byte(3);
    
message_end();
    
    
// LavaSplash ( Particulas hacia fuera )
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin);
    
write_byte(TE_LAVASPLASH);
    
write_coord(origin[0]);
    
write_coord(origin[1]);
    
write_coord(origin[2]);
    
message_end();
    
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+50.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+100.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+150.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+250.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin0);
    
write_byte(TE_BEAMCYLINDER);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]);
    
engfunc(EngFunc_WriteCoordorigin[0]);
    
engfunc(EngFunc_WriteCoordorigin[1]);
    
engfunc(EngFunc_WriteCoordorigin[2]+350.0);
    
write_shortcylinderspr );
    
write_byte(0);
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(random_num(0,255));
    
write_byte(200);
    
write_byte(0);
    
message_end();

subirrango(id)  { 
    new 
vec1[3], vec2[3
    
get_user_origin(idvec2
    
    
vec2[2] -= 26 
    vec1
[0] = vec2[0
    
vec1[1] = vec2[1
    
vec1[2] = vec2[2] + 400 
    
    
// Rayo
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY
    
write_byte
    
write_coord(vec1[0]) 
    
write_coord(vec1[1]+30
    
write_coord(vec1[2]) 
    
write_coord(vec2[0]) 
    
write_coord(vec2[1]+30
    
write_coord(vec2[2]) 
    
write_short(g_levelupp// sprite que utilizaremos
    
write_byte(1// startframe
    
write_byte(5// flamerate
    
write_byte(2// life
    
write_byte(20// width
    
write_byte(30// noise
    
write_byte(255// colo rojo
    
write_byte(255// colo verde // si lo dejamos haci da color amarillo en el rayo, modifiquese a su gusto
    
write_byte(0// rolor azul
    
write_byte(200// brillo del rayo
    
write_byte(100// Rapidéz del rayo al caer
    
message_end()
    
    
// Thunder 2
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY
    
write_byte
    
write_coord(vec1[0]) 
    
write_coord(vec1[1]+30
    
write_coord(vec1[2]) 
    
write_coord(vec2[0]) 
    
write_coord(vec2[1]+30
    
write_coord(vec2[2]) 
    
write_short(g_levelupp1// sprite que utilizaremos
    
write_byte(1// startframe
    
write_byte(5// flamerate
    
write_byte(2// life
    
write_byte(20// width
    
write_byte(30// noise
    
write_byte(255// color rojo
    
write_byte(255//  color verde
    
write_byte(0// Icolor azul
    
write_byte(200// brillo del rayo
    
write_byte(100// Rapidéz del rayo al caer
    
message_end()

public 
message_statusicon(msg_idmsg_destid)
{
    static 
szIcon[8]
    
get_msg_arg_string(2szIconcharsmax(szIcon))
    
    if (
equal(szIcon"buyzone") && get_msg_arg_int(1))
    {
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0))
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;



Load_AdminTypes(id){
    if(
is_user_admin(id)) // Si es admin
    
{
        new 
iflags get_user_flags(id);
        
        for(
sizeof Ganancias i++ ) 
        {
            if(
flags Ganancias[i][GD_ADM_FLAG]) // Si las flags del player es igual a las que definimos arriba
            

                
// cambian "has_happyhour" por su variable de happyhour
                
if(g_happytime// Si esta la Happy Hour activa
                    
kGanancia[id] = Ganancias[i][GD_ADM_GHH]; // le damos la ganancia del admin en HH;
                
else // Si no esta activa la Happy Hour
                    
kGanancia[id] = Ganancias[i][GD_ADM_GN]; // Le damos la ganancia Normal
                
                
formatex(kAccountType[id], charsmax(kAccountType), "%s"Ganancias[i][GD_ADM_TYPE]); // Le damos formato a 'kAccountType'
                
cs_set_user_model(idGanancias[i][GD_ADM_MDL])
                
                break; 
// Salimos del Loopeo
            
}
        }
    }
    else 
// Si no es admin
    
{
        if(
g_happytime// Si es HappyHour
            
kGanancia[id] = 2// Le damos Ganancia por 2 a los users normales
        
else // Si no es Happy Hour
            
kGanancia[id] = 1// Ganancia por 1 (que seria lo normal)
        
        
formatex(kAccountType[id], charsmax(kAccountType), "Usuario Normal"); // Le damos formato a 'kAccountType'
    
}

public 
Revive(id) {
    if (
cs_get_user_team(id) != CS_TEAM_SPECTATOR)
            {
              
                return 
PLUGIN_HANDLED;
            }
    
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
ColorChat(id"%s Acabas de revivir."TAG)
    
    return 
PLUGIN_HANDLED;
}
public 
RevivirJugador(id) {
    
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
ColorChat(id"%s Acabas de revivir."TAG)
    
    
set_user_godmode(id1)
    
client_print(idprint_center"%s Obtienes proteccion por^4 %d segundos^1."TAGget_pcvar_num(dm_proteccion))
    
    if (
cs_get_user_team(id) == CS_TEAM_CT)
        
set_rendering(idkRenderFxGlowShell00255kRenderNormal50)
    if (
cs_get_user_team(id) == CS_TEAM_T)
        
set_rendering(idkRenderFxGlowShell25500kRenderNormal50)
    
    
set_task(get_pcvar_float(dm_proteccion), "RemoverProteccion"id)
    return 
PLUGIN_HANDLED;
}

public 
RemoverProteccion(id) {
    
set_user_godmode(id0)
    
set_rendering(id)
    
client_print(idprint_center"%s Se te acabaron los^4 %d segundos^1 de proteccion."TAGget_pcvar_num(dm_proteccion))
}

stock get_weapon_ent_owner(ent){
    if (
pev_valid(ent) != 2)
        return -
1;
    
    return 
get_pdata_cbase(ent414);
}



stock ColorChat(id, const input[], any:...)
{
    static 
szMsg[191], msgSayText;
    
    if (!
msgSayText)
        
msgSayText get_user_msgid("SayText");
    
    
replace_all(szMsg190"!g""^4");
    
replace_all(szMsg190"!y""^1");
    
replace_all(szMsg190"!team""^3");
    
    
vformat(szMsg190input3);
    
    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id);
    
write_byte(id id 33);
    
write_string(szMsg);
    
message_end();


public 
ShowLogMenu(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit), "\y[\rD\y]eathMatch + Rango ^n\wBienvenido \r%s^n\wESTADO: \r%s^n\wTu ultima visita fue: \r%s"g_cuenta[id], Estado[g_Estado[id]], g_Fecha[id]);
    
    new 
menu menu_create(Tit,"menu_log");
    
    
menu_additem(menu, (g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Loguearse":"\dLoguearse""1");
    
menu_additem(menu, (g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Registrarse^n":"\dRegistrarse^n""2");
    
menu_additem(menu, (g_Estado[id] == LOGUEADO && !g_Can[id])?"Cambiar Contra":"\dCambiar Contra""3");
    
    
menu_display(idmenu0);
}
public 
menu_log(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item) {
        case 
0: {
            if(
g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa tu PASSWORD para entrar a tu cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
                } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }
        }
        case 
1: {
            if(
g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa una PASSWORD para crear una cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
                } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }    
        }
        case 
2: {
            if(
g_Estado[id] == LOGUEADO && !g_Can[id]) {
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
                } else {
                
client_print(idprint_center"No estas logueado o ya cambiaste tu password durante el mapa");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
Confirmar(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit),"La password sera \r%s^n^n\yConfirmar?"g_contra2[id]);
    
    new 
menu menu_create(Tit,"menu_confirmar");
    
    
menu_additem(menu,"\rSi\w, confirmar","1");
    
menu_additem(menu,"\rNo\w, deseo reescribirla","2");
    
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER);
    
    
menu_display(idmenu0);
}
public 
menu_confirmar(idmenuitem) {
    switch(
item) {
        case 
0: {
            switch(
g_Estado[id]) {
                case 
LOGUEADO: {
                    
copy(g_contra[id], 19 ,g_contra2[id]);
                    
Guardar(id);
                    
client_print(idprint_center"Tu password ha sido cambiada satisfactoriamente");
                    
g_Can[id] = 1;
                }
                case 
NOREGISTRADO: {    
                    
client_print(idprint_center"Tu cuenta ha sido creada satisfactoriamente");
                    
copy(g_contra[id], 31g_contra2[id]);
                    
Guardar(id);
                    
jTeam(id);
                }
            }
        }
        case 
1: {
            
menu_destroy(menu);
            
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            if(
g_Estado[id] == LOGUEADO)
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
            else
                
client_print(idprint_center"Ingresa la PASSWORD para tu nueva cuenta");
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
Guardar(id) {
    if(!
is_user_connected(id)) return;
    
    
adv_vault_set_start(g_vault);
    
adv_vault_set_field(g_vaultg_campo[PTS], gFrag[id])
    
adv_vault_set_field(g_vaultg_campo[RAN], gRango[id])
    
adv_vault_set_field(g_vaultg_campo[DOR], gDorados[id])
    
adv_vault_set_field(g_vaultg_campo[HAB], g_habilidad[id])    
    
adv_vault_set_field(g_vaultg_campo[FECHA], g_Fecha[id]);
    
adv_vault_set_field(g_vaultg_campo[PASSWORD], g_contra[id]);
    
adv_vault_set_end(g_vault0g_cuenta[id]);
}
public 
Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_cuenta[id])) {
        
g_Estado[id] = NOREGISTRADO;
        return;
        } else {
        
g_Estado[id] = REGISTRADO;
        
        
gFrag[id] = adv_vault_get_field(g_vaultg_campo[PTS])
        
gRango[id] = adv_vault_get_field(g_vaultg_campo[RAN])
        
gDorados[id] = adv_vault_get_field(g_vaultg_campo[DOR])
        
adv_vault_set_field(g_vaultg_campo[HAB], g_habilidad[id][0], sizeof g_habilidad[][])
        
adv_vault_get_field(g_vaultg_campo[FECHA], g_Fecha[id], charsmax(g_Fecha[]));
        
adv_vault_get_field(g_vaultg_campo[PASSWORD], g_contra[id], charsmax(g_contra[]));
    }
    
}
public 
Contra(id) {
    
read_args(g_contra[id], charsmax(g_contra));
    
remove_quotes(g_contra[id]);trim(g_contra[id]);
    
    if(
equal(g_contra[id],"") || containi(g_contra[id]," ") != -) {
        
client_print(idprint_center"Tu password contiene errores");
        return 
1;
    }
    
    switch(
g_Estado[id]) {
        case 
NOREGISTRADO: {
            
client_print(idprint_center"Confirma tu password para proseguir");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
        case 
REGISTRADO: {
            new 
buffer[40];
            
adv_vault_get_prepare(g_vault_g_cuenta[id]);
            
adv_vault_get_field(g_vaultg_campo[PASSWORD], buffercharsmax(buffer));
            
            if(
equal(bufferg_contra[id])) {
                
Guardar(id);
                
client_print(idprint_center"Te logueaste satisfactoriamente en tu cuenta");
                
jTeam(id);
                } else {
                
ShowLogMenu(id);
                
client_print(idprint_center"Password Incorrecta.");
            }
        }
        case 
LOGUEADO: {
            if(
g_Can[id]) {
                
client_print(idprint_center"Ya cambiaste tu contra en este mapa");
                return 
PLUGIN_HANDLED;
            }
            
client_print(idprint_center"Confirma tu password para cambiarla...");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
message_VGUImenu(msgiddestid) {
    if(
g_Estado[id] != LOGUEADO)
        
ShowLogMenu(id);
    
    return 
1;
}
public 
jTeam(id){
    static 
teammsg_blockteammsg_block_vguirestorevgui;
    
    
restore get_pdata_int(id510);
    
vgui restore & (1<<0);
    
    if (
vgui)
        
set_pdata_int(id510restore & ~(1<<0));
    
    
teammsg_block get_msg_block(g_MsgShowMenu);
    
teammsg_block_vgui get_msg_block(g_MsgVgui);
    
    
set_msg_block(g_MsgShowMenuBLOCK_ONCE);
    
set_msg_block(g_MsgVguiBLOCK_ONCE);
    
    
engclient_cmd(id"jointeam""5");
    
engclient_cmd(id"joinclass""5");
    
    
set_msg_block(g_MsgShowMenuteammsg_block);
    
set_msg_block(g_MsgVguiteammsg_block_vgui);
    
    if (
vgui
        
set_pdata_int(id510restore);
    
    
g_Estado[id] = LOGUEADO;

public 
llamar_funcion_boludo()
{
    static 
players[32], iPlayerName[32], countiget_players(playerscount"a")
    
    if (
count)
    {
        
iPlayer players[random(count)]
        
get_user_name(iPlayerNamecharsmax(Name))
        
        
gSuper[iPlayer] = true
        
        set_hudmessage
(25500, -1.0, -1.006.012.0)
        
ShowSyncHudMsg(0g_hud_boludo"El Jugador %s es Un Sniper^nSu equipo tiene que protegerlo..."Name)
        
        
strip_user_weapons(iPlayer)
        
        
give_item(iPlayer"weapon_knife")
        
dar_vida(iPlayer)
        
        for (
1<= g_maxplayersi++)
        {
            if (!
gSuper[i])    continue;
            
            
strip_user_weapons(i)
            
kHasSpeed[iPlayer] = true
            give_item
(iPlayer"weapon_knife")
            
give_item(iPlayer"weapon_awp")
        }
    }
}

public 
dar_vida(id)
{
    if ( 
get_playersnum() >= 10set_user_health(id10000)
    
    else if ( 
get_playersnum() <= 10set_user_health(id5000)
}

public 
concmd_RockFinal(idlevelcid)
{
    if(!
cmd_access(idADMIN_LEVEL_Acid1))
        return 
PLUGIN_HANDLED;
    
    if(
g_unique)
    {
        
console_print(id"Solo se puede usar este comando una vez por mapa!");
        return 
PLUGIN_HANDLED;
    }
    
    
g_unique 1
    
    g_count 
10;
    
set_task(2.0"fn_Vale");
    
    new 
i;
    for(
1<= g_maxplayers; ++i)
    {
        if(!
is_user_connected(i))
            continue;
        
        
cs_set_user_money(i0);
        
        if(!
is_user_alive(i))
            continue;
        
        
strip_user_weapons(i);
    }
    
    return 
PLUGIN_HANDLED;
}

public 
fn_Vale()
{
    new 
sMsg[64];
    
    if(
g_count 5)
        
formatex(sMsgcharsmax(sMsg), "El juego comienza en %d segundos"g_count);
    else
    {
        new 
sSound[64];
        
        switch(
g_count)
        {
            case 
5:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_five.wav");
                
                new 
i;
                for(
1<= g_maxplayers; ++i)
                {
                    if(!
is_user_connected(i))
                        continue;
                    
                    
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
                    
write_short(UNIT_SECOND 14);
                    
write_short(UNIT_SECOND 9);
                    
write_short(UNIT_SECOND 14);
                    
message_end();
                }
                
                for(
1<= g_maxplayers; ++i)
                {
                    if(!
is_user_connected(i))
                        continue;
                    
                    
ClearSyncHud(ig_message_hud);
                }
                
                
set_lights("i");
            }
            case 
4:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_four.wav");
                
set_lights("g");
            }
            case 
3:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_three.wav");
                
set_lights("e");
            }
            case 
2:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_two.wav");
                
set_lights("c");
            }
            case 
1:
            {
                
formatex(sSoundcharsmax(sSound), "t_2c2/tcs_one.wav");
                
set_lights("a");
            }
            case 
0:
            {    
                
g_count 1;
                
                
set_task(3.0"fn_PlayMusic");
                
                return;
            }
        }
        
        
client_cmd(0"spk ^"%s^""sSound);
        
        
set_dhudmessage(2552550, -1.00.300.00.30.30.3);
        
show_dhudmessage(0"%d"g_count);
    }
    
    if(
g_count 5)
    {
        
set_hudmessage(2552550, -1.00.300.03.02.01.0, -1);
        
ShowSyncHudMsg(0g_message_hud"%s"sMsg);
    }
    
    --
g_count;
    
    
set_task(1.0"fn_Vale");
}

public 
fn_PlayMusic()
{
    if(
g_count == 5)
    {
        ++
g_count;
        
        
set_task(0.3"fn_PlayMusic");
        
        return;
    }
    
    new 
sSound[64];
    
    switch(
g_count)
    {
        case 
1formatex(sSoundcharsmax(sSound), "t_2c2/tcs_one.wav");
        case 
2formatex(sSoundcharsmax(sSound), "t_2c2/tcs_two.wav");
        case 
3formatex(sSoundcharsmax(sSound), "t_2c2/tcs_three.wav");
        case 
4formatex(sSoundcharsmax(sSound), "t_2c2/tcs_four.wav");
        case 
6:
        {
            
client_cmd(0"MP3Volume 2.0");
            
client_cmd(0"mp3 play ^"sound/t_2c2/px2.mp3^"");
            
            new 
i;
            for(
1<= g_maxplayers; ++i)
            {
                if(!
is_user_connected(i))
                    continue;
                
                
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
                
write_short(UNIT_SECOND 28);
                
write_short(UNIT_SECOND 18);
                
write_short(UNIT_SECOND 28);
                
message_end();
            }
            
            
g_count 1;
            
g_count_final 1;
            
            
set_task(0.1"fn_ChangeRender");
            
set_task(5.0"fn_ChangeNumber");
            
set_task(15.0"fn_ChangeScreens");
            
set_task(30.1"fn_Finish");
            
            return;
        }
    }
    
    
client_cmd(0"spk ^"%s^""sSound);
    
    ++
g_count;
    
    
set_task(0.3"fn_PlayMusic");
}

public 
fn_ChangeRender()
{
    if(
g_count == 60 || g_finish)
        return;

    static 
i;
    static 
Float:vecOrigin[3];
    
    for(
1<= g_maxplayers; ++i)
    {
        if((
g_count 2) == 0)
        {
            if(!
is_user_connected(i))
                continue;
            
            
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
            
write_short(UNIT_SECOND 9);
            
write_short(UNIT_SECOND 6);
            
write_short(UNIT_SECOND 9);
            
message_end();
            
            if(!
is_user_alive(i))
                continue;
            
            
entity_get_vector(iEV_VEC_originvecOrigin);
            
            
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvecOrigin0);
            
write_byte(TE_DLIGHT);
            
engfunc(EngFunc_WriteCoordvecOrigin[0]);
            
engfunc(EngFunc_WriteCoordvecOrigin[1]);
            
engfunc(EngFunc_WriteCoordvecOrigin[2]);
            
write_byte(40);
            
write_byte(random_num(50250));
            
write_byte(random_num(50250));
            
write_byte(random_num(50250));
            
write_byte(50);
            
write_byte(10);
            
message_end();
        }
        
        if(!
is_user_alive(i))
            continue;
        
        
set_user_rendering(ikRenderFxGlowShellrandom_num(150250), random_num(150250), random_num(150250), kRenderNormal25);
    }
    
    ++
g_count;
    
    
set_task(0.5"fn_ChangeRender");
}

public 
fn_ChangeScreens()
{
    if(
g_count_screens == 75 || g_finish)
        return;
    
    static 
i;
    if((
g_count_screens 15) == 0)
    {
        for(
1<= g_maxplayers; ++i)
        {
            if(!
is_user_connected(i))
                continue;
            
            
message_begin(MSG_ONE_UNRELIABLEg_message_screenshake_i);
            
write_short(UNIT_SECOND 28);
            
write_short(UNIT_SECOND 18);
            
write_short(UNIT_SECOND 28);
            
message_end();
        }
    }
    
    for(
1<= g_maxplayers; ++i)
    {
        if(!
is_user_connected(i))
            continue;
        
        
message_begin(MSG_ONE_UNRELIABLEg_message_screenfade_i)
        
write_short(UNIT_SECOND*4);
        
write_short(UNIT_SECOND*4);
        
write_short(0x0000);
        
write_byte(random_num(100250));
        
write_byte(random_num(100250));
        
write_byte(random_num(100250));
        
write_byte(200);
        
message_end();
    }
    
    ++
g_count_screens;
    
    
set_task(0.2"fn_ChangeScreens");
}

public 
fn_Finish()
{
    
g_finish 1;
    
    
client_cmd(0"mp3 stop; stopsound");
    
    
client_cmd(0"spk weapons/c4_explode1.wav");
    
client_cmd(0"spk weapons/c4_explode1.wav");
    
    
set_lights("");
    
    new 
i;
    for(
1<= g_maxplayers; ++i)
    {
        if(!
is_user_connected(i))
            continue;
        
        
message_begin(MSG_ONE_UNRELIABLEg_message_screenfade_i)
        
write_short(UNIT_SECOND*4);
        
write_short(UNIT_SECOND*4);
        
write_short(0x0000);
        
write_byte(255);
        
write_byte(255);
        
write_byte(25);
        
write_byte(255);
        
message_end();
        
        
set_user_rendering(i);
    }
    
    
set_task(0.3"fn_R");
    
set_task(2.0"fn_Restart3");
}

public 
fn_R()
    
server_cmd("sv_restart 1")

public 
fn_Restart3()
{
    
client_print(0print_chat"Inviat mas GENTE!");
}

public 
fn_ChangeNumber()
{
    if(
g_count_final == 6)
        return;
    
    new 
sSound[64];
    
    switch(
g_count_final)
    {
        case 
1formatex(sSoundcharsmax(sSound), "t_2c2/tcs_five.wav");
        case 
2formatex(sSoundcharsmax(sSound), "t_2c2/tcs_four.wav");
        case 
3formatex(sSoundcharsmax(sSound), "t_2c2/tcs_three.wav");
        case 
4formatex(sSoundcharsmax(sSound), "t_2c2/tcs_two.wav");
        case 
5formatex(sSoundcharsmax(sSound), "t_2c2/tcs_one.wav");
    }
    
    
client_cmd(0"spk ^"%s^""sSound);
    
    ++
g_count_final;
    
    
set_task(5.0"fn_ChangeNumber");
}

public 
clcmd_say(id)
{
    static 
said[191
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said)
    
replace_all(saidcharsmax(said), "%"" ")
    
    if (!
ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], prefix[91]
    
get_user_team(idcolorcharsmax(color))
    
    
formatex(prefixcharsmax(prefix), "%s [^x04%s^x01] %s^x03  %s"is_user_alive(id) ? "^x01" "^x01*MUERTO* "kAccountType[id], rangos[gRango[id]][rangos_nombre], g_playername[id])
    
    if (
is_user_admin(id)) format(saidcharsmax(said), "^x04%s"said)
    
    
format(saidcharsmax(said), "%s^x01 :  %s"prefixsaid)
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) 
    {
        if (!
is_user_connected(i)) continue;
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(id) || !is_user_alive(id) && !is_user_alive(id))
        {
            
            
get_user_team(iteamcharsmax(team))
            
            
changeTeamInfo(icolor)
            
            
writeMessage(isaid)
            
            
changeTeamInfo(iteam)
        }
    }
    
    return 
PLUGIN_HANDLED_MAIN;
}

public 
changeTeamInfo(playerteam[]){
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}

public 
writeMessage(playermessage[]){
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end() 

Código PHP:
stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    
    return 
false;

public 
make_tracer(victimattackerFloat:damageFloat:direction[3], tracehandledamage_type)
{
    
    new 
weapon get_user_weapon(attacker)
    new 
Float:vecEndPos[3
    
get_tr2(tracehandleTR_vecEndPosvecEndPos
    
    if(
weapon == g_armas_prim[gPrim[attacker]][CSW_NAME]) 
    {
        
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvecEndPos0
        
write_byte(TE_BEAMENTPOINT
        
write_short(attacker 0x1000
        
engfunc(EngFunc_WriteCoordvecEndPos[0]) // x 
        
engfunc(EngFunc_WriteCoordvecEndPos[1]) // x 
        
engfunc(EngFunc_WriteCoordvecEndPos[2]) // x 
        
write_short(m_spriteTexture
        
write_byte(0// framerate 
        
write_byte(0// framerate 
        
write_byte(1// framerate 
        
write_byte(50// framerate 
        
write_byte(0// framerate 
        
write_byte(g_armas_prim[gPrim[attacker]][rrr])
        
write_byte(g_armas_prim[gPrim[attacker]][vvv])
        
write_byte(g_armas_prim[gPrim[attacker]][aaa])
        
write_byte(128// brightness 
        
write_byte(0// brightness 
        
message_end() 
    }
    if(
weapon == g_armas_sec[gSec[attacker]][CSW_NAME]) 
    {
        
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvecEndPos 

PD: Tuve que subirlo por separado ya que el code es muy largo...
Responder
#3
chuta y ahora como lo uno :c soy novato en esto
Responder
#4
Pegas el 2 code abajo del primer ._., izi pizzi
Responder
#5
me aparece esto
Cita: Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\hamsandwich.inc(47) : error 017: undefined symbol "AMXX_VERSION_NUM"
C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\hamsandwich.inc(361) : error 017: undefined symbol "get_func_id"
C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\hamsandwich.inc(361) : warning 215: expression has no effect
C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\hamsandwich.inc(361) : warning 215: expression has no effect
C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\hamsandwich.inc(361) : error 001: expected token: ";", but found ")"
C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\hamsandwich.inc(361) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\hamsandwich.inc(361) : fatal error 107: too many error messages on one line

Compilation aborted.
5 Errors.
Could not locate output file C:\Users\Juan\Desktop\c.amx (compile failed).
Responder
#6
No-Steam = No Soporte :/

Sorry.

Código:
C:\Program Files (x86)\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\include\
Responder
#7
pff:/
Responder
#8
hay no

Código PHP:
new const INF_PLUGIN[][] = { "Rangos""1,1""GeX~" 
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#9
el usuario gex me paso el sma con el mod editado:/
Responder
#10
Non-Steam y roba autor Oh god whyRoflmao

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)