Флаги доступа.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
209
Реакции
28
Помог
8 раз(а)
Ошибка
Не работает проверка на флаги доступа.
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5235 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Dec 18 2018 01:20:00
Built from: https://github.com/alliedmodders/amxmodx/commit/6c53524
Build ID: 5235:6c53524
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 17:58:00 Oct 5 2018 (1637)
Build from: https://github.com/dreamstalker/rehlds/commit/89be216
ReGamedll
ReGameDLL version: 5.7.0.321-dev
Build date: 09:55:29 Jan 7 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/9baea02
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5235 ini Start ANY
[ 3] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 7] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 8] MySQL RUN - mysql_amxx_i386.so v1.9.0.5235 pl2 ANY ANY
[ 9] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5235 pl2 ANY ANY
[10] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5235 pl2 ANY ANY
[11] ReAPI RUN - reapi_amxx_i386.so v5.7.0.162-dev pl2 ANY Never
[12] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5235 pl2 ANY ANY
[13] CSX RUN - csx_amxx_i386.so v1.9.0.5235 pl2 ANY ANY
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5235 pl2 ANY ANY
[15] Fun RUN - fun_amxx_i386.so v1.9.0.5235 pl2 ANY ANY
15 plugins, 15 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] GameCMS_API 5.2.7 zhorzh78 gamecms_api_5.2 running
[ 2] FreshBans 1.4.0b kanagava fresh_bans_140_ running
[ 3] WebHS 0.1 kanagava fb_web_online.a running
[ 4] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 5] Ping Control 1.31 neygomon Ping_Control.am running
[ 6] GameCMS_GagManager 1.4.4 API5 zhorzh78 gamecms_gagmana running
[ 7] Auto Demo Recorder 2.2.1 F@nt0M demo_recorder.a running
[ 8] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 9] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 10] Menus Front-End 1.5 neugomon menufront_end.a running
[ 11] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 12] Bullet Damage 0.0.1 ConnorMcLeod bullet_damage.a running
[ 13] GameCMS_VipTest 3.5 ++ zhorzh78 gamecms_viptest running
[ 14] Admin Commands 1.9.0.5235 AMXX Dev Team admincmd.amxx running
[ 15] Admin Votes 1.9.0.5235 AMXX Dev Team adminvote.amxx running
[ 16] Admin Chat 1.9.0.5235 AMXX Dev Team adminchat.amxx running
[ 17] Commands Menu 1.9.0.5235 AMXX Dev Team cmdmenu.amxx running
[ 18] Maps Menu 1.9.0.5235 AMXX Dev Team mapsmenu.amxx running
[ 19] CS Misc. Stats 1.9.0.5235 AMXX Dev Team miscstats.amxx running
[ 20] Multi-Lingual System 1.9.0.5235 AMXX Dev Team multilingual.am running
[ 21] Pause Plugins 1.9.0.5235 AMXX Dev Team pausecfg.amxx running
[ 22] TimeLeft 1.9.0.5232 AMXX Dev Team timeleft.amxx running
[ 23] Plugin Menu 1.9.0.5235 AMXX Dev Team pluginmenu.amxx running
[ 24] GameCMS Time Awards 1.4 API_5 zhorzh78 gamecms_time_aw running
[ 25] GameCMS BonusSystem 1.1 +- DUKKHAZ0R gamecms_bonus.a running
[ 26] Hide HUD/Menu on Vote 1.2 d3m37r4 hide_hud_and_me running
[ 27] [AMXX] CKPUH_III_OT Komap 1.0 info.amxx running
[ 28] Lite Translit 2.8 neygomon lite_translit.a running
[ 29] Simple Respawn 0.6b fl0wer / Safety1 simple_respawn. running
[ 30] Spect Bot 1.2 SKAJIbnEJIb & Bo SpectBot.amxx running
[ 31] Zombie Plague 4.3 MeRcyLeZZ zombie_plague40 running
[ 32] unknown unknown unknown zp_zclass_stude running
[ 33] unknown unknown unknown zp_zclass_elect running
[ 34] unknown unknown unknown zp_zclass_jumpe running
[ 35] unknown unknown unknown zp_zclass_invis running
[ 36] unknown unknown unknown zp_zclass_fire. running
[ 37] unknown unknown unknown zp_zclass_poiso running
[ 38] zp_zclass_ice 1.0 MKOD | Серг Р zp_zclass_ice.a running
[ 39] unknown unknown unknown zp_zclass_galax running
[ 40] [ZP] Zombie Class: Rag 1.3 eXcalibur.007 zp_zclass_rage. running
[ 41] [ZP Class] Teleport 0.2 ONYX zp_class_telepo running
[ 42] unknown unknown unknown zp_jbomb.amxx running
[ 43] unknown unknown unknown zp_extra_hp_ap. running
[ 44] unknown unknown unknown zp_extra_noreco running
[ 45] unknown unknown unknown zp_extra_ultimi running
[ 46] [ZP] Extra: Jack-Hamme 1.0 Crock / =) (Popr zp_jackhammer.a running
[ 47] [ZP] Extra: Thanatos A 1.0 Crock / =) (Popr zp_thanatos_arx running
[ 48] [ZP] Extra: Thanatos S 1.0 Crock / =) (Popr zp_thanatos_stu running
[ 49] [ZP] Extra: Lycanthrop 1.0 Crock / =) (Popr zp_lycanthrop_t running
[ 50] [ZP] Extra: Water-Gun 1.0 Crock / =) (Popr zp_watergun.amx running
[ 51] [ZP] Extra: Falcon VSK 1.0 Crock / =) (Popr zp_falcon_vsk94 running
[ 52] [ZP] Extra: Thanatos P 1.0 Crock / =) (Popr zp_thanatos_pkm running
[ 53] [ZP] Extra: M134 Moto 1.0 Crock / =) (Popr zp_m134_moto.am running
[ 54] [ZP] Extra: Janus PKM 1.0 Crock / =) (Popr zp_janus_pkm.am running
[ 55] [ZP] Addon: Privileges 1.0 MKOD zp_privileges_m running
[ 56] [ZP] Extra: Elf AK-47 1.0 Crock / =) (Popr zp_vip_elf_ak47 running
[ 57] [ZP] Extra: Elf M4A1 1.0 Crock / =) (Popr zp_vip_elf_m4a1 running
[ 58] [ZP] Extra: Elf CrossB 1.0 Crock / =) (Popr zp_admin_elf_cr running
[ 59] [ZP] Extra: Elf VSK-94 1.0 Crock / =) (Popr zp_admin_elf_vs running
[ 60] [ZP] Extra: Buff AK-47 1.0 Crock / =) (Popr zp_boss_buff_ak running
[ 61] [ZP] Extra: Buff M4A1 1.0 Crock / =) (Popr zp_boss_buff_m4 running
[ 62] [ZP] Extra: Red Hand's 1.0 Crock / =) (Popr zp_svip_red_han running
[ 63] [ZP] Extra: Poison Sca 1.0 Crock / =) (Popr zp_svip_poison_ running
[ 64] [ZP] Extra: Balrog-7 1.0 Crock / =) (Popr zp_sdmin_balrog running
[ 65] [ZP] Extra: Balrog AK- 1.0 Crock / =) (Popr zp_sadmin_balro running
[ 66] [ZP] Extra: OZ Plasma- 1.0 Crock / =) (Popr zp_sboss_plasma running
[ 67] [ZP] Extra: Thanatos T 1.0 Crock / =) (Popr zp_sboss_thanat running
[ 68] [ZP] Extra: DubStep Gu 1.0 Crock / =) (Popr zp_king_dubstep running
[ 69] [ZP] Extra: Star-Chase 1.0 Crock / =) (Popr zp_king_starcha running
[ 70] [ZP] Extra: Destroyer- 1.0 Crock / =) (Popr zp_graf_destroy running
[ 71] [ZP] Extra: M249 Pheon 1.0 Crock / =) (Popr zp_graf_m249_ph running
[ 72] [ZP] Extra: DragonLore 1.0 Crock / =) (Popr zp_lord_dragonl running
[ 73] [ZP] Extra: Tanos Hand 1.0 Crock / =) (Popr zp_lord_tanos_h running
[ 74] unknown unknown unknown zp_king_jump.am running
[ 75] unknown unknown unknown zp_king_hook.am running
[ 76] unknown unknown unknown zp_lord_give_sk running
[ 77] unknown unknown unknown zp_lord_remove_ running
[ 78] unknown unknown unknown zp_lord_give_eu running
[ 79] unknown unknown unknown zp_lord_remove_ running
[ 80] unknown unknown unknown zp_knifes.amxx running
[ 81] [ZP] Extra: Stick 1.0 Crock / =) (Popr zp_lord_harry_p running
[ 82] New Jetpack 0.0.2 Bad_Bud, ZmOutSt zp_king_jetpack running
[ 83] [ZP] Extra: Beretta Gu 1.0 Crock / =) (Popr zp_graf_beretta running
[ 84] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 zp_lord_m3drago running
[ 85] unknown unknown unknown zp_countdown.am running
[ 86] unknown unknown unknown zp_dead_spr.amx running
[ 87] unknown unknown unknown zp_parachute.am running
[ 88] unknown unknown unknown zp_save_euro.am running
[ 89] unknown unknown unknown zp_score.amxx running
[ 90] unknown unknown unknown zp_my_menu.amxx running
[ 91] unknown unknown unknown zp_skull_system running
[ 92] unknown unknown unknown zp_nemesis_skil running
[ 93] Map Manager: Core 3.0.0 Mistrick map_manager_cor running
[ 94] Map Manager: Scheduler 0.1.0 Mistrick map_manager_sch running
[ 95] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv running
[ 96] Map Manager: Nominatio 0.0.8 Mistrick map_manager_nom running
[ 97] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 98] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 99] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
99 plugins, 99 running
Автор плагина
...
Версия плагина
...
Исходный код
#pragma compress 1

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <zombieplague>

