Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ryan's Questions.
#1
Ryan's Question Topic

Okay, since I am starting to mess around with MS I made this topic where I can ask quick little questions to make sure I'm doing things right. Trust me there will most likely be daily questions.
(If an admin feels this is necessary then delete this and i apologize.)

Today is my first day at programming. So I decided to start off with something easy, an admin panel.

Questions:
1) Would it only be done in the Client side?
2) What would I use so that it would open on key-press?
3) To load I a form I use "Load frmItemEditor" correct?(Edit)
Reply
#2
1). You can keep it completely client side, so long as all the /editor commands you want in your admin panel are already client side.
2).
Code:
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    
    If KeyCode = vbKeyF1 Then
    ..........
    End If
End Sub
3). You could use either frmForm.Show or frmForm.Visible = True
Reply
#3
Thank you sir.
Reply
#4
Questions:
1) How do you make a pop up come up? (Example: Access level 1 Clicks on MapEditor. Then a pop up comes up yo say "You don't have access to that.")
2) How would I got about changing a players sprite or kicking the player via my client side admin panel?
3) Is it possible to code command buttons without having the sub be about the player clicking on it? (Exmaple: If a player is access level 1 only kick is available.)
Reply
#5
Code:
Call MsgBox("This is a message box!", vbOKOnly, GAME_NAME)
Reply
#6
1)
Code:
If GetPlayerAccess(MyIndex) = 1 Then
If you need more help look at how the current commands work do a search for "/mapeditor" you can see how it shows what commands are available to what access level.

2) Same thing, just look at how the other commands work. It should be pretty simple to figure out from there.

3)
Code:
If GetPlayerAccess(MyIndex) = 1 Then
     cmdMapeditor.Visible = False
     cmdKick.Visible = True
End If
Get it?
Reply
#7
Yeah I think so, but would this work:
Code:
Select Case GetPlayerAccess(Index)
    
    Case Is < 3
    Call MsgBox("You do not have access to this!", vbOKOnly, GAME_NAME)
    Exit Sub
    
    Case Is >= 3
frmItemEditor.Visible = True

End Select
End Sub
Reply
#8
Code:
If LCase(Mid(MyText, 1, 5)) = "/kick" Then
                If Len(MyText) > 6 Then
                    MyText = Mid(MyText, 7, Len(MyText) - 6)
                    Call SendKick(MyText)
                End If
                MyText = ""
                Exit Sub
            End If

I found this. It's what happens when you type /kick to kick a player.

I'm a little confused. My admin panel is set up with a text bar for a name and a command button for the kick action. So would the code be something like:
Code:
Sub Blah Blah On click
MyText = txtName
Call SendKick(MyText)
End Sub
Reply
#9
Whats does Trim$ do? Take whatever is in the text box?

Whats the difference between Len and LenB?
Reply
#10
How do I send a a message box to a player?
Like:
Code:
Call MsgBox(txtWarn.Text, vbOkOnly, GAME_Name)(Trim$(txtName.text))

Heres my sprite set code, looks wrong.
Code:
Private Sub cmdSprite_Click(N As Integer)
Select Case GetPlayerAccess(MyIndex)

N = (Trim$(txtNumber.Text))

Case Is >= 3
If LenB(txtPlayer.Text) = 0 Then
    Call MsgBox("You must enter the name of the player you wish to give a sprite change.", vbOKOnly, GAME_NAME)
End If

If LenB(txtPlayer.Text) > 0 Then
    If LenB(txtNumber.Text) = 0 Then
        Call MsgBox("You must enter the sprite number you wish to change the player to.", vbOKOnly, GAME_NAME)
    End If
End If

    If LenB(txtPlayer.Text) > 0 Then
        If LenB(txtNumber.Text) > 0 Then
            If GetPlayerAccess(MyIndex) >= 2 Then
        Call SendSetSprite(Trim$(N(txtPlayer.Text)))
        End If
    End If
End If

Case Is < 3
    Exit Sub
    

End Select
End Sub

I realize this is a lot of questions, but it should die down soon once I get used to the common commands. Please bare with me and thank you for the help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)