Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub ChangePorcUser(ByVal Slot As Byte, ByRef Members() As Byte, ByRef Porc() As Byte)
- ' Lleno los datos:
- 'Slot = 1
- 'Members(1) = 1
- 'Members(2) = 0
- 'Members(3) = 2
- 'Members(4) = 0
- 'Members(5) = 3
- 'Porc(1) = 50
- 'Porc(2) = 0
- 'Porc(3) = 40
- 'Porc(4) = 0
- 'Porc(5) = 200
- Dim PorcTotal As Long
- 100 For i = 1 To MAX_MEMBERS
- 101 If Members(i) <> 0 Then
- 102 If Porc(i) > 100 Or Porc(i) < MIN_PORC Then
- 103 WriteConsoleMsg Members(i), "ยซ " & UserList(Members(i)).Name & " ยป . SACA LA MANO DE AHI CARAJO!!!", FontTypeNames.FONTTYPE_WARNING
- 104 Exit Sub
- 105 End If
- 106 If Members(i) <> 0 Then
- 107 Data(Slot).Members(i).Porc = Porc(i)
- 108 PorcTotal = PorcTotal + Porc(i)
- 109 End If
- 110 If PorcTotal <> 100 Then Exit For: Exit Sub
- 111 End If
- 112 Next i
- 113End Sub
- PRIMERA VUELTA:
- 101: Se cumple el condicional porque Members(i) vale 1.
- 102: No cumple el condicional porque Porc(i) vale 50, salta a 106.
- 106: Cumple el condicional de la 101 de nuevo.
- 107: La variable .Porc obtiene el valor de Porc(i) que es 50.
- 108: La variable PorcTotal obtiene el valor de Porc(i) que es 50.
- 110: El condicional se cumple porque PorcTotal es diferente a 100, sale del bucle y salto a 113.
- 113: Chau.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement