Need help with my custom page (droplist)
Hi,
I've created a custom page.
http://cs-erweiterungen.de/Picture.jpg
On the custom page the user can insert his steam ID/IP or a name. When he has insert his steam ID/IP or name he must choose which type it is.
It's for define an Admin. One can define 3 Admins.
The first "admin code" works fine but I've a problem with the 2 others.. when one choose the type of Admin in the droplist it isn't work. In the "users.ini" file are further the words Flag1 or Flag2.
Could you help me?
; Password Page
Function Steam_IDPage
!insertmacro SectionFlagIsSet ${Section2} ${SF_SELECTED} ShowPage SkipPage
ShowPage:
GetDlgItem $R0 $HWNDPARENT 2
EnableWindow $R0 0|1 # 0=hide, 1=show
GetDlgItem $R0 $HWNDPARENT 3
EnableWindow $R0 0|1 # 0=hide, 1=show
!insertmacro MUI_HEADER_TEXT "Konfiguration des Erweiterungs System" "Tragen Sie die Administratoren ein."
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "steam_id.ini"
SkipPage:
FunctionEnd
Function .OnGUIEnd
Call CopyFlag
FunctionEnd
; Copy Flag
!macro REPLACE_FLAG1 SOURCE
Push "Flag1" #-- text to be replaced within the " "
Push "${SOURCE}" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\cstrike\addons\amxmodx\configs\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
goto done3
!macroend
; Copy Flag
!macro REPLACE_FLAG2 SOURCE
Push "Flag2" #-- text to be replaced within the " "
Push "${SOURCE}" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\cstrike\addons\amxmodx\configs\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
goto done3
!macroend
; Copy Flag
!macro REPLACE_FLAG3 SOURCE
Push "Flag3" #-- text to be replaced within the " "
Push "${SOURCE}" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\cstrike\addons\amxmodx\configs\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
goto done3
!macroend
; Copy Flag
Function CopyFlag
;1
Push $R0
ReadINIStr $R0 "$PLUGINSDIR\steam_id.ini" "Field 12" "State"
StrCmp $R0 "Steam ID" 0 notSteamID1
!insertmacro REPLACE_FLAG1 ce
notSteamID1:
StrCmp $R0 "IP" 0 notIP1
!insertmacro REPLACE_FLAG1 de
notIP1:
StrCmp $R0 "Name" 0 done1
!insertmacro REPLACE_FLAG1 be
done1:
;2
ReadINIStr $R0 "$PLUGINSDIR\steam_id.ini" "Field 13" "State"
StrCmp $R0 "Steam ID" 0 notSteamID2
!insertmacro REPLACE_FLAG2 ce
notSteamID2:
StrCmp $R0 "IP" 0 notIP2
!insertmacro REPLACE_FLAG2 de
notIP2:
StrCmp $R0 "Name" 0 done2
!insertmacro REPLACE_FLAG2 be
done2:
;3
ReadINIStr $R0 "$PLUGINSDIR\steam_id.ini" "Field 14" "State"
StrCmp $R0 "Steam ID" 0 notSteamID3
!insertmacro REPLACE_FLAG3 ce
notSteamID3:
StrCmp $R0 "IP" 0 notIP3
!insertmacro REPLACE_FLAG3 de
notIP3:
StrCmp $R0 "Name" 0 done3
!insertmacro REPLACE_FLAG3 be
done3:
Pop $R0
FunctionEnd
LangString NoSteam_ID ${LANG_GERMAN} "Bitte geben Sie eine Steam_ID ein!"
; Page Leave Feautures
Function PageLeaveSteam_ID
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "steam_id.ini" "Field 7" "State"
${If} $R0 != ""
Push "steamid1" #-- text to be replaced within the " "
Push "$R0" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\cstrike\addons\amxmodx\configs\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
${EndIf}
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "steam_id.ini" "Field 8" "State"
${If} $R0 != ""
Push "steamid2" #-- text to be replaced within the " "
Push "$R0" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\cstrike\addons\amxmodx\configs\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
${EndIf}
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "steam_id.ini" "Field 9" "State"
${If} $R0 != ""
Push "steamid3" #-- text to be replaced within the " "
Push "$R0" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\cstrike\addons\amxmodx\configs\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
${EndIf}
ReadIniStr $0 '$PLUGINSDIR\steam_id.ini' 'Field 12' 'State'
strcmp $0 '' error ok
error:
MessageBox MB_OK "Bitte wählen Sie einen 'Admintyp' aus!"
abort
ok:
FunctionEnd