siema, od 2 dni męczę się z przepisaniem pluginu tak żeby działał tylko dla osoby z flagą ADMIN_LEVEL_H
próbowałem już użyć if(get_user_flags(id) & ADMIN_LEVEL_H) ale bez rezultatu (nie mogłem nawet tego skompilować)
plugin to HitGroup Damage Manipulator v1.1 od alliedów
tutaj kod:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define PLUGIN "Hitgroup Manipulator" #define AUTHOR "OT" #define VERSION "1.1" #define OFFSET_LAST_HIT_GROUP 75 #define EXTRAOFFSET_PL_LINUX 5 new const Float:vec_hit_multi[] = { 1.0, // HIT_GENERIC 4.0, // HIT_HEAD 1.0, // HIT_CHEST 1.25, // HIT_STOMACH 1.0, // HIT_LEFTARM 1.0, // HIT_RIGHTARM 0.75, // HIT_LEFTLEG 0.75 // HIT_RIGHTLEG } new pcv_hitgroup[sizeof vec_hit_multi] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("hitgroup_man_vs", VERSION, (FCVAR_SERVER | FCVAR_SPONLY)) pcv_hitgroup[HIT_GENERIC] = register_cvar("hit_generic_multi", "1.0") pcv_hitgroup[HIT_HEAD] = register_cvar("hit_head_multi", "4.0") pcv_hitgroup[HIT_CHEST] = register_cvar("hit_chest_multi", "1.0") pcv_hitgroup[HIT_STOMACH] = register_cvar("hit_stomach_multi", "1.25") pcv_hitgroup[HIT_LEFTARM] = register_cvar("hit_left_arm_multi", "1.0") pcv_hitgroup[HIT_RIGHTARM] = register_cvar("hit_right_arm_multi", "1.0") pcv_hitgroup[HIT_LEFTLEG] = register_cvar("hit_left_leg_multi", "0.75") pcv_hitgroup[HIT_RIGHTLEG] = register_cvar("hit_right_leg_multi", "0.75") RegisterHam(Ham_TakeDamage, "player", "fw_takedamage") } public fw_takedamage(victim, inflictor, attacker, Float:damage, bits) { new hitgroup = get_pdata_int(victim, OFFSET_LAST_HIT_GROUP, EXTRAOFFSET_PL_LINUX) if (hitgroup > 7 || hitgroup < 0) return HAM_IGNORED if(get_pcvar_float(pcv_hitgroup[hitgroup]) == vec_hit_multi[hitgroup]) return HAM_IGNORED SetHamParamFloat(4, damage * get_pcvar_float(pcv_hitgroup[hitgroup]) / vec_hit_multi[hitgroup]) return HAM_HANDLED }
pytanie czy ktoś by podpowiedział w jaki sposób mógłbym to zrobić, lub zrobiłby to za mnie?