Cristian Publicado 8 de julio del 2014 Denunciar Publicado 8 de julio del 2014 SISTEMA DE NIVELES A FRAGS/INFECCIONES PARA ZOMBIE PLAGUE Empezamos:Abajo de los includes: ponemos los macros. Código PHP: #define FRAGS(%1) (%1 * 1)#define INFECCIONES(%1) (%1 * 1) + 2 Ahora tenemos que crear las variables. Pueden ponerle el nombre que ustedes mas gusten.. en este caso usaremos estas variable que tendrán 33 celdas. Código PHP: new g_nivel[33]new g_frags[33]new g_infecciones[33] Ahora vamos a hacer que gane frags para eso nos vamos a:public fw_PlayerKilled(victim, attacker, shouldgib)Aca estamos diciendo que si el zombie o el nemesis es la victimael atacante ganaria frags. Caso contrario si el survivor es la victima. El atacante ganaria infecciones Código PHP: public fw_PlayerKilled(victim, attacker, shouldgib){ if (g_zombie[victim] || g_nemesis[victim]) { g_frags[attacker]++ check_level(attacker) } else if (!g_zombie[victim] || g_survivor[victim]) { g_infecciones[attacker]++ check_level(attacker) }} Ahora nos vamos a: public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) - Para que gane infeccionesAca vamos a registrar cuando infecta a una victima Código PHP: public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type){ SendDeathMsg(attacker, victim) FixDeadAttrib(victim) UpdateFrags(attacker, victim, get_pcvar_num(cvar_fragsinfect), 1, 1) g_infecciones[attacker]++ check_level(attacker) zombieme(victim, attacker, 0, 0) g_ammopacks[attacker] += get_pcvar_num(cvar_ammoinfect) fm_set_user_health(attacker, pev(attacker, pev_health)+get_pcvar_num(cvar_zombiebonushp)) return HAM_SUPERCEDE;} Ahora vamos a poner en el hud los frags/infecciones, frags/infecciones restantes y el COMPLETADO: Código PHP: if (id != ID_SHOWHUD) { static name[32] get_user_name(id, name, sizeof name - 1) // Show name, health, class, and ammo packs set_hudmessage(255, 255, 255, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1) ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L %s^nHP: %d - %L %s - %L %d", ID_SHOWHUD, "SPECTATING", name, pev(id, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[id]) } else { static szIncompleto[20]; formatex( szIncompleto, 19, "%d/%d", g_frags[id], FRAGS(g_nivel[id])) static szCompleto[20]; formatex( szCompleto, 19, "COMPLETADO" ) static siIncompleto[20]; formatex( siIncompleto, 19, "%d/%d", g_infecciones[id], INFECCIONES(g_nivel[id])) static siCompleto[20]; formatex( siCompleto, 19, "COMPLETADO" ) // Show health, class and ammo packs set_hudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1) ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L: %d - %L %s - %L %d - Nivel: %d - Frags: %s - Infecciones: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], g_nivel[id], g_frags[id] >= FRAGS(g_nivel[id]) ? szCompleto : szIncompleto, g_infecciones[id] >= INFECCIONES(g_nivel[id]) ? siCompleto : siIncompleto) } Ahora vamos a chequear que suba de nivel al final del zp ponen: Código PHP: public check_level(id){ if( g_nivel[id] >= 500 ) // Nivel Maximo = 500 { g_nivel[id] = 500 // Nivel Maximo = 500 return; } while (g_frags[id] >= FRAGS(g_nivel[id]) && g_infecciones[id] >= INFECCIONES(g_nivel[id])) { g_nivel[id]++ g_frags[id] = 0 g_infecciones[id] = 0 }} Ahora vamos a haer que si un player nuevo se conecta. Su nivel frags e infecciones comenzarán de 0. Para eso nos vamos a publi client_putinserver(id) y agregamos lo siguiente abajo del { Código PHP: g_nivel[id] = 1g_frags[id] = 0g_infecciones[id] = 0 Bartu reaccionó a esto 1
Im Author Publicado 9 de julio del 2014 Denunciar Publicado 9 de julio del 2014 En el título dice: [TIT], sabías que tit signifíca teta en inglés? Cristian reaccionó a esto 1
Angelical Power Publicado 13 de julio del 2014 Denunciar Publicado 13 de julio del 2014 Cuanto codigo basura
Pooly Publicado 31 de julio del 2014 Denunciar Publicado 31 de julio del 2014 No te ofendas, el zp no tiene levels... esas cosas como el daño extra, vida y demas que se obtienen con niveles y frags etc... son frutadas que a mi parecer son aburridas... Los verdaderos zombie plagues no usan esas cosas... A menos que hables de otro juego con mod zp (?) Lindo trabajo te tomaste (?), un asco el mod lástima... Pillx reaccionó a esto 1
Posts recomendados