Arena Battles
From VbGORE Visual Basic Online RPG Engine
You need to code the declares yourself(this eliminates those who just script kiddie), but other than that: Made a new table in the database. Call it battlemaps. Make two fields (both as integers). Call them map and players. Now open the table and do something like this
| MAP | Players |
|---|---|
| 5 | 0 |
| 6 | 0 |
| 7 | 0 |
| 8 | 0 |
| 9 | 0 |
| 10 | 0 |
Replace map with your arena maps.
Go to server-TCP and add these subs:
Sub Data_Battle(ByRef rbuf As DataBuffer, ByVal UserIndex As Integer) Dim i As Long Dim mapnum As Integer 'map with least Dim n As Integer 'number of players 'We need to open the database so we can update it. We will open the database in desceding order. DB_RS.Open "SELECT * FROM battlemap ORDER BY players desc" Do mapnum = DB_RS!Map n = DB_RS!players DB_RS.MoveNext Loop Until n <= 2 'max players CHANGE TO ANY NUMBER YOU WANT DB_RS!players = DB_RS!players + 1 mapnum = DB_RS!Map DB_RS.Update DB_RS.Close User_WarpChar UserIndex, mapnum, 1, 1 'warp char to map End Sub Sub Data_Battle_Leave(ByRef rbuf As DataBuffer, ByVal UserIndex As Integer) Dim i As Long Dim mapnum As Integer 'map with least Dim n As Integer 'number of players Dim currmap As Integer 'map user is on right now currmap = UserList(UserIndex).Pos.Map DB_RS.Open "SELECT * FROM battlemap where `map`='" & currmap & "'" DB_RS!players = DB_RS!players - 1 DB_RS.Update DB_RS.Close User_WarpChar UserIndex, 1, 15, 15 'CORDINATES TO WARP THE CHAR BACK TO MAP#,X,Y End Sub
Now have fun.



