@@ -33,7 +33,8 @@ new ca_gag_times[64],
3333 ca_gag_sound_error[128 ],
3434 bool: ca_gag_block_nickname_change,
3535 bool: ca_gag_block_admin_chat,
36- bool: ca_gag_common_chat_block
36+ bool: ca_gag_common_chat_block,
37+ ca_gag_own_reason_enabled
3738
3839new g_dummy, g_itemInfo[64 ], g_itemName[128 ]
3940
@@ -216,6 +217,15 @@ Register_CVars() {
216217 ),
217218 ca_gag_common_chat_block
218219 )
220+
221+ bind_pcvar_num (create_cvar (" ca_gag_own_reason_enabled" , " 1" ,
222+ .description = " Enable own gag reason\n \
223+ 0 = disabled (excluding when there are no reasons)\n \
224+ 1 = enabled, at first position in reasons list\n \
225+ 2 = enabled, at last position in reasons list"
226+ ),
227+ ca_gag_own_reason_enabled
228+ )
219229}
220230
221231public client_putinserver (id) {
@@ -409,7 +419,7 @@ static MenuShow_SelectReason(const id) {
409419
410420 new bool: hasReasonsTemplates = bool: (g_gagReasonsTemplates_size != 0 )
411421
412- if (playerFlags & (accessFlagsHigh | accessFlagsOwnReason) || ! hasReasonsTemplates) {
422+ if (ca_gag_own_reason_enabled == 1 && playerFlags & (accessFlagsHigh | accessFlagsOwnReason) || ! hasReasonsTemplates) {
413423 menu_additem (menu, fmt (" % L\n " , id, " Gag_EnterReason" ), fmt (" %i " , ITEM_ENTER_GAG_REASON))
414424 }
415425
@@ -445,6 +455,10 @@ static MenuShow_SelectReason(const id) {
445455
446456 menu_additem (menu, buffer, fmt (" %i " , i))
447457 }
458+
459+ if (ca_gag_own_reason_enabled == 2 && playerFlags & (accessFlagsHigh | accessFlagsOwnReason)) {
460+ menu_additem (menu, fmt (" % L\n " , id, " Gag_EnterReason" ), fmt (" %i " , ITEM_ENTER_GAG_REASON))
461+ }
448462 } else {
449463 menu_addtext (menu, fmt (" \\ d % L" , id, " Gag_NoTemplatesAvailable_Reasons" ), .slot = false )
450464 }
0 commit comments