Mensajes: 385
Temas: 132
Registro en: May 2018
Reputación:
1
alguien me puede hacer un hud que este bajo el radar y que diga la adrenalina rango flags del mismo rango ammo pack y que me expliquen como hago funcionar el hud para que me diga todo eso osea ya tengo los plugin de rango adrenalina y el ammo pack pero quisiera saber como hago para hacer funcionar en ese hud porfa
Mensajes: 449
Temas: 32
Registro en: Apr 2017
Reputación:
6
Código PHP: #include <amxmodx> #include <amxmisc>
#define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author"
const TASK_MAINHUD = 6385 const Float:HUD_STATS_X = 0.01 const Float:HUD_STATS_Y = 0.22 const HUD_STATS_CHANNEL = 1
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_SyncHudMsg = CreateHudSyncObj() } public client_putinserver(id) { set_task(1.0, "Hud_Main", id+TASK_MAINHUD, _, _, "b") } public Hud_Main(id) { id -= TASK_MAINHUD; set_hudmessage(255, 0, 0, HUD_STATUS_X, HUD_STATUS_Y, 0, 0.0, 0.0, 1.1, 0.0, 0.0, HUD_STATS_CHANNEL) ShowSyncHudMsg(id, g_SyncHudMsg, "Adrenalina: %d^nRango:%s^nFlag:%s^nAmmos pack:%d", Tu_Variable_de_adrenalina, Tu_Rango, Tu_flags_de_los_rangos, Tu_variable_de_ammos_pack) } public client_disconnect(id) { remove_task(id+TASK_MAINHUD) }
Adapta esto y cambia las variables del hud, asi lo tengo un plugins de niveles y funciona perfectamente.
Si no te gusta algo, cámbialo. Si no lo puedes cambiar, cambia la forma en que piensas sobre ello <3
Mensajes: 385
Temas: 132
Registro en: May 2018
Reputación:
1
(19/07/2018, 09:58 PM)Saber escribió: Código PHP: #include <amxmodx> #include <amxmisc>
#define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author"
const TASK_MAINHUD = 6385 const Float:HUD_STATS_X = 0.01 const Float:HUD_STATS_Y = 0.22 const HUD_STATS_CHANNEL = 1
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_SyncHudMsg = CreateHudSyncObj() } public client_putinserver(id) { set_task(1.0, "Hud_Main", id+TASK_MAINHUD, _, _, "b") } public Hud_Main(id) { id -= TASK_MAINHUD; set_hudmessage(255, 0, 0, HUD_STATUS_X, HUD_STATUS_Y, 0, 0.0, 0.0, 1.1, 0.0, 0.0, HUD_STATS_CHANNEL) ShowSyncHudMsg(id, g_SyncHudMsg, "Adrenalina: %d^nRango:%s^nFlag:%s^nAmmos pack:%d", Tu_Variable_de_adrenalina, Tu_Rango, Tu_flags_de_los_rangos, Tu_variable_de_ammos_pack) } public client_disconnect(id) { remove_task(id+TASK_MAINHUD) }
Adapta esto y cambia las variables del hud, asi lo tengo un plugins de niveles y funciona perfectamente.
no se mucho de adaptar el hud me podias pasar un tutoriales o algo asi para aprender porfa
Mensajes: 913
Temas: 53
Registro en: Jan 2018
Reputación:
7
¿De que mod estamos hablando o plugin?
Mensajes: 385
Temas: 132
Registro en: May 2018
Reputación:
1
(22/07/2018, 12:25 PM)El pirucho XP-007 escribió: ¿De que mod estamos hablando o plugin?
quiero adaptarle este sistema de rangos solo que diga el rango las kills q les falta para el otro rango y que diga cual otro rango biene, quiero adaptar la adrenalina solo cuando sube al 100% y mas nada que no diga combo maximo usa adrenaline nada de eso, y el ammo pack no tengo el plugin aun si me pueden ayudar adaptar eso al hud porfa
Mensajes: 546
Temas: 83
Registro en: Mar 2018
Reputación:
9
(22/07/2018, 12:30 PM)Forever123 escribió: (22/07/2018, 12:25 PM)El pirucho XP-007 escribió: ¿De que mod estamos hablando o plugin?
quiero adaptarle este sistema de rangos solo que diga el rango las kills q les falta para el otro rango y que diga cual otro rango biene, quiero adaptar la adrenalina solo cuando sube al 100% y mas nada que no diga combo maximo usa adrenaline nada de eso, y el ammo pack no tengo el plugin aun si me pueden ayudar adaptar eso al hud porfa
Adaptar es fácil, solo tienes que buscar las variables. En cada plugin al prinpicio hay "new" y por ejemplo te saldra "new ctf_adrenaline[33]" y entonces tu vas asi
Mensajes: 385
Temas: 132
Registro en: May 2018
Reputación:
1
22/07/2018, 03:35 PM
(Última modificación: 22/07/2018, 03:37 PM por Forever123.)
(22/07/2018, 02:11 PM)Nazy.- escribió: (22/07/2018, 12:30 PM)Forever123 escribió: (22/07/2018, 12:25 PM)El pirucho XP-007 escribió: ¿De que mod estamos hablando o plugin?
quiero adaptarle este sistema de rangos solo que diga el rango las kills q les falta para el otro rango y que diga cual otro rango biene, quiero adaptar la adrenalina solo cuando sube al 100% y mas nada que no diga combo maximo usa adrenaline nada de eso, y el ammo pack no tengo el plugin aun si me pueden ayudar adaptar eso al hud porfa cuando lo edito y cambio las variables me sale errores al copilar y quiero agregarle mas al hud pero la verdad no se como porfa
Adaptar es fácil, solo tienes que buscar las variables. En cada plugin al prinpicio hay "new" y por ejemplo te saldra "new ctf_adrenaline[33]" y entonces tu vas asi
no entiendo me puedes pasar un tutoriales o algo a si porfa quiero agregarle mas cosas cambio las variables pero me sale mas errores a la hora de copilar me pueden ayudar porfa
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
Test it, It's not tested.
Código PHP: /* ----------------------------------------- Creditos: Solo para Raulitop, por el hook say :3
Version Con Guardado NFVAULT ------------------------------- */
#include <amxmisc> #include <fakemeta> #include <adv_vault> #include <jctf>
new const PLUGIN[] = "Rangos CS:GO" #define VERSION "1.0" new const AUTHOR[] = "kikizon"
/* ============================================= |= [EMPIEZA SECCION MODIFICABLE] =| ==============================================*/ /* ==================================== *[CONSTANTES]* =====================================*/ new const Web[] = "AMXMODX-ES.COM" // Se Muestra en HUD new const Prefijo[] = "!g[RANGOS]!y" // Prefijo en say new const Sonido[] = "rango/up.wav" // Sonido Rango UP /* ==================================== *[CONST NOMBRES DE RANGOS]* =====================================*/ enum _:DATA { NOMBRE[32], FRAGS } new const Rangos[][DATA] = { { "Sin Rango", 100 }, { "Silver I", 200 }, { "Silver II", 300 }, { "Silver III", 500 }, { "Silver IV", 700 }, { "Silver Elite", 800 }, { "Silver Elite Master", 900 }, { "Gold Nova I", 1000 }, { "Gold Nova II", 1200 }, { "Gold Nova III", 1300 }, { "Gold Nova Master", 1400 }, { "Master Guardian I",1500 }, { "Master Guardian II", 1700 }, { "Master Guardian Elite", 1800 }, { "Distinguished Master Guardian", 1900 }, { "Legendary Eagle", 2000 }, { "Legendary Eagle Master", 2100 }, { "Supreme Master First Class", 2200 }, { "The Global Elite", 2500 } }
/* ============================================= |= [TERMINA SECCION MODIFICABLE] =| ==============================================*/ /* ==================================== *[VARIABLES]* =====================================*/ new g_rango[33], g_frags[33] new SyncHUD, g_maxplayers, g_msgTeamInfo, g_msgSayText, g_playername[33][32]; #define TASK_HUD 2100 #define ID_HUD (taskid - TASK_HUD) new g_vault
enum { CAMPO_RANGO, CAMPO_FRAG, CAMPO_MAX } new g_campos[CAMPO_MAX]
/* ==================================== *[Cvars]* =====================================*/ new cvar_Hud, cvar_knifex2, cvar_hsx2 /* ==================================== *[INIT]* =====================================*/ public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("DeathMsg", "Event_DeathMsg", "a") register_logevent("logevent_round_end", 2, "1=Round_End") register_clcmd("say", "message_saytext") register_clcmd("say_team", "message_sayteam") /* ============================================= |= [EMPIEZA SECCION MODIFICABLE] =| ==============================================*/ cvar_Hud = register_cvar("rangos_hud", "1") // 1 - Mostrar HUD | 0 - No Mostrar cvar_knifex2 = register_cvar("rangos_knifex2", "1") // 1 - x2 frags con knife | 0 - NO :v cvar_hsx2 = register_cvar("rangos_hsx2", "1") // 1 - x2 frags de HeadShot | 0 - NO :v /* ============================================= |= [TERMINA SECCION MODIFICABLE] =| ==============================================*/ SyncHUD = CreateHudSyncObj() g_maxplayers = get_maxplayers() g_msgTeamInfo = get_user_msgid("TeamInfo") g_msgSayText = get_user_msgid("SayText") g_vault = adv_vault_open("data_rangos", false) g_campos[CAMPO_RANGO] = adv_vault_register_field(g_vault, "RANGOS") g_campos[CAMPO_FRAG] = adv_vault_register_field(g_vault, "FRAGS") adv_vault_init(g_vault) } /* ==================================== *[PRECACHE]* =====================================*/ public plugin_precache() precache_sound(Sonido) /* =================================== *[HUD]* =====================================*/ public HUD(taskid) { new id = ID_HUD if (!is_user_alive(id)) { id = pev(id, pev_iuser2) if (!is_user_alive(id)) return; } if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } } /* ================================== [PUTINSERVER] ===================================*/ public client_putinserver(id) { get_user_name( id, g_playername[ id ], charsmax( g_playername[ ] ) ); g_rango[id] = 0 g_frags[id] = 0 Cargar(id) if(get_pcvar_num(cvar_Hud)) set_task(1.0, "HUD", id+TASK_HUD, _, _, "b") } /* ================================== [DISCONNECT] ===================================*/ public client_disconnect(id) { Guardar(id); remove_task(id+TASK_HUD) }
/* ================================== [ROUND END] ===================================*/ public logevent_round_end() { for(new id = 1; id <= g_maxplayers; id++) Guardar(id); } /* ================================== [DEATHMSG] ===================================*/ public Event_DeathMsg() { new attacker = read_data(1) new victim = read_data(2) new hs = read_data(3) new weaponid = get_user_weapon(attacker) if(victim == attacker) return; if(is_user_alive(attacker)) { g_frags[attacker]++ if(get_pcvar_num(cvar_knifex2)) { if(weaponid == CSW_KNIFE) g_frags[attacker]++ } if(get_pcvar_num(cvar_hsx2)) { if(hs) g_frags[attacker]++ } AumentarRango(attacker) } } /* ================================ [UPDATE RANGO] =================================*/ AumentarRango(id) { new Aumento = false while(g_frags[id] >= Rangos[g_rango[id]][FRAGS]) { Aumento = true g_rango[id]++ } if(Aumento) { chatcolor(id, "%s Felicidades subiste al rango: !g[ %s ]", Prefijo, Rangos[g_rango[id]][NOMBRE]) client_cmd(id, "spk %s", Sonido) Aumento = false } } /*===================================== *[SAY]* =====================================*/ public message_saytext(id) { static said[192] read_args(said, charsmax(said)) remove_quotes(said) if (said[0] == '@' || said[0] == '%' || said[0] == '/' || said[0] == '.' || said[0] == '!' || equal (said, "")) return PLUGIN_HANDLED
if (!ValidMessage(said, 1)) return PLUGIN_CONTINUE; static color[11], name[32], alive[11] get_user_team(id,color,charsmax(color)) get_user_name(id,name,charsmax(name))
if (is_user_alive (id)) { alive = "" } else { alive = "[Muerto]" }
if (is_user_admin(id)) { if (get_user_flags(id) & ADMIN_KICK) format(said, charsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s", alive, Rangos[g_rango[id]][NOMBRE], name, said) } else { format(said, charsmax(said), "^x01%s^04%s ^x03%s ^x01: %s", alive, Rangos[g_rango[id]][NOMBRE], name, said) } static i, team[11] for (i = 1; i <= g_maxplayers; i++) { if (!is_user_connected(i)) continue get_user_name(id,name,charsmax(name)) if (is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) { get_user_team(i, team, charsmax(team)) changeTeamInfo(i, color) writeMessage(i, said) changeTeamInfo(i, team) } } return PLUGIN_HANDLED_MAIN; }
public message_sayteam(id) { static said[192] read_args(said, charsmax(said)) remove_quotes(said) if (said[0] == '@' || said[0] == '%' || said[0] == '/' || said[0] == '.' || said[0] == '!' || equal (said, "")) return PLUGIN_HANDLED
if (!ValidMessage(said, 1)) return PLUGIN_CONTINUE; static playerTeam, playerTeamName[19] playerTeam = get_user_team(id) switch (playerTeam) { case 1: copy (playerTeamName, 6, "TE") case 2: copy (playerTeamName, 8, "CT") default: copy (playerTeamName, 11, "SPEC") }
static color[11], name[32], alive[11] get_user_team(id,color,charsmax(color)) get_user_name(id,name,charsmax(name))
if (is_user_alive (id)) { alive = "" } else { alive = "[MUERTO]" }
if (is_user_admin(id)) { if (get_user_flags(id) & ADMIN_RCON) format(said, charsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s", alive, playerTeam, Rangos[g_rango[id]], name, said) } else { format(said, charsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s", alive, playerTeam, Rangos[g_rango[id]],name, said) }
static i, team[11] for (i = 1; i <= g_maxplayers; i++) { if (!is_user_connected(i)) continue; get_user_name(id,name,charsmax(name)) if (get_user_team(i) == playerTeam || is_user_admin(i)) { if (is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) { get_user_team(i, team, charsmax(team)) changeTeamInfo(i, color) writeMessage(i, said) changeTeamInfo(i, team) } } } return PLUGIN_HANDLED_MAIN; } public changeTeamInfo(player, team[]) { message_begin(MSG_ONE, g_msgTeamInfo, _, player) write_byte(player) write_string(team) message_end() }
public writeMessage(player, message[]) { message_begin(MSG_ONE, g_msgSayText, {0, 0, 0}, player) write_byte(player) write_string(message) message_end() } /* =================================== *[GUARDADO]* =====================================*/ Guardar(id) { adv_vault_set_start(g_vault) adv_vault_set_field(g_vault, g_campos[CAMPO_RANGO], g_rango[id]) adv_vault_set_field(g_vault, g_campos[CAMPO_RANGO], g_frags[id]) adv_vault_set_end(g_vault, 0, g_playername[id]) }
Cargar(id) { if(!adv_vault_get_prepare(g_vault, _, g_playername[id])) return g_rango[id] = adv_vault_get_field(g_vault, g_campos[CAMPO_RANGO]) g_frags[id] = adv_vault_get_field(g_vault, g_campos[CAMPO_FRAG]) } /* =================================== *[STOCKS]* =====================================*/ // stock de chatcolor stock chatcolor(id, const input[], any:...) { new count = 1, players[32]; static msg[191]; vformat(msg, 190, input, 3); replace_all(msg, 190, "!g", "^4"); // Verde replace_all(msg, 190, "!y", "^1"); // Default replace_all(msg, 190, "!t", "^3"); // Color del Equipo if (id) players[0] = id; else get_players(players, count, "ch"); { for (new i = 0; i < count; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]); write_byte(players[i]); write_string(msg); message_end(); } } } } // Stock para Saber Si el mensaje es valido stock ValidMessage(text[], maxcount) { static len, i, count len = strlen(text) count = 0 if (!len) return false; for (i = 0; i < len; i++) { if (text[i] != ' ') { count++ if (count >= maxcount) return true; } } return false; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par } */
Mensajes: 385
Temas: 132
Registro en: May 2018
Reputación:
1
(22/07/2018, 03:43 PM)Chema escribió: Test it, It's not tested.
Código PHP: /* ----------------------------------------- Creditos: Solo para Raulitop, por el hook say :3
Version Con Guardado NFVAULT ------------------------------- */
#include <amxmisc> #include <fakemeta> #include <adv_vault> #include <jctf>
new const PLUGIN[] = "Rangos CS:GO" #define VERSION "1.0" new const AUTHOR[] = "kikizon"
/* ============================================= |= [EMPIEZA SECCION MODIFICABLE] =| ==============================================*/ /* ==================================== *[CONSTANTES]* =====================================*/ new const Web[] = "AMXMODX-ES.COM" // Se Muestra en HUD new const Prefijo[] = "!g[RANGOS]!y" // Prefijo en say new const Sonido[] = "rango/up.wav" // Sonido Rango UP /* ==================================== *[CONST NOMBRES DE RANGOS]* =====================================*/ enum _:DATA { NOMBRE[32], FRAGS } new const Rangos[][DATA] = { { "Sin Rango", 100 }, { "Silver I", 200 }, { "Silver II", 300 }, { "Silver III", 500 }, { "Silver IV", 700 }, { "Silver Elite", 800 }, { "Silver Elite Master", 900 }, { "Gold Nova I", 1000 }, { "Gold Nova II", 1200 }, { "Gold Nova III", 1300 }, { "Gold Nova Master", 1400 }, { "Master Guardian I",1500 }, { "Master Guardian II", 1700 }, { "Master Guardian Elite", 1800 }, { "Distinguished Master Guardian", 1900 }, { "Legendary Eagle", 2000 }, { "Legendary Eagle Master", 2100 }, { "Supreme Master First Class", 2200 }, { "The Global Elite", 2500 } }
/* ============================================= |= [TERMINA SECCION MODIFICABLE] =| ==============================================*/ /* ==================================== *[VARIABLES]* =====================================*/ new g_rango[33], g_frags[33] new SyncHUD, g_maxplayers, g_msgTeamInfo, g_msgSayText, g_playername[33][32]; #define TASK_HUD 2100 #define ID_HUD (taskid - TASK_HUD) new g_vault
enum { CAMPO_RANGO, CAMPO_FRAG, CAMPO_MAX } new g_campos[CAMPO_MAX]
/* ==================================== *[Cvars]* =====================================*/ new cvar_Hud, cvar_knifex2, cvar_hsx2 /* ==================================== *[INIT]* =====================================*/ public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("DeathMsg", "Event_DeathMsg", "a") register_logevent("logevent_round_end", 2, "1=Round_End") register_clcmd("say", "message_saytext") register_clcmd("say_team", "message_sayteam") /* ============================================= |= [EMPIEZA SECCION MODIFICABLE] =| ==============================================*/ cvar_Hud = register_cvar("rangos_hud", "1") // 1 - Mostrar HUD | 0 - No Mostrar cvar_knifex2 = register_cvar("rangos_knifex2", "1") // 1 - x2 frags con knife | 0 - NO :v cvar_hsx2 = register_cvar("rangos_hsx2", "1") // 1 - x2 frags de HeadShot | 0 - NO :v /* ============================================= |= [TERMINA SECCION MODIFICABLE] =| ==============================================*/ SyncHUD = CreateHudSyncObj() g_maxplayers = get_maxplayers() g_msgTeamInfo = get_user_msgid("TeamInfo") g_msgSayText = get_user_msgid("SayText") g_vault = adv_vault_open("data_rangos", false) g_campos[CAMPO_RANGO] = adv_vault_register_field(g_vault, "RANGOS") g_campos[CAMPO_FRAG] = adv_vault_register_field(g_vault, "FRAGS") adv_vault_init(g_vault) } /* ==================================== *[PRECACHE]* =====================================*/ public plugin_precache() precache_sound(Sonido) /* =================================== *[HUD]* =====================================*/ public HUD(taskid) { new id = ID_HUD if (!is_user_alive(id)) { id = pev(id, pev_iuser2) if (!is_user_alive(id)) return; } if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } } /* ================================== [PUTINSERVER] ===================================*/ public client_putinserver(id) { get_user_name( id, g_playername[ id ], charsmax( g_playername[ ] ) ); g_rango[id] = 0 g_frags[id] = 0 Cargar(id) if(get_pcvar_num(cvar_Hud)) set_task(1.0, "HUD", id+TASK_HUD, _, _, "b") } /* ================================== [DISCONNECT] ===================================*/ public client_disconnect(id) { Guardar(id); remove_task(id+TASK_HUD) }
/* ================================== [ROUND END] ===================================*/ public logevent_round_end() { for(new id = 1; id <= g_maxplayers; id++) Guardar(id); } /* ================================== [DEATHMSG] ===================================*/ public Event_DeathMsg() { new attacker = read_data(1) new victim = read_data(2) new hs = read_data(3) new weaponid = get_user_weapon(attacker) if(victim == attacker) return; if(is_user_alive(attacker)) { g_frags[attacker]++ if(get_pcvar_num(cvar_knifex2)) { if(weaponid == CSW_KNIFE) g_frags[attacker]++ } if(get_pcvar_num(cvar_hsx2)) { if(hs) g_frags[attacker]++ } AumentarRango(attacker) } } /* ================================ [UPDATE RANGO] =================================*/ AumentarRango(id) { new Aumento = false while(g_frags[id] >= Rangos[g_rango[id]][FRAGS]) { Aumento = true g_rango[id]++ } if(Aumento) { chatcolor(id, "%s Felicidades subiste al rango: !g[ %s ]", Prefijo, Rangos[g_rango[id]][NOMBRE]) client_cmd(id, "spk %s", Sonido) Aumento = false } } /*===================================== *[SAY]* =====================================*/ public message_saytext(id) { static said[192] read_args(said, charsmax(said)) remove_quotes(said) if (said[0] == '@' || said[0] == '%' || said[0] == '/' || said[0] == '.' || said[0] == '!' || equal (said, "")) return PLUGIN_HANDLED
if (!ValidMessage(said, 1)) return PLUGIN_CONTINUE; static color[11], name[32], alive[11] get_user_team(id,color,charsmax(color)) get_user_name(id,name,charsmax(name))
if (is_user_alive (id)) { alive = "" } else { alive = "[Muerto]" }
if (is_user_admin(id)) { if (get_user_flags(id) & ADMIN_KICK) format(said, charsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s", alive, Rangos[g_rango[id]][NOMBRE], name, said) } else { format(said, charsmax(said), "^x01%s^04%s ^x03%s ^x01: %s", alive, Rangos[g_rango[id]][NOMBRE], name, said) } static i, team[11] for (i = 1; i <= g_maxplayers; i++) { if (!is_user_connected(i)) continue get_user_name(id,name,charsmax(name)) if (is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) { get_user_team(i, team, charsmax(team)) changeTeamInfo(i, color) writeMessage(i, said) changeTeamInfo(i, team) } } return PLUGIN_HANDLED_MAIN; }
public message_sayteam(id) { static said[192] read_args(said, charsmax(said)) remove_quotes(said) if (said[0] == '@' || said[0] == '%' || said[0] == '/' || said[0] == '.' || said[0] == '!' || equal (said, "")) return PLUGIN_HANDLED
if (!ValidMessage(said, 1)) return PLUGIN_CONTINUE; static playerTeam, playerTeamName[19] playerTeam = get_user_team(id) switch (playerTeam) { case 1: copy (playerTeamName, 6, "TE") case 2: copy (playerTeamName, 8, "CT") default: copy (playerTeamName, 11, "SPEC") }
static color[11], name[32], alive[11] get_user_team(id,color,charsmax(color)) get_user_name(id,name,charsmax(name))
if (is_user_alive (id)) { alive = "" } else { alive = "[MUERTO]" }
if (is_user_admin(id)) { if (get_user_flags(id) & ADMIN_RCON) format(said, charsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s", alive, playerTeam, Rangos[g_rango[id]], name, said) } else { format(said, charsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s", alive, playerTeam, Rangos[g_rango[id]],name, said) }
static i, team[11] for (i = 1; i <= g_maxplayers; i++) { if (!is_user_connected(i)) continue; get_user_name(id,name,charsmax(name)) if (get_user_team(i) == playerTeam || is_user_admin(i)) { if (is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) { get_user_team(i, team, charsmax(team)) changeTeamInfo(i, color) writeMessage(i, said) changeTeamInfo(i, team) } } } return PLUGIN_HANDLED_MAIN; } public changeTeamInfo(player, team[]) { message_begin(MSG_ONE, g_msgTeamInfo, _, player) write_byte(player) write_string(team) message_end() }
public writeMessage(player, message[]) { message_begin(MSG_ONE, g_msgSayText, {0, 0, 0}, player) write_byte(player) write_string(message) message_end() } /* =================================== *[GUARDADO]* =====================================*/ Guardar(id) { adv_vault_set_start(g_vault) adv_vault_set_field(g_vault, g_campos[CAMPO_RANGO], g_rango[id]) adv_vault_set_field(g_vault, g_campos[CAMPO_RANGO], g_frags[id]) adv_vault_set_end(g_vault, 0, g_playername[id]) }
Cargar(id) { if(!adv_vault_get_prepare(g_vault, _, g_playername[id])) return g_rango[id] = adv_vault_get_field(g_vault, g_campos[CAMPO_RANGO]) g_frags[id] = adv_vault_get_field(g_vault, g_campos[CAMPO_FRAG]) } /* =================================== *[STOCKS]* =====================================*/ // stock de chatcolor stock chatcolor(id, const input[], any:...) { new count = 1, players[32]; static msg[191]; vformat(msg, 190, input, 3); replace_all(msg, 190, "!g", "^4"); // Verde replace_all(msg, 190, "!y", "^1"); // Default replace_all(msg, 190, "!t", "^3"); // Color del Equipo if (id) players[0] = id; else get_players(players, count, "ch"); { for (new i = 0; i < count; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]); write_byte(players[i]); write_string(msg); message_end(); } } } } // Stock para Saber Si el mensaje es valido stock ValidMessage(text[], maxcount) { static len, i, count len = strlen(text) count = 0 if (!len) return false; for (i = 0; i < len; i++) { if (text[i] != ' ') { count++ if (count >= maxcount) return true; } } return false; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par } */
gracias funciona pero el hud desaparece y aparece lo puedo arreglar porfa desaparece y aparece a cada rato no se queda fijo en la pantalla
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
Código PHP: if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); }
--- >
Código PHP: if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 0, 1.0, 1.0 ); ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 0, 1.0, 1.0 ); ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); }
Mensajes: 385
Temas: 132
Registro en: May 2018
Reputación:
1
(22/07/2018, 06:14 PM)Chema escribió: Código PHP: if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); }
--- >
Código PHP: if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 0, 1.0, 1.0 ); ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 0, 1.0, 1.0 ); ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); }
aun sigue desapareciendo y aparecer no se si sera por el pin q teng 280 aunq yo e entrado a otros server y el hud con ese pin no se me desaparece y vuelves aparecer se queda fija
Mensajes: 385
Temas: 132
Registro en: May 2018
Reputación:
1
(22/07/2018, 06:14 PM)Chema escribió: Código PHP: if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 1, 6.0, 1.0) ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); }
--- >
Código PHP: if(id != ID_HUD) { set_hudmessage(255, 255, 255, 0.60, 0.67, 0, 1.0, 1.0 ); ShowSyncHudMsg(ID_HUD, SyncHUD, "[ OBSERVING ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); } else { set_hudmessage(0, 255, 0, 0.0, 0.20, 0, 1.0, 1.0 ); ShowSyncHudMsg(ID_HUD, SyncHUD, "[ NAME ]: %s^n[ RANK ]: %s^n[ FRAGS ]: %d^n[ NEXT RANK ]: %s^n[ FRAGS REMAINING ]: %d^n[ ADRENALINE ]: %d", g_playername[ id ], Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] - g_frags[id], jctf_get_adrenaline ( id ) ); }
el hud sigue desapareciendo y apareciendo a cada rato no se queda fijo ayuda pls
Mensajes: 449
Temas: 32
Registro en: Apr 2017
Reputación:
6
Pues, como te dijeron en otro post, puede ser que tengas otro hud que interfiera en los canales.
Si no te gusta algo, cámbialo. Si no lo puedes cambiar, cambia la forma en que piensas sobre ello <3
|