Senior Member
Join Date: Apr 2014
Location: somewhere in universe
|
09-06-2014
, 09:46
All Scripters I need HELP pls - zp_SHOP
|
#1
|
someone , know's how to do this please ! (If Anyone dont know how to do , and if someone has this .sma or .amxx pls send it to me :'( )
(Explain) This plugin , when i Buy Item God Mode , it Shows "You Bought God Mode", But its Giving After that Round i bought that item ,, Are 2 Items that i buy , and they give me that ability after 1 round , its -> "God Mode" & "Dual Damage" ,, i know how to make this to be Bought with Ammo , but anyone know's how to do this? When i Buy God mode to give Directly God Mode pleasee ? Thank you
Here its the Code
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", "xxx"); 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[100 Points]^n"); add(menuBody, 2024, "\r2.\w Dual Damage \y[60 Points]^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(); } } }
(i've tried to much times to do this but nothing ... ) Again i will thank from my heart who , tries to make this
__________________
Last edited by ghost95v; 09-08-2014 at 07:54.
|
|