Im Author Publicado 16 de abril del 2014 Denunciar Compartir Publicado 16 de abril del 2014 #include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "Sistema de niveles + algunas cosas extras" #define VERSION "0.1" #define AUTHOR "Im Author" #define cost(%1) (%1 * 7) const MAX_LVL = 150 new g_level[33], g_frags[33], g_reset[33], g_matados_ct[33], g_matados_tt[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /resetear", "cmd_rr") register_clcmd("say /matados", "cmd_matados") RegisterHam(Ham_Killed, "player", "Ham_PK", 1) } public client_putinserver(id) { g_level[id] = 1 g_frags[id] = 0 g_reset[id] = 0 g_matados_ct[id] = 0 g_matados_tt[id] = 0 } public cmd_rr(id) { if (g_level[id] < MAX_LVL) { client_print(id, print_chat, "Tenes que ser nivel: [%d]", MAX_LVL) return PLUGIN_HANDLED; } else { g_reset[id]++ g_level[id] = 1 g_frags[id] = 0 client_print(id, print_chat, "Felicidades!, reseteaste!! | Resets actuales: [%d]", g_reset[id]) } return PLUGIN_HANDLED; } public cmd_matados(id) { client_print(id, print_chat, "Mataste: [%d CTs] | [%d TTs]", g_matados_ct[id], g_matados_tt[id]) return PLUGIN_HANDLED; } public Ham_PK(victim, attacker, shouldgib) { if ((get_user_team(victim) == get_user_team(attacker)) || !is_user_connected(attacker)) return; if (get_user_team(attacker) == 1) g_matados_ct[attacker]++ else g_matados_tt[attacker]++ g_frags[attacker] += (is_user_admin(attacker)) ? 2 : 1 checklevel(attacker) client_print(attacker, print_chat, "Ganaste [%d] frag%s", (is_user_admin(attacker)) ? "2" : "1", (is_user_admin(attacker)) ? "s" : "") } public checklevel(id) { if (g_level[id] == MAX_LVL) return; else { while (g_frags[id] >= cost(g_level[id])) { g_level[id]++ g_frags[id] = 0 client_print(id, print_center, "Subiste al nivel: [%d]", g_level[id]) } } } Javitox! reaccionó a esto 1 Enlace al comentario Compartir en otros sitios More sharing options...
Posts recomendados