Junior Member
|
04-16-2013
, 10:21
Help with this
|
#1
|
Hello, i have this two plugins i succeed to make them work but i have a new problem now, i want to put the points to show in hud but when i did that i dont work and it show me ML_NOTFOUND
http://************/image/9zzi5nrhh/ like in this image and i think the points are not shown properly.
PHP Code:
#include <amxmodx> #include <hamsandwich> #include <zombie_plague_advance>
new const PLUGIN[] = "ZM Points System"; new const VERSION[] = "1.0"; new const AUTHOR[] = "Hattrick";
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); RegisterHam(Ham_Killed, "player", "ham_PlayerKilled"); }
public ham_PlayerKilled(victim, attacker) { static selfkill; selfkill = (victim == attacker || !is_user_connected(attacker)) ? true : false; if (!selfkill) { if (!zp_get_user_zombie(attacker) && !zp_get_user_sniper(attacker) && !zp_get_user_survivor(attacker)) { zm_add_user_points(attacker, 2); } else if (zp_get_user_zombie(attacker) && !zp_get_user_nemesis(attacker) && !zp_get_user_assassin(attacker)) { zm_add_user_points(attacker, 2); } } }
PHP Code:
#define _xs_included #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fakemeta_util> #include <zombie_plague_advance>
new const xPrefix[] = "!g[ZM Buy]"; new cvar_godmode_cost, cvar_damage_cost, cvar_slot_cost, cvar_ammo_cost; new bool:g_GodMode[33], bool:g_Damage[33], bool:g_Damage2[33], bool:g_Password[33];
public plugin_init() { register_plugin("ZM Buy", "1.0", "Hattrick"); register_clcmd("amx_slot_password", "hattrick", ADMIN_USER, "<password>"); register_clcmd("say /menu", "command_Buy"); register_clcmd("say menu", "command_Buy"); register_clcmd("say /shop", "command_Buy"); register_clcmd("say shop", "command_Buy"); register_menucmd(register_menuid("aaaxMenu1"), 1023, "BuyMenu"); RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawned_Post", 1); RegisterHam(Ham_Killed, "player", "ham_PlayerKilled"); RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage"); cvar_godmode_cost = register_cvar("zm_godmode_cost", "100"); cvar_damage_cost = register_cvar("zm_damage_cost", "60"); cvar_slot_cost = register_cvar("zm_slot_cost", "450"); cvar_ammo_cost = register_cvar("zm_ammo_cost", "180"); }
public command_Buy(id) { new menuBody[2025]; add(menuBody, 2024, "\yZM Buy Menu^n^n"); add(menuBody, 2024, "\r1.\w God Mode \y[Next Round]^n"); add(menuBody, 2024, "\r2.\w Dual Damage \y[Next Round]^n"); add(menuBody, 2024, "\r3.\w Buy \rReserved Slot \wOn Server^n"); add(menuBody, 2024, "\r4.\w 60 Ammo Packs \y[Now]^n^n"); add(menuBody, 2024, "\r0.\w Exit^n"); show_menu(id, (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9), menuBody, -1, "aaaxMenu1"); }
public ham_TakeDamage(victim, inflictor, attacker, Float:damage) { if (victim == attacker || !is_user_connected(attacker)) return HAM_IGNORED; if (g_Damage2[attacker]) { damage *= 2.0; SetHamParamFloat(4, damage); } return HAM_IGNORED; }
public ham_PlayerKilled(id) if (is_user_connected(id) && g_Damage2[id]) g_Damage2[id] = false; public client_putinserver(id) set_task(25.0, "task_Announce", id); public task_Announce(id) { if (is_user_connected(id)) { write_colored(id, "%s !nScrie !t/shop !npentru a deschide meniul !tShop", xPrefix); write_colored(id, "%s !nScrie !t/shop !npentru a deschide meniul !tShop", xPrefix); } }
public BuyMenu(id, key) { new name[32]; get_user_name(id, name, 31); switch(key) { case 0: { if (zm_get_user_points(id) >= get_pcvar_num(cvar_godmode_cost)) { g_GodMode[id] = true; write_colored(0, "%s !t%s !na cumparat !tGod Mode", xPrefix, name); zm_del_user_points(id, get_pcvar_num(cvar_godmode_cost)); } else write_colored(id, "%s !nNu ai destule puncte! Necesare sunt !t%d !npuncte", xPrefix, get_pcvar_num(cvar_godmode_cost)); } case 1: { if (zm_get_user_points(id) >= get_pcvar_num(cvar_damage_cost)) { g_Damage[id] = true; write_colored(0, "%s !t%s !na cumparat !tDual Damage", xPrefix, name); zm_del_user_points(id, get_pcvar_num(cvar_damage_cost)); } else write_colored(id, "%s !nNu ai destule puncte! Necesare sunt !t%d !npuncte", xPrefix, get_pcvar_num(cvar_damage_cost)); } case 2: { if (zm_get_user_points(id) >= get_pcvar_num(cvar_slot_cost)) { if (is_user_admin(id)) { write_colored(id, "%s !n=== YOU CAN'T BUY!!! ===", xPrefix); return PLUGIN_HANDLED; } g_Password[id] = true; fm_strip_user_weapons(id); fm_set_user_noclip(id, 1); fm_set_user_godmode(id, 1); fm_set_user_maxspeed(id, 0.0001); client_cmd(id, "messagemode amx_slot_password"); write_colored(0, "%s !t%s !na cumparat !tSlot Rezervat", xPrefix, name); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); zm_del_user_points(id, get_pcvar_num(cvar_slot_cost)); } else write_colored(id, "%s !nNu ai destule puncte! Necesare sunt !t%d !npuncte", xPrefix, get_pcvar_num(cvar_slot_cost)); } case 3: { if (zm_get_user_points(id) >= get_pcvar_num(cvar_ammo_cost)) { zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + 60); write_colored(0, "%s !t%s !na cumparat !t60 Ammo Packs", xPrefix, name); zm_del_user_points(id, get_pcvar_num(cvar_ammo_cost)); } else write_colored(id, "%s !nNu ai destule puncte! Necesare sunt !t%d !npuncte", xPrefix, get_pcvar_num(cvar_ammo_cost)); } default: return PLUGIN_CONTINUE; } return PLUGIN_CONTINUE; }
public hattrick(id) { if (!g_Password[id]) { write_colored(id, "%s !n=== YOU CAN'T BUY!!! ===", xPrefix); return PLUGIN_HANDLED; } new name[32]; get_user_name(id, name, 31); new password[35]; read_args(password, 34); remove_quotes(password); if (equal(password, "")) { write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); write_colored(id, "%s !nSCRIE PAROLA DORITA. WRITE A PASSWORD.", xPrefix); client_cmd(id, "messagemode amx_slot_password"); return PLUGIN_HANDLED; } g_Password[id] = false; client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_print(id, print_console, "[ZM Buy] Your password: %s", password); client_cmd(id, "topcolor ^"^";rate ^"^";model ^"^";setinfo ^"_reddevil^" ^"%s^"", password); server_cmd("amx_addadmin ^"%s^" ^"bi^" ^"%s^" ^"name^"", name, password); server_cmd("amx_reloadadmins"); log_to_file("zm_buy_slot.log", "%s a cumparat slot. Parola este %s", name, password); server_exec(); return PLUGIN_HANDLED; }
public ham_PlayerSpawned_Post(id) { if (g_Damage2[id]) g_Damage2[id] = false; if (g_GodMode[id]) { g_GodMode[id] = false; fm_set_user_godmode(id, 1); } if (g_Damage[id]) { g_Damage[id] = false; g_Damage2[id] = true; } }
public client_disconnect(id) { if (g_GodMode[id]) g_GodMode[id] = false; if (g_Damage[id]) g_Damage[id] = false; if (g_Damage2[id]) g_Damage2[id] = false; if (g_Password[id]) g_Password[id] = false; }
public write_colored(const id, const string[], {Float, Sql, Resul,_}:...) { new msg[191], players[32], count = 1; vformat(msg, 190, string, 3); replace_all(msg, 190, "!n", "^1"); replace_all(msg, 190, "!t", "^3"); replace_all(msg, 190, "!g", "^4"); 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(); } } }
This is the part that i modified
PHP Code:
// Show name, health, class, and ammo packs and armor set_hudmessage(0, 200, 250, HUD_SPECT_X, HUD_SPECT_Y, 1, 6.0, 1.1, 0.0, 0.0, -1) ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L %s^nHP: %d - %L %s - %L %d - %L %d - %L %d^nFrom: %s, %s", ID_SHOWHUD, "SPECTATING", g_playername[id], pev(id, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[id], ID_SHOWHUD, "ARMOR", pev(id, pev_armorvalue), "POINTS", g_points[id], ID_SHOWHUD, player_country, player_city) } else { // Show health, class and ammo packs and armor 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 - %L %d - %L %d", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], ID_SHOWHUD, "ARMOR", pev(ID_SHOWHUD, pev_armorvalue), "POINTS", g_points[ID_SHOWHUD], ID_SHOWHUD)
Thanks.
|
|