#define ACCESS_FLAG ADMIN_LEVEL_C|ADMIN_LEVEL_B

#define MAXPLAYERS 32

new bool: ishooked[32]
new hookorigin[32][3]

new g_laserbeam, g_Gibs1, g_Gibs2

new HumanHook[33], ZombieHook[33], HookTime[33]

public plugin_init() {
register_clcmd("+hook", "FW_Check_Flag")
register_clcmd("-hook", "hook_off")

register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public event_round_start(id) {
for(new i; i < MAXPLAYERS + 1; i++) {
HumanHook[i] = 0
ZombieHook[i] = 0
HookTime[i] = 0
}
}

public plugin_precache() {
precache_sound("zmkod30/king_hook.wav")

g_laserbeam = precache_model("sprites/laserbeam.spr")
g_Gibs1 = precache_model("sprites/zmkod30/fire_gibs.spr")
g_Gibs2 = precache_model("sprites/zmkod30/frost_gibs.spr")
}

public client_disconnected(id)
remove_hook(id)
public client_putinserver(id)
remove_hook(id)

public FW_Check_Flag(id) {
if(get_user_flags(id) & ACCESS_FLAG)
hook_on(id)

return PLUGIN_HANDLED
}

public hook_on(id) {
if(!is_user_alive(id))
return PLUGIN_HANDLED

if(zp_get_user_zombie(id)) {
if(ZombieHook[id] < 0) {
ZombieHook[id] += 0
} else {
return PLUGIN_HANDLED
}
} else {
if(HumanHook[id] < 3) {
HumanHook[id] += 1
} else {
return PLUGIN_HANDLED
}
}

get_user_origin(id, hookorigin[id-1], 3)

ishooked[id-1] = true

emit_sound(id, CHAN_STATIC, "zmkod30/king_hook.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
HookTime[id] = 100
set_task(0.1, "hook_task", id, "", 0, "ab")
hook_task(id)

return PLUGIN_HANDLED
}

public is_hooked(id)
return ishooked[id-1]

public hook_off(id) {
remove_hook(id)

return PLUGIN_HANDLED
}

public hook_task(id) {
if(!is_user_connected(id) || !is_user_alive(id) || HookTime[id] == 0) {
remove_hook(id)
remove_beam(id)
} else {
remove_beam(id)
draw_hook1(id)
draw_hook2(id)
draw_hook3(id)
}

HookTime[id] -= 1
new origin[3], Float: velocity[3]
get_user_origin(id, origin)
new distance = get_distance(hookorigin[id-1], origin)

if(distance > 25) {
velocity[0] = (hookorigin[id-1][0] - origin[0]) * (2.0 * 350 / distance)
velocity[1] = (hookorigin[id-1][1] - origin[1]) * (2.0 * 350 / distance)
velocity[2] = (hookorigin[id-1][2] - origin[2]) * (2.0 * 350 / distance)

entity_set_vector(id, EV_VEC_velocity, velocity)
} else {
entity_set_vector(id, EV_VEC_velocity, Float: {0.0, 0.0, 0.0})
remove_hook(id)
}
}

public draw_hook1(id) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(1)
write_short(id)
write_coord(hookorigin[id - 1][0])
write_coord(hookorigin[id - 1][1])
write_coord(hookorigin[id - 1][2])
write_short(g_laserbeam)
write_byte(0)
write_byte(0)
write_byte(1)
write_byte(50)
write_byte(1)

if(zp_get_user_zombie(id)) {
write_byte(0)
write_byte(0)
write_byte(0)
} else {
write_byte(random_num(1, 255))
write_byte(random_num(1, 255))
write_byte(random_num(1, 255))
}

write_byte(255)
write_byte(0)
message_end()

FW_Gibs1(id)
}

public draw_hook2(id) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(1)
write_short(id)
write_coord(hookorigin[id - 1][0])
write_coord(hookorigin[id - 1][1])
write_coord(hookorigin[id - 1][2])
write_short(g_laserbeam)
write_byte(0)
write_byte(0)
write_byte(1)
write_byte(20)
write_byte(30)

if(zp_get_user_zombie(id)) {
write_byte(0)
write_byte(0)
write_byte(0)
} else {
write_byte(random_num(1, 255))
write_byte(random_num(1, 255))
write_byte(random_num(1, 255))
}

write_byte(255)
write_byte(0)
message_end()

FW_Gibs2(id)
}

