Помогите сделать плагин по флагу! #include <amxmodx> new g_MsgSync new g_MsgSync2 new isConnected[33 char] public plugin_init() { register_plugin("Damager", "1.0", "Prayer") register_event("Damage", "EVENT_Damage", "b", "2!0", "3=0", "4!0") g_MsgSync = CreateHudSyncObj() g_MsgSync2 = CreateHudSyncObj() } public client_putinserver(id) { isConnected{id} = true } public client_disconnect(id) { isConnected{id} = false } public EVENT_Damage(id) { if(isConnected{id}) { static damage, pid damage = read_data(2) set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1) ShowSyncHudMsg(id, g_MsgSync2, "*", damage) pid = get_user_attacker(id) if((pid > 0) && (pid < 33) && isConnected{pid}) { set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) ShowSyncHudMsg(pid, g_MsgSync, "*", damage) } } }
Спойлер: Тут #include <amxmodx> #define ADMIN ADMIN_LEVEL_F new g_MsgSync new g_MsgSync2 new isConnected[33 char] public plugin_init() { register_plugin("Damager", "1.0", "Prayer") register_event("Damage", "EVENT_Damage", "b", "2!0", "3=0", "4!0") g_MsgSync = CreateHudSyncObj() g_MsgSync2 = CreateHudSyncObj() } public client_putinserver(id) { isConnected{id} = true } public client_disconnect(id) { isConnected{id} = false } public EVENT_Damage(id) { if(isConnected{id}) { static damage, pid damage = read_data(2) set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1) ShowSyncHudMsg(id, g_MsgSync2, "*", damage) pid = get_user_attacker(id) if((pid > 0) && (pid < 33) && isConnected{pid}) { set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) ShowSyncHudMsg(pid, g_MsgSync, "*", damage) } } }
За такие советы надо гнать поганой метлой. public EVENT_Damage(id) { if(!(get_user_flags(id) & ADMIN_LEVEL_F)) return PLUGIN_HANDLED Дальше код....
Спасибо большое. Но теперь другая проблема. Когда мне наносят урон он показывает звездочку, а когда я наношу вообще не чего не показывает.
Код: public EVENT_Damage(id) { if(isConnected{id}) { static damage, pid damage = read_data(2) set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1) ShowSyncHudMsg(id, g_MsgSync2, "*", damage) pid = get_user_attacker(id) if((pid > 0) && (pid < 33) && isConnected{pid} && (get_user_flags(id) & ADMIN_LEVEL_F)) { set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) ShowSyncHudMsg(pid, g_MsgSync, "*", damage) } } } Так попробуй.