Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ======================================================================
- Hns by heNK' Inspirado en: "Simple Hns by AgustiN"
- Contenido:
- - Hook say
- - Item CVARS ( Add )
- - Fixed Bugs Say
- - Fixed Bugs Command
- ======================================================================
- # Falta Agregar:
- - Fixed Literna
- - Fixed Graffitis
- - Agregar Menú Help
- - Agregar Menú Principal
- - Agregar Menú Admin
- //Ultimo updated 2017-05/20
- */
- #include < amxmodx >
- #include < amxmisc >
- #include < fun >
- #include < fakemeta >
- #include < cstrike >
- #include < fakemeta_util >
- #include < engine >
- #include < hamsandwich >
- #include < HenkStocks >
- #include < adv_vault >
- new Conteo;
- new g_pCvar_Conteo;
- new g_pCvar_Prefix;
- new g_pCvar_Item_HNS_He, g_pCvar_Item_HNS_Fb, g_pCvar_Item_HNS_Sg;
- new szPrefix [ 33 ];
- new KeysMenu = MENU_KEY_0 | MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_7 | MENU_KEY_8 | MENU_KEY_9;
- enum Compras {
- COMPRAS_ITEM [ 33 ],
- COMPRAS_COSTO
- };
- enum ComprasItemCT {
- HE_GRENADE_CT,
- FROST_GRENADE_CT,
- DEAGLE_CT,
- CHALECO_CT,
- VIDA_CT,
- REVIVIR_CT,
- GODMODE_CT,
- NOCLIP_CT
- }
- enum ComprasItemTT {
- CAMUFLAJE_TT,
- DEAGLE_TT,
- VIDA_TT,
- FROST_GRENADE_TT,
- VELOCIDAD_TT,
- REVIVIR_TT,
- GODMODE_TT,
- NOCLIP_TT
- }
- enum ComprasItemGEN {
- DANIO_GEN,
- VIDA_GEN,
- AUTOBUNNY_GEN,
- GRAVEDAD_GEN
- }
- new const szComprasCT [ ] [ Compras ] = {
- { "He Grenade", 10 },
- { "Frost Nades", 60 },
- { "Deagle \y(1Bala)", 45 },
- { "Chaleco", 25 },
- { "Vida", 70 },
- { "Revivir", 300 },
- { "Godmode \y(5Segundos)", 100 },
- { "Noclip \y(5Segundos)", 160 }
- };
- new const szComprasTT [ ] [ Compras ] = {
- { "Camuflaje \r(10Segundos)", 60 },
- { "Deagle \r(2Balas)", 50 },
- { "Vida", 70 },
- { "2 Frost Nades", 60 },
- { "Velocidad \r(15Segundos)", 140 },
- { "Revivir", 300 },
- { "Godmode \r(5Segundos)", 100 },
- { "Noclip \r(5Segundos)", 160 }
- };
- new const szComprasGEN [ ] [ Compras ] = {
- { "Mas Daño \d(1Ronda)", 300 },
- { "Mas Vida \d(200HP)", 120 },
- { "Auto-Bunny \d(1Ronda)", 170 },
- { "Gravedad \d(1Ronda)", 250 }
- };
- new const RemoveEntity [ ] [ ] =
- {
- "func_bomb_target",
- "info_bomb_target",
- "hostage_entity",
- "monster_scientist",
- "func_hostage_rescue",
- "info_hostage_rescue",
- "info_vip_start",
- "func_vip_safetyzone",
- "func_escapezone",
- "armoury_entity"
- };
- new const BuyCommands [ ] [ ] =
- {
- "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", "sgren", "defuser", "nvgs", "shield",
- "primammo", "secammo", "km45", "9x19mm", "nighthawk",
- "228compact", "fiveseven", "12gauge", "autoshotgun",
- "mp", "c90", "cv47", "defender", "clarion", "krieg552",
- "bullpup", "magnum", "d3au1", "krieg550"
- };
- new const ComandosABloquear [ ] [ ] = {
- "kill", "jointeam", "joinclass",
- "buy", "buyammo1", "buyammo2", "buyequip",
- "cl_autobuy", "cl_setautobuy", "cl_setrebuy", "cl_rebuy"
- };
- //new const szHotmails [ ] [ ] = { "@hotmail.com", "@yahoo.com.ar", "@hotmail.com.ar", "@msn.com.ar", "@gmail.com" };
- //new const szBlockCharacters [ ] [ ] = { "'", "^"", "%", "#", "(", ")", "/" };
- new g_contra[33][20], g_contra2[33][20], g_cuenta[33][32], g_Fecha[33][32], g_Ip[33][32];
- new g_vault;
- new g_Estado[33], g_Can[33], g_AutoLogueo[33]
- new g_Experiencia [ 33 ], g_Level [ 33 ], g_Reset [ 33 ];
- enum {
- FECHA,
- PASSWORD,
- IP,
- AUTOLOG,
- LEVEL,
- EXPERIENCIA,
- RESET,
- PUNTOS,
- DATA_M
- };
- enum {
- NOREGISTRADO = 0,
- REGISTRADO,
- LOGUEADO,
- ESTADOS
- };
- new const Estado[ESTADOS][] = { "Sin Registrar", "Registrado", "Logueado" };
- new g_campo[DATA_M];
- new g_Puntos [ 33 ];
- new g_iTienda [ 33 ] [ 32 ];
- new g_iSyncHUD;
- const HNS_TASKID = 1037;
- const TASK_HUD = 2018;
- #define HUD_PRINCIPAL (taskid-TASK_HUD)
- public plugin_init ( ) {
- register_plugin ( "[HNS] Hiden Seek", "1.0", "heNK'" );
- //Hamsandwich
- RegisterHam ( Ham_Spawn, "player", "HamPlayerSpawned", 1 );
- //Events
- register_event ( "HLTV", "eventRoundStart", "a", "1=0", "2=0" );
- register_event ( "SendAudio", "AntiTerroristWin", "a", "1=0", "2=%!MRAD_ctwin" );
- register_event ( "SendAudio", "TerroristWin", "a", "1=0", "2=%!MRAD_terwin" );
- //Forwards
- register_forward ( FM_CmdStart, "fwdCmdStart", 0 );
- register_forward ( FM_PlayerPreThink, "fwdPlayerPreThink", 0 );
- register_forward ( FM_ClientKill, "fwdClientKill" );
- //Block Command
- for ( new block = 1; block < sizeof ( ComandosABloquear ); block++ )
- register_clcmd ( ComandosABloquear [ block ], "RegisterCommandBlock" );
- register_message ( get_user_msgid ( "ShowMenu" ), "MessageVGUIMenu" );
- register_message ( get_user_msgid ( "VGUIMenu" ), "MessageVGUIMenu" );
- register_message ( get_user_msgid ( "StatusIcon" ), "msgStatusIcon" );
- //Register Command
- register_clcmd ( "say", "cmdSay" );
- register_clcmd ( "say /cuenta", "cmdCuenta" );
- register_clcmd ( "INGRESAR_PASSWORD", "INGRESAR_PASSWORD" );
- register_clcmd ( "chooseteam", "cmdMenu" );
- //HUDS
- g_iSyncHUD = CreateHudSyncObj ( );
- //Hookeos
- register_forward ( FM_ClientUserInfoChanged, "fw_ClientInfoChanged" );
- //Register pCvars
- g_pCvar_Conteo = register_cvar ( "hns_conteo", "10", ADMIN_BAN );
- g_pCvar_Item_HNS_Fb = register_cvar ( "hns_item_fb", "1", ADMIN_BAN );
- g_pCvar_Item_HNS_He = register_cvar ( "hns_item_he", "0", ADMIN_BAN );
- g_pCvar_Item_HNS_Sg = register_cvar ( "hns_item_sg", "1", ADMIN_BAN );
- g_pCvar_Prefix = register_cvar ( "hns_prefix", "!g[HNS]!y", ADMIN_RCON );
- //ADV VAULT SYSTEM
- g_vault = adv_vault_open("CuentasHNS", false);
- g_campo[FECHA] = adv_vault_register_field(g_vault, "FECHA", DATATYPE_STRING, 32);
- g_campo[PASSWORD] = adv_vault_register_field(g_vault, "PW", DATATYPE_STRING, 20);
- g_campo[IP] = adv_vault_register_field(g_vault, "IP", DATATYPE_STRING, 32)
- g_campo[AUTOLOG] = adv_vault_register_field(g_vault, "AUTOLOG")
- g_campo[LEVEL] = adv_vault_register_field(g_vault, "LEVEL" );
- g_campo[EXPERIENCIA] = adv_vault_register_field(g_vault, "EXPERIENCIA" );
- g_campo[RESET] = adv_vault_register_field(g_vault, "RESET" );
- g_campo[PUNTOS] = adv_vault_register_field(g_vault, "PUNTOS");
- adv_vault_init(g_vault);
- }
- public plugin_natives ( ) {
- register_native ( "hns_set_xp", "native_hns_set_xp", 1 );
- register_native ( "hns_set_nivel", "native_hns_set_nivel", 1 );
- }
- public plugin_cfg ( ) {
- new iConfig [ 33 ];
- get_configsdir ( iConfig, 32 );
- get_pcvar_string ( g_pCvar_Prefix, szPrefix, 32 );
- server_cmd ( "exec %s/HidenSeek.cfg", iConfig );
- }
- public client_putinserver ( iIndex ) {
- get_user_name ( iIndex, g_cuenta [ iIndex ], sizeof ( g_cuenta ) );
- get_time ( "%c", g_Fecha [ iIndex ], sizeof ( g_Fecha ) );
- g_contra [ iIndex ] [ 0 ] = '^0';
- g_Estado [ iIndex ] = NOREGISTRADO;
- g_Experiencia [ iIndex ] = 0;
- g_Level [ iIndex ] = 1;
- g_Can [ iIndex ] = 0;
- g_Reset [ iIndex ] = 0;
- g_Puntos [ iIndex ] = 0;
- set_task ( 6.0, "ClientHUD", iIndex + TASK_HUD, _, _, "b" );
- CheckLevel ( iIndex );
- Cargar ( iIndex );
- //set_task ( 0.1, "IngresarTeam", iIndex );
- }
- public ClientHUD ( taskid ) {
- //set_hudmessage(255, 0, 0, 0.0, 0.0, 0, 6.0, 12.0)
- static iIndex;
- iIndex = HUD_PRINCIPAL;
- if ( g_Estado [ iIndex ] != LOGUEADO )
- return;
- set_hudmessage ( 210, 127, 210, 0.0, 0.0, 1, 6.0, 12.0 );
- //ShowSyncHudMsg(id, g_MsgSync_Hud, "Nivel: %d - Reset: %d - Experiencia: %s (%0.2f%%)", p_nivel[id], p_reset[id], addpoints(p_exp[id][EXP_NORMAL]), float(p_exp[id][EXP_LEVEL] * 100) / pExpForNextLevel(id))
- ShowSyncHudMsg ( HUD_PRINCIPAL, g_iSyncHUD, "==================BREAKING GAMING==================^n^t^tTu Cuenta: %s - Puntos: %d^n^t^tNivel: %d - ^t^tExperiencia: %s (%0.2f%%)^n==================BREAKING GAMING==================^n", g_cuenta [ iIndex ], g_Puntos [ iIndex ], g_Level [ iIndex ], AddComas ( g_Experiencia [ iIndex ] ), float ( g_Experiencia [ iIndex ] * 100 ) / ExpForNextLevel ( iIndex ) );
- //ShowSyncHudMsg ( HUD_PRINCIPAL, g_iSyncHUD, "==================BREAKING GAMING==================^n^t^tTu Cuenta: %s - Puntos: %d^n^t^tNivel: %d - ^t^tExperiencia: %s^n==================BREAKING GAMING==================^n", g_cuenta [ iIndex ], g_Puntos [ iIndex ], g_Level [ iIndex ], AddComas ( g_Experiencia [ iIndex ] ) );
- }
- public cmdCuenta ( id ) {
- new Tit[128], Msg[128]
- formatex(Tit, charsmax(Tit), "Sistema de cuentas by \dkikizon^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,"HandlerCuentasMenu");
- 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^n":"\dCambiar Contra^n", "3");
- formatex(Msg, charsmax(Msg),"%sAutologueo \d[\r%s\d]", g_Estado[id] == LOGUEADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id])?"\w":"\d", g_AutoLogueo[id]?"SI":"NO")
- menu_additem(menu, Msg, "4")
- menu_display(id, menu, 0);
- }
- public HandlerCuentasMenu ( id, menu ,item ) {
- 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(id, print_center, "Ingresa tu PASSWORD para entrar a tu cuenta");
- client_cmd(id,"messagemode INGRESAR_PASSWORD");
- } else {
- client_print(id, print_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(id, print_center, "Ingresa una PASSWORD para crear una cuenta");
- client_cmd(id,"messagemode INGRESAR_PASSWORD");
- } else {
- client_print(id, print_center, "No puedes elegir esta opcion");
- return PLUGIN_HANDLED;
- }
- }
- case 2: {
- if(g_Estado[id] == LOGUEADO && !g_Can[id]) {
- client_print(id, print_center, "Ingresa tu nueva PASSWORD");
- client_cmd(id,"messagemode INGRESAR_PASSWORD");
- } else {
- client_print(id, print_center, "No estas logueado o ya cambiaste tu password durante el mapa");
- return PLUGIN_HANDLED;
- }
- }
- case 3: {
- if(g_Estado[id] == LOGUEADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id])) {
- if(g_AutoLogueo[id]) {
- g_AutoLogueo[id] = 0
- cmdCuenta(id)
- } else {
- g_AutoLogueo[id] = 1
- cmdCuenta(id)
- }
- } else {
- client_print(id, print_center, "No puedes elegir esta opcion");
- return PLUGIN_HANDLED;
- }
- }
- }
- return PLUGIN_HANDLED;
- }
- public Confirmar(id) {
- new Tit[128];
- formatex(Tit, charsmax(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(menu, MPROP_EXIT, MEXIT_NEVER);
- menu_display(id, menu, 0);
- }
- public menu_confirmar(id, menu, item) {
- switch(item) {
- case 0: {
- switch(g_Estado[id]) {
- case LOGUEADO: {
- copy(g_contra[id], 19 ,g_contra2[id]);
- Guardar(id);
- client_print(id, print_center, "Tu password ha sido cambiada satisfactoriamente");
- g_Can[id] = 1;
- }
- case NOREGISTRADO: {
- client_print(id, print_center, "Tu cuenta ha sido creada satisfactoriamente");
- copy(g_contra[id], 31, g_contra2[id]);
- Guardar(id);
- jTeam(id);
- }
- }
- }
- case 1: {
- menu_destroy(menu);
- client_cmd(id,"messagemode INGRESAR_PASSWORD");
- if(g_Estado[id] == LOGUEADO)
- client_print(id, print_center, "Ingresa tu nueva PASSWORD");
- else
- client_print(id, print_center, "Ingresa la PASSWORD para tu nueva cuenta");
- }
- }
- return PLUGIN_HANDLED;
- }
- public INGRESAR_PASSWORD ( 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]," ") != -1 ) {
- client_print(id, print_center, "Tu password contiene errores");
- return 1;
- }
- switch(g_Estado[id]) {
- case NOREGISTRADO: {
- client_print(id, print_center, "Confirma tu password para proseguir");
- copy(g_contra2[id], charsmax(g_contra2), g_contra[id]);
- Confirmar(id);
- }
- case REGISTRADO: {
- new buffer[40];
- adv_vault_get_prepare(g_vault, _, g_cuenta[id]);
- adv_vault_get_field(g_vault, g_campo[PASSWORD], buffer, charsmax(buffer));
- if(equal(buffer, g_contra[id])) {
- Guardar(id);
- client_print(id, print_center, "Te logueaste satisfactoriamente en tu cuenta");
- jTeam(id);
- } else {
- cmdCuenta(id);
- client_print(id, print_center, "Password Incorrecta.");
- }
- }
- case LOGUEADO: {
- if(g_Can[id]) {
- client_print(id, print_center, "Ya cambiaste tu contra en este mapa");
- return PLUGIN_HANDLED;
- }
- client_print(id, print_center, "Confirma tu password para cambiarla...");
- copy(g_contra2[id], charsmax(g_contra2), g_contra[id]);
- Confirmar(id);
- }
- }
- return PLUGIN_HANDLED;
- }
- public cmdPuntos ( iIndex) {
- Henk_SayPrint ( iIndex, "%s Tienes %d Puntos", szPrefix, g_Puntos [ iIndex ] );
- }
- public fw_ClientInfoChanged ( iIndex, iBuffer ) {
- if ( !is_user_connected ( iIndex ) )
- return FMRES_IGNORED;
- if ( g_Estado [ iIndex ] == LOGUEADO ) {
- new iOldName [ 33 ];
- engfunc ( EngFunc_InfoKeyValue, iBuffer, "name", iOldName, 32 );
- if ( equal ( iOldName, g_cuenta [ iIndex ] ) )
- return FMRES_IGNORED;
- set_user_info ( iIndex, "name", g_cuenta [ iIndex ] );
- client_cmd ( iIndex, "setinfo ^"name^" ^"%s^"", g_cuenta [ iIndex ] );
- }
- return FMRES_IGNORED;
- }
- public MessageVGUIMenu(msgid, dest, id) {
- if(g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id])) {
- if(g_AutoLogueo[id]) {
- new ip[32];
- get_user_ip(id, ip, charsmax(ip), 1);
- if(equal(g_Ip[id], ip))
- set_task(2.0, "jTeam", id)
- else {
- client_print(id, print_chat, "Tu ip no es igual a la de tu ultima visita :O");
- cmdCuenta(id);
- }
- } else
- cmdCuenta(id)
- } else
- cmdCuenta(id);
- return 1;
- }
- public jTeam ( id ) {
- static teammsg_block, teammsg_block_vgui, restore, vgui;
- restore = get_pdata_int(id, 510);
- vgui = restore & (1<<0);
- if (vgui)
- set_pdata_int(id, 510, restore & ~(1<<0));
- teammsg_block = get_msg_block(get_user_msgid("ShowMenu"));
- teammsg_block_vgui = get_msg_block(get_user_msgid("VGUIMenu"));
- set_msg_block(get_user_msgid("ShowMenu"), BLOCK_ONCE);
- set_msg_block(get_user_msgid("VGUIMenu"), BLOCK_ONCE);
- engclient_cmd(id, "jointeam", "5");
- engclient_cmd(id, "joinclass", "5");
- set_msg_block(get_user_msgid("ShowMenu"), teammsg_block);
- set_msg_block(get_user_msgid("VGUIMenu"), teammsg_block_vgui);
- if (vgui)
- set_pdata_int(id, 510, restore);
- g_Estado[id] = LOGUEADO;
- }
- public cmdMenu ( iIndex ) {
- if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
- return PLUGIN_HANDLED;
- new iTitle [ 127 ]; format ( iTitle, sizeof ( iTitle ), "\y[BREAKING GAMING] \wBienvenido \y%s^n\wNivel \y%d \wExperiencia: \y%s", g_cuenta [ iIndex ], g_Level [ iIndex ], AddComas ( str_to_num ( g_Experiencia [ iIndex ] ) ) );
- //len += formatex(szText[len], charsmax(szText) - len, "\r5. \wReset\d (%0.2f%%)^n^n", (float(p_exp[id][EXP_NORMAL]) * 100.0) / pMaxExp(id, p_reset[id]))//
- new iReset [ 127 ]; format ( iReset, sizeof ( iReset ), "Reset: \d(%0.2f%%)", (float(g_Experiencia [ iIndex ] ) * 100.0 ) / MaxExp ( iIndex, g_Reset [ iIndex ] ) );
- new iMenu = menu_create ( iTitle, "HandlerMenuPrincipal" );
- menu_additem ( iMenu, "Tienda \y[HNS]" );
- menu_additem ( iMenu, "Extras" );
- menu_additem ( iMenu, "Compras" );
- menu_additem ( iMenu, "Party" );
- menu_addblank ( iMenu, 0 );
- menu_additem ( iMenu, iReset );
- menu_additem ( iMenu, "Menu Admin" );
- menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
- menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
- menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
- menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
- menu_display ( iIndex, iMenu );
- return PLUGIN_HANDLED;
- }
- public HandlerMenuPrincipal ( iIndex, iMenu, iItem ) {
- if ( iItem == MENU_EXIT ) {
- menu_destroy ( iMenu );
- return PLUGIN_HANDLED;
- }
- switch ( iItem ) {
- case 0: menu_shop ( iIndex );
- }
- return PLUGIN_HANDLED;
- }
- public menu_shop ( iIndex ) {
- new iMenu = menu_create ( "\y[BREAKING GAMING] \wShop Menu \d[HNS]", "HandlerShopMenu" );
- menu_additem ( iMenu, "Compras \r[TT]" );
- menu_additem ( iMenu, "Compras \y[CT]" );
- menu_additem ( iMenu, "Compras \d[GENERALES]" );
- menu_display ( iIndex, iMenu );
- }
- public HandlerShopMenu ( iIndex, iMenu, iItem ) {
- if ( iItem == MENU_EXIT ) {
- menu_destroy ( iMenu );
- return PLUGIN_HANDLED;
- }
- switch ( iItem ) {
- case 0: menu_compras_tt ( iIndex );
- case 1: menu_compras_ct ( iIndex );
- case 2: menu_compras_gen ( iIndex );
- }
- return PLUGIN_HANDLED;
- }
- public menu_compras_tt ( iIndex ) {
- if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
- return;
- if ( ! ( cs_get_user_team ( iIndex ) == CS_TEAM_T ) ) {
- Henk_SayPrint ( iIndex, "%s No eres !gTT", szPrefix );
- return;
- }
- new iMenu = menu_create ( "\y[BREAKING GAMING] \wCompras \r[TT]", "HandlerComprasTT" );
- new iTitle [ 127 ];
- new iNum [ 22 ];
- for ( new i = 0; i < sizeof ( szComprasTT ); i++ ) {
- if ( g_iTienda [ iIndex ] [ i ] )
- formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasTT [ i ] [ COMPRAS_ITEM ], szComprasTT [ i ] [ COMPRAS_COSTO ] );
- else {
- if ( g_Puntos [ iIndex ] >= szComprasTT [ i ] [ COMPRAS_COSTO ] )
- formatex ( iTitle, sizeof ( iTitle ), "\y%s \wPuntos: \d%d", szComprasTT [ i ] [ COMPRAS_ITEM ], szComprasTT [ i ] [ COMPRAS_COSTO ] );
- else
- formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasTT [ i ] [ COMPRAS_ITEM ], szComprasTT [ i ] [ COMPRAS_COSTO ] );
- }
- num_to_str ( i, iNum, 2 );
- menu_additem ( iMenu, iTitle, iNum );
- }
- menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
- menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
- menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
- menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
- menu_display ( iIndex, iMenu );
- return;
- }
- public HandlerComprasTT ( iIndex, iMenu, iItem ) {
- if ( iItem == MENU_EXIT ) {
- menu_destroy ( iMenu );
- return;
- }
- static iHealth;
- iHealth = get_user_health ( iIndex );
- if ( g_Puntos [ iIndex ] >= szComprasTT [ iItem ] [ COMPRAS_COSTO ] ) {
- g_Puntos [ iIndex ] -= szComprasTT [ iItem ] [ COMPRAS_COSTO ] ;
- }
- else {
- Henk_SayPrint ( iIndex, "%s Te faltan !g%d !ypuntos para comprar !g%s", szPrefix, szComprasTT [ iItem ] [ COMPRAS_COSTO ] - g_Puntos [ iIndex ], szComprasTT [ iItem ] [ COMPRAS_ITEM ] );
- menu_compras_tt ( iIndex );
- return;
- }
- switch ( iItem ) {
- case CAMUFLAJE_TT: {
- if ( g_iTienda [ iIndex ] [ 0 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 0 ] = true;
- cs_set_user_model ( iIndex, "gsg9" );
- set_task ( 10.0, "RemoverCamuflaje", iIndex );
- Henk_SayPrint ( iIndex, "%s Compraste camuflaje durante 10 segundos", szPrefix );
- }
- case DEAGLE_TT: {
- if ( g_iTienda [ iIndex ] [ 1 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 1 ] = true;
- give_item ( iIndex, "weapon_deagle" );
- Henk_SayPrint ( iIndex, "%s Compraste DEAGLE 1 bala", szPrefix );
- }
- case VIDA_TT: {
- if ( g_iTienda [ iIndex ] [ 2 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 2 ] = true;
- set_user_health ( iIndex, iHealth + 35 );
- Henk_SayPrint ( iIndex, "%s Se te sumo 35 de vida", szPrefix );
- }
- case FROST_GRENADE_TT: {
- if ( g_iTienda [ iIndex ] [ 3 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 3 ] = true;
- give_item ( iIndex, "weapon_smokegrenade" );
- Henk_SayPrint ( iIndex, "%s Compraste Frost Grenade", szPrefix );
- }
- case VELOCIDAD_TT: {
- if ( g_iTienda [ iIndex ] [ 4 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 4 ] = true;
- set_user_maxspeed ( iIndex, 350.0 );
- set_task ( 15.0, "RemoverVelocidad", iIndex );
- Henk_SayPrint ( iIndex, "%s Compraste Velocidad", szPrefix );
- }
- case REVIVIR_TT: {
- if ( g_iTienda [ iIndex ] [ 5 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 5 ] = true;
- ExecuteHamB ( Ham_CS_RoundRespawn, iIndex );
- Henk_SayPrint ( iIndex, "%s Reviviste!!", szPrefix );
- }
- case GODMODE_TT: {
- if ( g_iTienda [ iIndex ] [ 6 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 6 ] = true;
- set_user_godmode ( iIndex, 1 );
- set_task ( 5.0, "RemoverGodmode", iIndex );
- }
- case NOCLIP_TT: {
- if ( g_iTienda [ iIndex ] [ 7 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 7 ] = true;
- set_user_noclip ( iIndex, 1 );
- set_task ( 5.0, "RemoverNoclip", iIndex );
- }
- }
- return;
- }
- public menu_compras_ct ( iIndex ) {
- if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
- return;
- if ( ! ( cs_get_user_team ( iIndex ) == CS_TEAM_CT ) ) {
- Henk_SayPrint ( iIndex, "%s No eres !gCT", szPrefix );
- return;
- }
- new iMenu = menu_create ( "\y[BREAKING GAMING] \wCompras \y[CT]", "HandlerComprasCT" );
- new iTitle [ 127 ];
- new iNum [ 22 ];
- for ( new i = 0; i < sizeof ( szComprasCT ); i++ ) {
- if ( g_iTienda [ iIndex ] [ i ] )
- formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasCT [ i ] [ COMPRAS_ITEM ], szComprasCT [ i ] [ COMPRAS_COSTO ] );
- else {
- if ( g_Puntos [ iIndex ] >= szComprasCT [ i ] [ COMPRAS_COSTO ] )
- formatex ( iTitle, sizeof ( iTitle ), "\y%s \wPuntos: \d%d", szComprasCT [ i ] [ COMPRAS_ITEM ], szComprasCT [ i ] [ COMPRAS_COSTO ] );
- else
- formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasCT [ i ] [ COMPRAS_ITEM ], szComprasCT [ i ] [ COMPRAS_COSTO ] );
- }
- num_to_str ( i, iNum, 2 );
- menu_additem ( iMenu, iTitle, iNum );
- }
- menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
- menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
- menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
- menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
- menu_display ( iIndex, iMenu );
- return;
- }
- public HandlerComprasCT ( iIndex, iMenu, iItem ) {
- if ( iItem == MENU_EXIT ) {
- menu_destroy ( iMenu );
- return;
- }
- static iHealth, iArmor;
- iHealth = get_user_health ( iIndex );
- iArmor = get_user_armor ( iIndex );
- if ( g_Puntos [ iIndex ] >= szComprasCT [ iItem ] [ COMPRAS_COSTO ] ) {
- g_Puntos [ iIndex ] -= szComprasCT [ iItem ] [ COMPRAS_COSTO ] ;
- }
- else {
- Henk_SayPrint ( iIndex, "%s Te faltan !g%d !ypuntos para comprar !g%s", szPrefix, szComprasCT [ iItem ] [ COMPRAS_COSTO ] - g_Puntos [ iIndex ], szComprasCT [ iItem ] [ COMPRAS_ITEM ] );
- menu_compras_ct ( iIndex );
- return;
- }
- switch ( iItem ) {
- case HE_GRENADE_CT: {
- if ( g_iTienda [ iIndex ] [ 0 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 0 ] = true;
- give_item ( iIndex, "weapon_hegrenade" );
- Henk_SayPrint ( iIndex, "%s Compraste una HE Grenade", szPrefix );
- }
- case FROST_GRENADE_CT: {
- if ( g_iTienda [ iIndex ] [ 1 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 1 ] = true;
- give_item ( iIndex, "weapon_smokegrenade" );
- Henk_SayPrint ( iIndex, "%s Compraste una Frost Grenade", szPrefix );
- }
- case DEAGLE_CT: {
- if ( g_iTienda [ iIndex ] [ 2 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 2 ] = true;
- give_item ( iIndex, "weapon_deagle" );
- Henk_SayPrint ( iIndex, "%s Compraste una Deagle!", szPrefix );
- }
- case CHALECO_CT:{
- if ( g_iTienda [ iIndex ] [ 3 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 3 ] = true;
- set_user_armor ( iIndex, iArmor + 100 );
- Henk_SayPrint ( iIndex, "%s Compraste chaleco +100", szPrefix );
- }
- case VIDA_CT: {
- if ( g_iTienda [ iIndex ] [ 4 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 4 ] = true;
- set_user_armor ( iIndex, iHealth + 40 );
- Henk_SayPrint ( iIndex, "%s Compraste chaleco +40", szPrefix );
- }
- case REVIVIR_CT: {
- if ( g_iTienda [ iIndex ] [ 5 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 5 ] = true;
- ExecuteHamB ( Ham_CS_RoundRespawn, iIndex );
- Henk_SayPrint ( iIndex, "%s REVIVISTE!!!!", szPrefix );
- }
- case GODMODE_CT: {
- if ( g_iTienda [ iIndex ] [ 6 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 6 ] = true;
- set_user_godmode ( iIndex, 1 );
- set_task ( 5.0, "RemoverGodmode", iIndex );
- Henk_SayPrint ( iIndex, "%s Compraste Modo Dios(5Segundos)", szPrefix );
- }
- case NOCLIP_CT: {
- if ( g_iTienda [ iIndex ] [ 7 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 7 ] = true;
- set_user_noclip ( iIndex, 1 );
- set_task ( 5.0, "RemoverNoclip", iIndex );
- Henk_SayPrint ( iIndex, "%s Compraste NOCLIP(5Segundos)", szPrefix );
- }
- }
- return;
- }
- public menu_compras_gen ( iIndex ) {
- if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
- return;
- new iMenu = menu_create ( "\y[BREAKING GAMING] \wCompras \d[GENERALES]", "HandlerComprasGEN" );
- new iTitle [ 127 ];
- new iNum [ 22 ];
- for ( new i = 0; i < sizeof ( szComprasGEN ); i++ ) {
- if ( g_iTienda [ iIndex ] [ i ] )
- formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasGEN [ i ] [ COMPRAS_ITEM ], szComprasGEN [ i ] [ COMPRAS_COSTO ] );
- else {
- if ( g_Puntos [ iIndex ] >= szComprasGEN [ i ] [ COMPRAS_COSTO ] )
- formatex ( iTitle, sizeof ( iTitle ), "\y%s \wPuntos: \d%d", szComprasGEN [ i ] [ COMPRAS_ITEM ], szComprasGEN [ i ] [ COMPRAS_COSTO ] );
- else
- formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasGEN [ i ] [ COMPRAS_ITEM ], szComprasGEN [ i ] [ COMPRAS_COSTO ] );
- }
- num_to_str ( i, iNum, 2 );
- menu_additem ( iMenu, iTitle, iNum );
- }
- menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
- menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
- menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
- menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
- menu_display ( iIndex, iMenu );
- return;
- }
- public HandlerComprasGEN ( iIndex, iMenu, iItem ) {
- if ( iItem == MENU_EXIT ) {
- menu_destroy ( iMenu );
- return;
- }
- if ( g_Puntos [ iIndex ] >= szComprasGEN [ iItem ] [ COMPRAS_COSTO ] ) {
- g_Puntos [ iIndex ] -= szComprasGEN [ iItem ] [ COMPRAS_COSTO ] ;
- }
- else {
- Henk_SayPrint ( iIndex, "%s Te faltan !g%d !ypuntos para comprar !g%s", szPrefix, szComprasGEN [ iItem ] [ COMPRAS_COSTO ] - g_Puntos [ iIndex ], szComprasGEN [ iItem ] [ COMPRAS_ITEM ] );
- menu_compras_gen ( iIndex );
- return;
- }
- switch ( iItem ) {
- case DANIO_GEN: {
- }
- case VIDA_GEN: {
- if ( g_iTienda [ iIndex ] [ 1 ] ) {
- Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
- g_Puntos [ iIndex ] += szComprasGEN [ iItem ] [ COMPRAS_COSTO ];
- return;
- }
- g_iTienda [ iIndex ] [ 1 ] = true;
- set_user_health ( iIndex, 200 );
- Henk_SayPrint ( iIndex, "%s Tienes !g200HP", szPrefix );
- }
- case AUTOBUNNY_GEN: {
- }
- case GRAVEDAD_GEN: {
- }
- }
- return;
- }
- public RemoverCamuflaje ( iIndex ) {
- cs_reset_user_model ( iIndex );
- Henk_SayPrint ( iIndex, "%s El camuflaje se te termino", szPrefix );
- }
- public RemoverVelocidad ( iIndex ) {
- set_user_maxspeed ( iIndex, 250.0 );
- Henk_SayPrint ( iIndex, "%s La velocidad se te termino", szPrefix );
- }
- public RemoverGodmode ( iIndex ) {
- set_user_godmode ( iIndex, 0 );
- Henk_SayPrint ( iIndex, "%s El Modo Dios se te termino", szPrefix );
- }
- public RemoverNoclip ( iIndex ) {
- set_user_noclip ( iIndex, 0 );
- Henk_SayPrint ( iIndex, "%s El Noclip se te termino", szPrefix );
- }
- public fwdClientKill ( ) {
- return FMRES_SUPERCEDE;
- }
- public plugin_precache ( )
- register_forward ( FM_Spawn, "fwdSpawn", 0 );
- public client_command ( iIndex ) {
- new Argv [ 17 ];
- read_argv ( 0, Argv, sizeof ( Argv ) );
- for ( new i = 0; i < sizeof ( BuyCommands ); i++ ) {
- if ( equali ( BuyCommands [ i ], Argv, 0 ) )
- return PLUGIN_HANDLED;
- }
- return PLUGIN_CONTINUE;
- }
- public client_disconnect ( iIndex ) {
- Guardar ( iIndex );
- remove_task ( iIndex + TASK_HUD );
- }
- public client_impulse ( iIndex, iImpulse ) {
- if ( iImpulse == 101 ) {
- Henk_SayPrint ( iIndex, "%s No puedes usar la linterna", szPrefix );
- }
- if ( iImpulse == 201 ) {
- Henk_SayPrint ( iIndex, "%s No puedes hacer graffitis!", szPrefix );
- }
- return PLUGIN_HANDLED;
- }
- public IngresarTeam ( iIndex ) {
- engclient_cmd ( iIndex, "jointeam", "5" );
- engclient_cmd ( iIndex, "joinclass", "5" );
- }
- public msgStatusIcon ( msgId, msgDest, msgEnt ) {
- new Icon [ 8 ];
- get_msg_arg_string ( 2, Icon, sizeof ( Icon ) );
- if ( equal ( Icon, "buyzone" ) ) {
- if ( get_msg_arg_int ( 1 ) ) {
- set_pdata_int ( msgEnt, 235, get_pdata_int ( msgEnt, 235 ) & ~( 1 << 0 ) );
- return PLUGIN_HANDLED;
- }
- }
- return PLUGIN_CONTINUE;
- }
- public TerroristWin ( ) {
- set_hudmessage ( 255, 0, 0, 0.0, 0.1, 0, 6.0, 12.0 );
- show_hudmessage ( 0, "TTs Ganan - Sigue la ronda" );
- }
- public AntiTerroristWin ( ) {
- set_hudmessage ( 255, 0, 0, 0.0, 0.1, 0, 6.0, 12.0 );
- show_hudmessage ( 0, "CTs Ganan - Cambio de Team" );
- for ( new iIndex = 0; iIndex < get_maxplayers ( ); iIndex ++ ) {
- if ( is_user_connected ( iIndex ) ) {
- switch ( cs_get_user_team ( iIndex ) ) {
- case CS_TEAM_CT: cs_set_user_team ( iIndex, CS_TEAM_T );
- case CS_TEAM_T: cs_set_user_team ( iIndex, CS_TEAM_CT );
- }
- }
- }
- }
- public eventRoundStart ( ) {
- remove_task ( HNS_TASKID );
- Conteo = get_pcvar_num ( g_pCvar_Conteo );
- set_task ( 1.0, "ConteoHNS", HNS_TASKID, _, _, "a", g_pCvar_Conteo );
- }
- public ConteoHNS ( ) {
- Conteo--;
- new sSound [ 16 ];
- num_to_word ( Conteo, sSound, sizeof ( sSound ) );
- set_hudmessage ( 255, 0, 0, 0.0, 0.1, 0, 6.0, 12.0 );
- if ( Conteo ) {
- show_hudmessage ( 0, "Quedan %d segundo%s", Conteo, Conteo > 1 ? "s" : "" );
- client_cmd ( 0, "spk vox/%s.wav", sSound );
- for ( new i = 0; i < get_maxplayers ( ); i++ ) {
- if ( !is_user_alive ( i ) || cs_get_user_team ( i ) != CS_TEAM_CT )
- continue;
- ScreenFade ( i, 1.0, 0, 0, 0, 100 );
- //ScreenFade ( i, 1.0, 0, 0, 0, 100 );
- }
- }
- else {
- remove_task ( HNS_TASKID );
- show_hudmessage ( 0, "Tiempo terminado" );
- for ( new i = 0; i < get_maxplayers ( ); i++ ) {
- SetWeapons ( i );
- if ( !is_user_alive ( i ) || cs_get_user_team ( i ) != CS_TEAM_CT )
- continue;
- engfunc ( EngFunc_SetClientMaxspeed, i, 250.0 );
- set_pev ( i, pev_maxspeed, 250.0 );
- }
- }
- }
- public SetWeapons ( iIndex ) {
- if ( is_user_alive ( iIndex ) ) {
- if ( cs_get_user_team ( iIndex ) == CS_TEAM_T ) {
- if ( get_pcvar_num ( g_pCvar_Item_HNS_Fb ) )
- fm_give_item ( iIndex, "weapon_flashbang" );
- if ( get_pcvar_num ( g_pCvar_Item_HNS_He ) )
- fm_give_item ( iIndex, "weapon_hegrenade" );
- if ( get_pcvar_num ( g_pCvar_Item_HNS_Sg ) )
- fm_give_item ( iIndex, "weapon_smokegrenade" );
- }
- }
- }
- public HamPlayerSpawned ( iIndex ) {
- if ( is_user_alive ( iIndex ) ) {
- fm_strip_user_weapons ( iIndex );
- fm_give_item ( iIndex, "weapon_knife" );
- }
- }
- //Gonza.-*
- public fwdCmdStart ( id, ucHandle, seed )
- {
- if (get_user_weapon(id) != CSW_KNIFE) return FMRES_IGNORED
- static CsTeams:team, button; team = cs_get_user_team(id); button = get_uc(ucHandle, UC_Buttons);
- //static CsTeams:team[33]; team[id] = cs_get_user_team(id)
- if ( team == CS_TEAM_T )
- {
- if (button&IN_ATTACK) button &= ~IN_ATTACK
- if (button&IN_ATTACK2) button &= ~IN_ATTACK2
- set_uc(ucHandle, UC_Buttons, button)
- return FMRES_SUPERCEDE
- }
- else if (team == CS_TEAM_CT )
- {
- if (button&IN_ATTACK) button |= IN_ATTACK2
- set_uc(ucHandle, UC_Buttons, button)
- return FMRES_SUPERCEDE
- }
- return FMRES_IGNORED
- }
- public fwdSpawn(ent) {
- if( !pev_valid(ent) || ent == engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "hostage_entity")))
- return FMRES_IGNORED;
- new sClass[32];
- pev(ent, pev_classname, sClass, 31);
- for( new i = 0; i < sizeof(RemoveEntity); i++) {
- if( equal(sClass, RemoveEntity[i])) {
- engfunc(EngFunc_RemoveEntity, ent);
- return FMRES_SUPERCEDE;
- }
- }
- return FMRES_IGNORED;
- }
- public fwdPlayerPreThink ( iIndex ) {
- if ( is_user_alive ( iIndex ) ) {
- if ( Conteo >= 1 && cs_get_user_team ( iIndex ) == CS_TEAM_CT ) {
- set_pev ( iIndex, pev_maxspeed, -1.0);
- set_pev ( iIndex, pev_velocity, Float:{0.0, 0.0, 0.0} );
- }
- }
- }
- public RegisterCommandBlock ( iIndex ) {
- console_print ( iIndex, "No puedes hacer esto..." );
- return PLUGIN_HANDLED;
- }
- public cmdSay ( iIndex ) {
- new Say [ 192 ];
- read_args ( Say, sizeof ( Say ) );
- remove_quotes ( Say );
- //Valid Message
- if ( Say [ 0 ] == '#' || Say [ 0 ] == '%' || equal ( Say, "" ) )
- return PLUGIN_HANDLED;
- if ( equal ( Say, "/menu" ) || equal ( Say, "menu" ) ) cmdMenu ( iIndex );
- else if ( equal ( Say, "/puntos" ) ) cmdPuntos ( iIndex );
- new Prefix [ 256 ];
- new Color [ 11 ];
- get_user_team ( iIndex, Color, sizeof ( Color ) );
- //formatex ( Prefix, sizeof ( Prefix ), "%s%s^x03 %s", is_user_alive ( iIndex ) ? "^x01" : "^x01*MUERTO* ", is_user_admin ( iIndex ) ? "^x04[ADMIN]" : "", g_PlayerName [ iIndex ] );
- formatex ( Prefix, sizeof ( Prefix ), "%s^x03%s ^x04%s^x03(^x04%d^x03)", is_user_alive ( iIndex ) ? "^x01" : "^x01*MUERTO* ", g_cuenta [ iIndex ], g_Reset [ iIndex ], g_Level [ iIndex ] );
- //formatex ( Prefix, sizeof ( Prefix ), "%s^x03 %s", is_user_alive ( iIndex ) ? "^x01" : "^x01*MUERTO* ", g_PlayerName [ iIndex ] );
- if ( is_user_admin ( iIndex ) )
- format ( Say, sizeof ( Say ), "^x04%s", Say );
- format ( Say, sizeof ( Say ), "%s^x01 : %s", Prefix, Say );
- new team [ 11 ];
- for ( new i = 1; i <= get_maxplayers ( ); i++ ) {
- if ( is_user_connected ( i ) ) {
- if ( is_user_admin ( i ) || is_user_alive ( iIndex ) && is_user_alive ( i ) || !is_user_alive ( iIndex ) && !is_user_alive ( i ) ) {
- get_user_team ( i, team, 10 );
- changeTeamInfo ( i, Color) ;
- writeMessage ( i, Say );
- changeTeamInfo ( i, team );
- /*
- message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "SayText" ), _, i );
- write_byte ( iIndex );
- write_string ( Say );
- message_end ( );
- */
- }
- }
- }
- //return PLUGIN_HANDLED;
- return PLUGIN_HANDLED_MAIN;
- }
- public MaxLevel(index) return (245 + (g_Reset[index] * 50))
- public Float:MaxExp(index, reset)
- {
- static i, Float:level, count, Float:MaxCount; count = 1; MaxCount = 0.0; level = 0.0
- for (i = 0; i < MaxLevel(index); i++)
- {
- if (i % 40) level++
- else
- {
- count++
- level++
- }
- MaxCount += ((250.1 + ((reset+1) * 50.2)) * level * count)
- }
- return MaxCount
- }
- public Float:ExpForNextLevel(index)
- {
- static i, Float:count; count = 1.0
- for (i = 0; i < MaxLevel(index); i++)
- {
- if (i >= g_Level[index]) break
- if (i == 0) continue
- if (i % 20) continue
- else count++
- }
- return ((250.1 + ((g_Reset[index]+1) * 50.2)) * float(g_Level[index]) * count)
- }
- CheckLevel ( iIndex ) {
- if ( !is_user_connected ( iIndex ) || g_Estado [ iIndex ] != LOGUEADO )
- return;
- static count = 0;
- while ( g_Experiencia [ iIndex ] >= floatround ( ExpForNextLevel ( iIndex ) ) && g_Level [ iIndex ] < MaxLevel ( iIndex ) ) {
- g_Experiencia [ iIndex ] -= floatround ( ExpForNextLevel ( iIndex ) );
- count++;
- g_Level [ iIndex ] ++;
- }
- if ( count ) {
- Henk_SayPrint ( iIndex, "%s Subiste !g%d nivel%s !yahora estas en el !tnivel %d", szPrefix, count, count > 1 ? "es" : "", g_Level [ iIndex] );
- Guardar ( iIndex );
- }
- }
- public Guardar(id) {
- get_user_ip(id, g_Ip[id], charsmax(g_Ip), 1)
- adv_vault_set_start ( g_vault);
- adv_vault_set_field ( g_vault, g_campo[FECHA], g_Fecha[id]);
- adv_vault_set_field ( g_vault, g_campo[PASSWORD], g_contra[id]);
- adv_vault_set_field ( g_vault, g_campo[IP], g_Ip[id]);
- adv_vault_set_field ( g_vault, g_campo[AUTOLOG], g_AutoLogueo[id]);
- adv_vault_set_field ( g_vault, g_campo[LEVEL], g_Level[id] );
- adv_vault_set_field ( g_vault, g_campo[EXPERIENCIA], g_Experiencia [ id ] );
- adv_vault_set_field ( g_vault, g_campo[RESET], g_Reset [ id ] );
- adv_vault_set_field ( g_vault, g_campo[PUNTOS], g_Puntos [ id ] );
- adv_vault_set_end ( g_vault, 0, g_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;
- adv_vault_get_field(g_vault, g_campo[FECHA], g_Fecha[id], charsmax(g_Fecha[]));
- adv_vault_get_field(g_vault, g_campo[PASSWORD], g_contra[id], charsmax(g_contra[]));
- adv_vault_get_field(g_vault, g_campo[IP], g_Ip[id], charsmax(g_Ip[]));
- g_AutoLogueo[id] = adv_vault_get_field(g_vault, g_campo[AUTOLOG]);
- g_Level [ id ] = adv_vault_get_field ( g_vault, g_campo [ LEVEL ] );
- g_Experiencia [ id ] = adv_vault_get_field ( g_vault, g_campo [ EXPERIENCIA ] );
- g_Reset [ id ] = adv_vault_get_field ( g_vault, g_campo [ RESET ] );
- g_Puntos [ id ] = adv_vault_get_field ( g_vault, g_campo [ PUNTOS ] );
- }
- }
- public changeTeamInfo(player, team[])
- {
- message_begin(MSG_ONE, get_user_msgid("TeamInfo"), _, player)
- write_byte(player)
- write_string(team)
- message_end()
- }
- public writeMessage(player, say[])
- {
- message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, player)
- write_byte(player)
- write_string(say)
- message_end()
- }
- stock ScreenFade(plr, Float:fDuration, red, green, blue, alpha)
- {
- new i = plr ? plr : get_maxplayers();
- if( !i )
- {
- return 0;
- }
- message_begin(plr ? MSG_ONE : MSG_ALL, get_user_msgid( "ScreenFade"), {0, 0, 0}, plr);
- write_short(floatround(4096.0 * fDuration, floatround_round));
- write_short(floatround(4096.0 * fDuration, floatround_round));
- write_short(4096);
- write_byte(red);
- write_byte(green);
- write_byte(blue);
- write_byte(alpha);
- message_end();
- return 1;
- }
- stock RegisterSayCmdTeam ( const szSayCommand [ ], const szFunction [ ], const szFlags ) {
- new LenSay [ 127 ];
- new LenSayTeam [ 127 ];
- formatex ( LenSay, sizeof ( LenSay ), "say /%s",szSayCommand );
- formatex ( LenSayTeam, sizeof ( LenSayTeam ), "say_team /%s", szSayCommand );
- register_clcmd ( LenSay, szFunction, szFlags );
- register_clcmd ( LenSayTeam, szFunction, szFlags );
- }
- stock SetUserWeapon ( const iIndex, const szWeapon [ ], const szBalas [ ] ) {
- set_pdata_int ( fm_give_item ( iIndex, szWeapon ), 51, szBalas, 4 );
- }
- /*
- stock isCheckCaracters ( const iMail [ ] ) {
- for ( new i = 0; i <= sizeof ( szBlockCharacters ); i++ ) {
- if ( containi ( iMail, szHotmails [ i ] ) != -1 )
- return PLUGIN_HANDLED;
- }
- return PLUGIN_HANDLED;
- }
- */
- public AddComas( Num )
- {
- new szNum[15];
- num_to_str( Num, szNum, 14 );
- if( strlen(szNum[ 6 ] ) && !strlen(szNum[ 7 ] ) )
- {
- szNum[ 10 ] = szNum[ 9 ];
- szNum[ 9 ] = szNum[ 8 ];
- szNum[ 8 ] = szNum[ 7 ];
- szNum[ 7 ] = szNum[ 6 ];
- szNum[ 6 ] = szNum[ 5 ];
- szNum[ 5 ] = szNum[ 4 ];
- szNum[ 4 ] = szNum[ 3];
- szNum[ 3 ] = szNum[ 2 ];
- szNum[ 2 ] = szNum[ 1 ];
- szNum[ 5 ] = '.';
- szNum[ 1 ] = '.';
- }
- else if( strlen(szNum[ 5 ] ))
- {
- szNum[ 6 ] = szNum[ 5 ];
- szNum[ 5 ] = szNum[ 4 ];
- szNum[ 4 ] = szNum[ 3 ];
- szNum[ 3 ] = '.';
- }
- else if( strlen(szNum[ 4 ] ))
- {
- szNum[ 5 ] = szNum[ 4 ];
- szNum[ 4 ] = szNum[ 3 ];
- szNum[ 3 ] = szNum[ 2 ];
- szNum[ 2 ] = '.';
- }
- else if( strlen(szNum[ 3 ] ))
- {
- szNum[ 4 ] = szNum[ 3];
- szNum[ 3 ] = szNum[ 2 ];
- szNum[ 2 ] = szNum[ 1 ];
- szNum[ 1 ] = '.';
- }
- return szNum;
- }
- /*
- stock addpoints(number)
- {
- static str[15], strpointed[15], len, c, i, neg; c = 0
- if (number < 0)
- {
- number *= -1
- neg = 1
- }
- else neg = 0
- num_to_str(number, str, 14)
- len = strlen(str)
- strpointed = ""
- for (i = 0 ; i < len; i++)
- {
- if (i != 0 && ((len-i) % 3 == 0))
- {
- add(strpointed, 14, ".", 1)
- c++
- add(strpointed[i+c], 1, str[i], 1)
- }
- else add(strpointed[i+c], 1, str[i], 1)
- }
- if (neg) format(strpointed, charsmax(strpointed), "-%s", strpointed)
- return strpointed
- }
- */
- public native_hns_set_xp ( iIndex, iExperiencia ) {
- //set_user_exp(id, float(exp), 1, 1)
- if ( !is_user_connected ( iIndex ) || g_Estado [ iIndex ] != LOGUEADO )
- return;
- set_exp ( iIndex, float ( iExperiencia ) );
- /*
- g_Experiencia [ iIndex ] += iExperiencia;
- CheckLevel ( iIndex );
- return g_Experiencia [ iIndex ];
- */
- }
- public native_hns_set_nivel ( iIndex, iNivel ) {
- set_nivel ( iIndex, iNivel );
- /*
- g_Level [ iIndex ] += iNivel;
- CheckLevel ( iIndex );
- return g_Level [ iIndex ];
- */
- }
- stock set_exp ( iIndex, Float:Exp ) {
- static Float:ExpOriginal;
- ExpOriginal = Exp;
- if ( ExpOriginal ) g_Experiencia [ iIndex ] += floatround ( Exp );
- CheckLevel ( iIndex );
- }
- stock set_nivel ( iIndex, iNivel ) {
- static count;
- for ( count = 0; count < iNivel; count++ ) {
- if ( g_Level [ iIndex ] >= MaxLevel ( iIndex ) )
- continue;
- g_Experiencia [ iIndex ] += floatround ( ExpForNextLevel ( iIndex ) );
- g_Level [ iIndex ]++;
- Henk_SayPrint ( iIndex, "%s Subiste !g%d nivel%s", szPrefix, count, count > 1 ? "es" : "" );
- }
- CheckLevel ( iIndex );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement