📄 frmcs.frm
字号:
TabIndex = 9
Tag = "mp_tkpunish"
Top = 390
Width = 225
End
Begin VB.CheckBox Check1
Height = 255
Index = 5
Left = 4140
TabIndex = 8
Tag = "mp_fadetoblack"
Top = 1770
Width = 225
End
Begin VB.ComboBox Combo1
Height = 315
Index = 1
ItemData = "frmCS.frx":1B9E
Left = 4050
List = "frmCS.frx":1BAB
TabIndex = 7
Tag = "mp_forcechasecam"
Text = "1-友军第一视角"
Top = 1290
Width = 1665
End
Begin VB.ComboBox Combo1
Height = 315
Index = 2
ItemData = "frmCS.frx":1BD5
Left = 6750
List = "frmCS.frx":1BE2
TabIndex = 6
Tag = "mp_forcecamera"
Text = "0-只能跟着自己队友"
Top = 1290
Width = 1905
End
Begin VB.TextBox txtServerName
Height = 285
Index = 9
Left = 4050
MaxLength = 5
TabIndex = 5
Tag = "mp_buytime"
Text = "0.25"
Top = 840
Width = 795
End
Begin VB.CommandButton btnSaveConfig
Caption = "保存当前设置"
Height = 495
Left = 600
TabIndex = 4
Top = 2400
Width = 1425
End
Begin VB.CheckBox Check1
Height = 255
Index = 6
Left = 6750
TabIndex = 3
Tag = "sv_alltalk"
Top = 855
Width = 225
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "购买时限(分钟):"
Height = 195
Left = 2775
TabIndex = 53
Top = 885
Width = 1215
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "第一局金钱:"
Height = 195
Index = 7
Left = 3045
TabIndex = 52
Top = 420
Width = 945
End
Begin VB.Image Image1
Height = 1050
Left = 9360
Picture = "frmCS.frx":1C12
Top = 1290
Width = 1050
End
Begin VB.Label Label14
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = ":: 建意, 先备份你的 server.cfg "
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 195
Left = 120
TabIndex = 46
Top = 3030
Width = 2550
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "地图时间:"
Height = 195
Index = 6
Left = 420
TabIndex = 30
Top = 420
Width = 765
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "友军伤害:"
Height = 195
Index = 9
Left = 5910
TabIndex = 29
Top = 420
Width = 765
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "每回合时间:"
Height = 195
Index = 10
Left = 240
TabIndex = 28
Top = 885
Width = 945
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "警匪通话:"
Height = 195
Left = 5910
TabIndex = 27
Top = 885
Width = 765
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "语音通讯:"
Height = 195
Left = 7620
TabIndex = 26
Top = 885
Width = 765
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "冻结时间(秒):"
Height = 195
Left = 150
TabIndex = 25
Top = 1350
Width = 1035
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "死后视角:"
Height = 195
Left = 3225
TabIndex = 24
Top = 1350
Width = 765
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "死后跟随:"
Height = 195
Left = 5910
TabIndex = 23
Top = 1350
Width = 765
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "踢出不动玩家:"
Height = 195
Left = 60
TabIndex = 22
Top = 1800
Width = 1125
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "调整平衡"
Height = 195
Left = 5985
TabIndex = 21
Top = 1800
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "死亡后黑屏:"
Height = 195
Left = 3150
TabIndex = 20
Top = 1800
Width = 945
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "杀害友军惩罚:"
Height = 195
Left = 7260
TabIndex = 19
Top = 420
Width = 1125
End
End
Begin VB.TextBox axt_Mode
Height = 1545
Left = 2610
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 1
Text = "frmCS.frx":26E8
Top = 4650
Visible = 0 'False
Width = 2535
End
Begin VB.TextBox txt_Template
Height = 1545
Left = 60
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Text = "frmCS.frx":2C2A
Top = 4620
Visible = 0 'False
Width = 2535
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim FSO As New Scripting.FileSystemObject
Dim strContent As String
Dim FT As Scripting.TextStream
Dim FM As Scripting.TextStream
Dim CSFolder As String
Dim i As Integer
Private Sub btnSaveConfig_Click()
For i = 0 To txtServerName.Count - 1
If (txtServerName(i).Tag <> "") Then
' p = InStr(0, strContent, txtServerName(i).Tag, VbCompareMethod.vbTextCompare)
strContent = Replace(strContent, "[%" & txtServerName(i).Tag & "%]", txtServerName(i).Text)
End If
Call SaveSetting(App.EXEName, Me.Name, txtServerName(i).Name & "_" & i, txtServerName(i).Text)
Next
For i = 0 To Combo1.Count - 1
If (Combo1(i).Tag <> "") Then
strContent = Replace(strContent, "[%" & Combo1(i).Tag & "%]", Split(Combo1(i).Text, "-")(0))
End If
Call SaveSetting(App.EXEName, Me.Name, Combo1(i).Name & "_" & i, Combo1(i).ListIndex)
Next
For i = 0 To Check1.Count - 1
If (Check1(i).Tag <> "") Then
strContent = Replace(strContent, "[%" & Check1(i).Tag & "%]", Check1(i).Value)
End If
Call SaveSetting(App.EXEName, Me.Name, Check1(i).Name & "_" & i, Check1(i).Value)
Next
Set FT = FSO.OpenTextFile(CSFolder & "\server.cfg", ForWriting, True)
FT.Write (strContent)
FT.Close
Set FM = FSO.OpenTextFile(CSFolder & "\motd.txt", ForWriting, True)
FM.Write (Replace(axt_Mode.Text, "[%hostname%]", txtServerName(0).Text))
FM.Close
End Sub
Private Sub Command1_Click()
Call btnSaveConfig_Click
Shell ("hlds.exe -game cstrike -insecure -port " & txtServerName(1).Text & _
" +maxplayers " & txtServerName(4).Text & " +map " & Combo1(0).Text & " -console")
End Sub
Private Sub Form_Load()
' Set FT = FSO.OpenTextFile(App.Path & "\cfg.server")
' strContent = FT.ReadAll()
CSFolder = App.Path & "\cstrike"
If (Not FSO.FolderExists(CSFolder)) Then
Call MsgBox("请将此程序复制到 CS 服务根目录再执行..." & vbCrLf & vbCrLf & _
Chr(9) & Chr(9) & "HTTP://CQDYH.YEAH.NET" & vbCrLf & _
Chr(9) & Chr(9) & Chr(9) & "-- Marksoft.NET" & vbCrLf & vbCrLf, vbOKOnly + vbSystemModal + vbExclamation, "当前执行路径无效 -- Marksoft.NET")
Unload Me
End
Else
lblVer.Caption = lblVer.Caption & "." & App.Major & App.Minor & "." & App.Revision
strContent = txt_Template.Text
txtContent.Text = txtContent.Text & Space(4) & "http://marksoft.home4u.china.com"
For i = 0 To txtServerName.Count - 1
txtServerName(i).Text = GetSetting(App.EXEName, Me.Name, txtServerName(i).Name & "_" & i, txtServerName(i).Text)
Next
For i = 0 To Combo1.Count - 1
Combo1(i).ListIndex = GetSetting(App.EXEName, Me.Name, Combo1(i).Name & "_" & i, Combo1(i).ListIndex)
Next
For i = 0 To Check1.Count - 1
Check1(i).Value = GetSetting(App.EXEName, Me.Name, Check1(i).Name & "_" & i, Check1(i).Value)
Next
End If
End Sub
Private Sub Image1_Click()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -