Public Function GetField(byref ptFields() as string,byval pFieldIndex) as String If pFieldIndex>UBound(ptFields) Then GetField="" Else GetField=ptFields(pFieldIndex) End if end function
Public Function GetField(ByRef ptFields() As String, ByVal pFieldIndex) As String If pFieldIndex > UBound(ptFields) Then GetField = "" Else GetField = ptFields(pFieldIndex) End If End Function
'--------------login------ If Right(rsck, 6) = "/login" Then cdc = Split(rsck, "|") pseudo = GetField(cdc, 0) id = GetField(cdc, 1) slot = GetField(cdc, 2) dragon = GetField(cdc, 3) force = GetField(cdc, 4) defence = GetField(cdc, 5) pv = GetField(cdc, 6) pm = GetField(cdc, 7) pa = GetField(cdc, 8) lvl = GetField(cdc, 9) xp = GetField(cdc, 10) apparence = GetField(cdc, 11) inscrit = GetField(cdc, 12) connexion = GetField(cdc, 13) dramas = GetField(cdc, 14) sexe = GetField(cdc, 15) element = GetField(cdc, 16) Form3.Label22.Caption = pseudo If apparence = "1" Then Form3.Image10.Visible = True ElseIf apparence = "0" Then Form3.Image11.Visible = True ElseIf apparence = "2" Then Form3.Image7.Visible = True ElseIf apparence = "3" Then Form3.Image6.Visible = True ElseIf apparence = "4" Then Form3.Image9.Visible = True ElseIf apparence = "5" Then Form3.Image8.Visible = True End If If sexe = "1" Then Form3.Image4.Visible = True ElseIf sexe = "2" Then Form3.Image5.Visible = True End If If element = "1" Then Form3.Image13.Visible = True ElseIf element = "2" Then Form3.Image12.Visible = True ElseIf element = "3" Then Form3.Image14.Visible = True ElseIf element = "4" Then Form3.Image15.Visible = True ElseIf element = "5" Then Form3.Image16.Visible = True End If Form3.Label13.Caption = force Form3.Label14.Caption = defence Form3.Label15.Caption = pv Form3.Label16.Caption = pa Form3.Label17.Caption = pm Form3.Label18.Caption = lvl Form3.Label19.Caption = xp Form3.Label20.Caption = dramas Form3.Show Form1.Visible = False End If
If left (rsck,6) = "/login" then cdc = split (rsck,"|") If right (rsck,6) = "login/" then cdc(0) = pseudo cdc(1) = test etc ...
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question'--------------Login------------------ If Right(rsck, 6) = "/login" Then ergt1 = String(255, 0) ergt2 = String(255, 0) ergt3 = String(255, 0) ergt4 = String(255, 0) ergt5 = String(255, 0) ergt6 = String(255, 0) ergt7 = String(255, 0) ergt8 = String(255, 0) ergt9 = String(255, 0) ergt10 = String(255, 0) ergt11 = String(255, 0) ergt12 = String(255, 0) ergt13 = String(255, 0) ergt14 = String(255, 0) ergt15 = String(255, 0) ergt16 = String(255, 0) ergt17 = String(255, 0) ergt18 = String(255, 0) ergt19 = String(255, 0) cdc = Split(rsck, "|") If Dir$(App.Path & "\Accounts" & cdc(0) & ".ini") = vbNullString Then 'existe pas Winsock1(Index).SendData "/erlog" Else a = GetPrivateProfileString(App.Title, "mdp", "default", ergt1, 255, App.Path & "\Accounts" & cdc(0) & ".ini") Label4.Caption = cdc(1) Label3.Caption = ergt1 If Label3.Caption = Label4.Caption Then rsctxt.Text = Winsock1(Index).Index & " - " & cdc(0) & " Vien de se connecté a Dramen" & vbCrLf & rsctxt.Text id = Winsock1(Index).Index a = GetPrivateProfileString(App.Title, "dragonnom", "default", ergt2, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "couleur", "default", ergt3, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "element", "default", ergt4, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "sexe", "default", ergt5, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "force", "default", ergt6, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "defense", "default", ergt7, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "pv", "default", ergt8, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "dramas", "default", ergt9, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "level", "default", ergt10, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "dmdcbt", "default", ergt11, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "nomcbt", "default", ergt12, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "inscrit", "default", ergt13, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "connexion", "default", ergt14, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "jeux", "default", ergt15, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "promenade", "default", ergt16, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "deplacement", "default", ergt17, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "boitltr", "default", ergt18, 255, App.Path & "\Accounts" & cdc(0) & ".ini") a = GetPrivateProfileString(App.Title, "boitltrmsg", "default", ergt19, 255, App.Path & "\Accounts" & cdc(0) & ".ini") Winsock1(Index).SendData ergt2 & "|" & ergt3 & "|" & ergt4 & "|" & ergt5 & "|" & ergt6 & "|" & ergt7 & "|" & ergt8 & "|" & ergt9 & "|" & ergt10 & "|" & ergt11 & "|" & ergt12 & "|" & ergt13 & "|" & ergt14 & "|" & ergt15 & "|" & ergt16 & "|" & ergt17 & "|" & ergt18 & "|" & ergt19 & "|" & id & "|" & "/login" Else Winsock1(Index).SendData "/erlog" End If End If End If
'-----------login----- If Right(rsck, 6) = "/login" Then cdc = Split(rsck, "|") pseudo = Text1.Text inscrit = cdc(11) connexion = cdc(12) dragon = cdc(0) couleur = cdc(1) element = cdc(2) sexe = cdc(3) force = cdc(4) defense = cdc(5) pv = cdc(6) dramas = cdc(7) level = cdc(8) dmdcbt = cdc(9) nomcbt = cdc(10) jeux = cdc(13) promenade = cdc(14) deplacement = cdc(15) lettre = cdc(16) lettre2 = cdc(17) id = cdc(18) Form1.Visible = False Form5.Label2.Caption = "Transfere du joueur " & pseudo & " Avec sont Dragon " & dragon Form5.Label2.Caption = Form5.Label2.Caption + ", Transfere en cours dans le monde D'Asteria..." If couleur = "1" Then Form5.WindowsMediaPlayer1.URL = App.Path & "\Vidéo" & "tp4.wmv" ElseIf couleur = "2" Then Form5.WindowsMediaPlayer1.URL = App.Path & "\Vidéo" & "tp2.wmv" ElseIf couleur = "3" Then Form5.WindowsMediaPlayer1.URL = App.Path & "\Vidéo" & "tp1.wmv" ElseIf couleur = "4" Then Form5.WindowsMediaPlayer1.URL = App.Path & "\Vidéo" & "tp5.wmv" ElseIf couleur = "5" Then Form5.WindowsMediaPlayer1.URL = App.Path & "\Vidéo" & "tp3.wmv" End If Form4.Label19.Caption = promenade Form4.Label20.Caption = jeux Form4.Label21.Caption = deplacement Form4.Label2.Caption = pseudo Form4.Label1.Caption = dragon Form4.Label8.Caption = level Form4.Label9.Caption = force Form4.Label10.Caption = defense Form4.Label11.Caption = pv Form4.Label12.Caption = dramas Form4.Label14.Caption = connexion Form4.Label17.Caption = inscrit Form4.Label23.Caption = id If couleur = "1" Then Form4.Image1.Visible = True ElseIf couleur = "2" Then Form4.Image8.Visible = True ElseIf couleur = "3" Then Form4.Image6.Visible = True ElseIf couleur = "4" Then Form4.Image7.Visible = True ElseIf couleur = "5" Then Form4.Image5.Visible = True End If If element = "1" Then Form4.Image9.Visible = True ElseIf element = "2" Then Form4.Image3.Visible = True ElseIf element = "3" Then Form4.Image10.Visible = True ElseIf element = "4" Then Form4.Image11.Visible = True ElseIf element = "5" Then Form4.Image12.Visible = True End If If sexe = "1" Then Form4.Image2.Visible = True Else Form4.Image13.Visible = True End If Form5.Show End If '-------------------
pv = cdc(6)indice en dehors de la plage tout simplement car le serveur ou le client na pas reçu tout les donnée correctement mais j'ai fait un test et ci on met je met un msgbox ben bizarrement il se connecte donc je pense c'est que le client recoi mais essaye directement de mettre dans le tableau ce qui provoque une erreur
'--------------login------ If Right(rsck, 6) = "/login" Then cdc = Split(rsck, "|") For i = 0 To UBound(cdc) Next i pseudo = cdc(0) id = cdc(1) slot = cdc(2) dragon = cdc(3) force = cdc(4) defence = cdc(5) pv = cdc(6) pm = cdc(7) pa = cdc(8) lvl = cdc(9) xp = cdc(10) apparence = cdc(11) inscrit = cdc(12) connexion = cdc(13) dramas = cdc(14) sexe = cdc(15) element = cdc(16) Form3.Label22.Caption = pseudo If apparence = "1" Then Form3.Image10.Visible = True ElseIf apparence = "0" Then Form3.Image11.Visible = True ElseIf apparence = "2" Then Form3.Image7.Visible = True ElseIf apparence = "3" Then Form3.Image6.Visible = True ElseIf apparence = "4" Then Form3.Image9.Visible = True ElseIf apparence = "5" Then Form3.Image8.Visible = True End If If sexe = "1" Then Form3.Image4.Visible = True ElseIf sexe = "2" Then Form3.Image5.Visible = True End If If element = "1" Then Form3.Image13.Visible = True ElseIf element = "2" Then Form3.Image12.Visible = True ElseIf element = "3" Then Form3.Image14.Visible = True ElseIf element = "4" Then Form3.Image15.Visible = True ElseIf element = "5" Then Form3.Image16.Visible = True End If Form3.Label13.Caption = force Form3.Label14.Caption = defence Form3.Label15.Caption = pv Form3.Label16.Caption = pa Form3.Label17.Caption = pm Form3.Label18.Caption = lvl Form3.Label19.Caption = xp Form3.Label20.Caption = dramas Form3.Show Form1.Visible = False End If