Всем привет. Тут плагин medkit нужно изменить его! Нужно сделать что бы плагин давался только админам и бесплатно и при его покупки давался сразу в руки а не сохранялся где бомба. Спойлер: исходник Код: * Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fakemeta_util> #include <amxmisc> #include <engine> #include <fun> #include <fakemeta> #include <cstrike> #include <hamsandwich> #include <Vexd_Utilities> #define PLUGIN "medkit" #define VERSION "2.0" #define AUTHOR "MaHu" const Wep_c4 = ((1<<CSW_C4)) new bool:g_HasMedkit[32] new cvar_hp, cvar_cost,g_healspr; new const sprite_heal[] = "sprites/heal.spr" public plugin_init() { register_event("CurWeapon","checkWeapon","be","1=1") register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd( "say /medkit" , "medkit") register_clcmd( "say_team /medkit" , "medkit") register_event("CurWeapon","resetWeapon","be", "1=1") RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1) register_concmd("amx_medkit", "CmdGivemedkit", ADMIN_BAN, "<name>") cvar_hp = register_cvar("medkit_hp", "50") cvar_cost = register_cvar("medkit_cost","5000") RegisterHam(Ham_Spawn, "player", "Spawn", 1) } public plugin_precache( ){ precache_sound( "buttons/bell1.wav" ) precache_model("models/v_medkit.mdl"); precache_model("models/rpgrocket.mdl"); g_healspr = engfunc(EngFunc_PrecacheModel, sprite_heal) } public medkit(id){ if(is_user_alive(id) && (cs_get_user_money(id)< get_pcvar_num(cvar_cost))){ client_print(id,print_chat,"[AMXX]you need more money to buy medkit") return PLUGIN_HANDLED } if(is_user_alive(id) && (cs_get_user_money(id)>= get_pcvar_num(cvar_cost))) { cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(cvar_cost)) give_item(id,"weapon_c4"); g_HasMedkit[id] = true client_print(id, print_chat, "[AMXX] you bought medkit") } return PLUGIN_HANDLED } public client_PreThink(id) { new temp[2], weapon = get_user_weapon(id, temp[0], temp[1]) if( get_user_button( id ) & IN_ATTACK && weapon == CSW_C4 && g_HasMedkit[id]){ if( get_user_oldbutton( id ) & IN_ATTACK ) { g_HasMedkit[id] = false SetView(id, 1) set_user_maxspeed(id,1.0); static Float:eek:riginF[3] pev(id, pev_origin, originF) engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0) write_byte(TE_SPRITE) // TE id engfunc(EngFunc_WriteCoord, originF[0]+random_float(-5.0, 5.0)) // x engfunc(EngFunc_WriteCoord, originF[1]+random_float(-5.0, 5.0)) // y engfunc(EngFunc_WriteCoord, originF[2]+random_float(-10.0, 10.0)) // z write_short(g_healspr) // sprite write_byte(random_num(5, 10)) // scale write_byte(200) // brightness message_end() set_task(2.0,"heal",id) client_cmd(id,"spk items/tr_kevlar") } } } public resetWeapon(id) { if(!is_user_alive(id) || !is_user_connected(id)) return PLUGIN_CONTINUE new temp[2], weapon = get_user_weapon(id, temp[0], temp[1]) if(weapon == CSW_C4 && g_HasMedkit[id]) { entity_set_string(id, EV_SZ_viewmodel, "models/v_medkit.mdl") } return PLUGIN_CONTINUE } public CmdGivemedkit(id,level,cid) { if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED; new arg[32]; read_argv(1,arg,31); new player = cmd_target(id,arg,7); if (!player) return PLUGIN_HANDLED; new name[32]; get_user_name(player,name,31); g_HasMedkit[player] = true give_item(player, "weapon_c4") return PLUGIN_HANDLED } public client_connect(id) { g_HasMedkit[id] = false } public client_disconnect(id) { g_HasMedkit[id] = false } public Death() { g_HasMedkit[read_data(2)] = false } public checkWeapon(id) { new temp[2], weapon = get_user_weapon(id, temp[0], temp[1]) if (weapon == CSW_C4 && g_HasMedkit[id]) { resetWeapon(id) } else { return PLUGIN_CONTINUE } return PLUGIN_HANDLED } public fwHamPlayerSpawnPost(id) { g_HasMedkit[id] = false } public Spawn(id) { if(is_user_alive(id)) g_HasMedkit[id] = false return HAM_HANDLED } stock drop_prim(id) { new weapons[32], num get_user_weapons(id, weapons, num) for (new i = 0; i < num; i++) { if (Wep_c4 & (1<<weapons)) { static wname[32] get_weaponname(weapons, wname, sizeof wname - 1) engclient_cmd(id, "drop", wname) } } } public heal(id){ new hp=get_user_health(id) set_user_health(id, hp+ get_pcvar_num(cvar_hp)); client_cmd(id,"spk buttons/bell1") fm_strip_user_gun(id,0,"weapon_c4") set_user_maxspeed(id,250.0); SetView(id, 0) }