public draw_hook3(id) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(1)
write_short(id)
write_coord(hookorigin[id - 1][0])
write_coord(hookorigin[id - 1][1])
write_coord(hookorigin[id - 1][2])
write_short(g_laserbeam)
write_byte(0)
write_byte(0)
write_byte(1)
write_byte(20)
write_byte(60)

if(zp_get_user_zombie(id)) {
write_byte(0)
write_byte(0)
write_byte(0)
} else {
write_byte(random_num(1, 255))
write_byte(random_num(1, 255))
write_byte(random_num(1, 255))
}

write_byte(255)
write_byte(0)
message_end()

new RandomSpr = random_num(1, 2)
switch(RandomSpr) {
case 1: FW_Gibs1(id)
case 2: FW_Gibs2(id)
}
}

public FW_Gibs1(id) {
new origin[3]
get_user_origin(id, origin)

message_begin(MSG_ALL, SVC_TEMPENTITY, {0, 0, 0}, id)
write_byte(TE_SPRITETRAIL)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2] + 5)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2] + 80)
write_short(g_Gibs1)
write_byte(random_num(5, 5))
write_byte(1)
write_byte(1)
write_byte(20)
write_byte(10)
message_end()
}

public FW_Gibs2(id) {
new origin[3]
get_user_origin(id, origin)

message_begin(MSG_ALL, SVC_TEMPENTITY, {0, 0, 0}, id)
write_byte(TE_SPRITETRAIL)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2] + 5)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2] + 80)
write_short(g_Gibs2)
write_byte(random_num(5, 5))
write_byte(1)
write_byte(1)
write_byte(20)
write_byte(10)
message_end()
}

public remove_hook(id) {
if(task_exists(id))
remove_task(id)

remove_beam(id)
ishooked[id-1] = false
}

public remove_beam(id) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(99)
write_short(id)
message_end()
}
Хочу сделать проверку на 2 флага доступа, что-то пошло не так:negative:
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
2,751
Реакции
3,017
Помог
61 раз(а)
Какие были предприняты попытки? Что именно пошло не так и что ожидаемо?!
 
Сообщения
209
Реакции
28
Помог
8 раз(а)
wopox1337, Сделал проверку на флаги доступа. Если оставить один из флагов, то работает, если добавить второй и больше, перестаёт работать.
 
Сообщения
2,751
Реакции
3,017
Помог
61 раз(а)
При заходе на сервер пропиши amx_who в консоли - покажи флаги. Покажи содержимое user.ini или системы работы с правами пользователей.
 
Сообщения
209
Реакции
28
Помог
8 раз(а)
wopox1337, Флаг до дефолту стоит такой "s", они могут использовать функции данного плагина, а такого быть не должно. Выдаю через gamecms api.
 
Сообщения
2,751
Реакции
3,017
Помог
61 раз(а)
Тут каткти стоило затронуть тему почему define иногда вреден и лучше const
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу