fix cp command bug

This commit is contained in:
Pichai Lertwachirakul 2020-05-28 04:30:40 +07:00 committed by GitHub
parent 8eabee4f5e
commit c970f7922a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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" ); 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 ( ! 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 ) { if ( settingid == SETTING_VIPSKIN ) {
SyncObject( playerid ); SyncObject( playerid );
@ -69,20 +77,10 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
SetPlayerSkin( playerid, p_LastSkin[ playerid ] ); 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 ) { if ( settingid == SETTING_COINS_BAR || settingid == SETTING_TOP_DONOR ) {
HidePlayerTogglableTextdraws( playerid, .force = false ); 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" ) ); 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" )) { if ( ! strmatch( inputtext, "ignore" )) {
@ -202,4 +200,4 @@ stock IsPlayerSettingToggled( playerid, settingid ) {
stock IsPlayerVIPSkinToggled( playerid ) { stock IsPlayerVIPSkinToggled( playerid ) {
return p_PlayerSettings[ playerid ] { SETTING_VIPSKIN }; return p_PlayerSettings[ playerid ] { SETTING_VIPSKIN };
} }