Mirage Source http://www.miragesource.net/forums/ |
|
Question about a packet.. http://www.miragesource.net/forums/viewtopic.php?f=201&t=3076 |
Page 1 of 1 |
Author: | jsventor [ Thu Nov 22, 2007 5:47 pm ] |
Post subject: | Question about a packet.. |
I'm making a custom job system, and its going good, I made 90% of the code fine, but I'm having problems thinking of a way to do this, Basically, When you join the game, if your level one, no experience, a picturebox pops up asking what job you want, nothing to serious, just a part of your title, Example, NAME: Xolor JOB: Blacksmith etc.. now, I'm going to have about 4 or five options on the picbox, when I choose one and hit OK it saves me as that, heres my server packet and my client one.. What I need help understanding and with is if I choose option 1 then the packet makes me Job #1 if I pick Option 2 then the packet makes me job #2 etc... Client Code: Sub SendSetJob(ByVal Name As String, ByVal Job As Byte) Dim Packet As String Packet = "SETJOB" & SEP_CHAR & Name & SEP_CHAR & Job & SEP_CHAR & END_CHAR Call SendData(Packet) End Sub Server in Handle data Code: ' :::::::::::::::::::::::
' :: Set Race Job :: ' ::::::::::::::::::::::: If LCase(Parse(0)) = "setjob" Then ' The index n = FindPlayer(Parse(1)) ' The race i = Val(Parse(2)) If i >= 0 Or i <= 3 Then ' Check if player is online If n > 0 Then Call GlobalMsg(GetPlayerName(n) & " become a new & getplayerjob(n).", BrightBlue) Call SetPlayerJob(n, i) Call SendPlayerData(n) Else Call PlayerMsg(Index, "Player is not online.", White) End If Exit Sub End If |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |