From c970f7922a09e6832f1cb8060e4675cfb340b776 Mon Sep 17 00:00:00 2001 From: Pichai Lertwachirakul <46616744+zekodef@users.noreply.github.com> Date: Thu, 28 May 2020 04:30:40 +0700 Subject: [PATCH] fix cp command bug --- .../cnr/features/player/player_settings.pwn | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/player/player_settings.pwn b/gamemodes/irresistible/cnr/features/player/player_settings.pwn index 3208cd2..f797864 100644 --- a/gamemodes/irresistible/cnr/features/player/player_settings.pwn +++ b/gamemodes/irresistible/cnr/features/player/player_settings.pwn @@ -60,8 +60,16 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); } - // setting is being toggled ... then + // save setting + TogglePlayerSetting( playerid, settingid, ! p_PlayerSettings[ playerid ] { settingid } ); + // setting is not being toggled if ( ! p_PlayerSettings[ playerid ] { settingid } == true ) + { + if ( settingid == SETTING_COINS_BAR || settingid == SETTING_TOP_DONOR ) { + ShowPlayerTogglableTextdraws( playerid, .force = false ); + } + } + else // setting is being toggled ... then { if ( settingid == SETTING_VIPSKIN ) { SyncObject( playerid ); @@ -69,20 +77,10 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) SetPlayerSkin( playerid, p_LastSkin[ playerid ] ); } - else if ( settingid == SETTING_COINS_BAR || settingid == SETTING_TOP_DONOR ) { - HidePlayerTogglableTextdraws( playerid, .force = false ); - ShowPlayerTogglableTextdraws( playerid, .force = false ); - } - } - else // setting is not being toggled - { if ( settingid == SETTING_COINS_BAR || settingid == SETTING_TOP_DONOR ) { HidePlayerTogglableTextdraws( playerid, .force = false ); - ShowPlayerTogglableTextdraws( playerid, .force = false ); } } - - TogglePlayerSetting( playerid, settingid, ! p_PlayerSettings[ playerid ] { settingid } ); SendServerMessage( playerid, ""COL_ORANGE"%s"COL_WHITE" is now %s. Changes may take effect after spawning/relogging.", g_PlayerSettings[ settingid ], p_PlayerSettings[ playerid ] { settingid } ? ( "enabled" ) : ( "disabled" ) ); if ( ! strmatch( inputtext, "ignore" )) { @@ -202,4 +200,4 @@ stock IsPlayerSettingToggled( playerid, settingid ) { stock IsPlayerVIPSkinToggled( playerid ) { return p_PlayerSettings[ playerid ] { SETTING_VIPSKIN }; -} \ No newline at end of file +}