Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

/status system


Growlith1223
 Share

Recommended Posts

Ok so i was bored…and i made this system lol

go into ModInput and goto the Select Case and after

```

Case "/help"

Call AddText("Social Commands:", HelpColor)

Call AddText("'msghere = Broadcast Message", HelpColor)

Call AddText("-msghere = Emote Message", HelpColor)

Call AddText("!namehere msghere = Player Message", HelpColor)

Call AddText("Available Commands: /info, /who, /fps, /fpslock", HelpColor)

```
Add

```

Case "/status"

Select Case UBound(Command)

Case 1

Status = Command(1)

Case 2

Status = Command(1) & " " & Command(2)

Case 3

Status = Command(1) & " " & Command(2) & " " & Command(3)

Case 4

Status = Command(1) & " " & Command(2) & " " & Command(3) & " " & Command(4)

End Select

Set Buffer = New clsBuffer

Buffer.WriteLong CStatus

Buffer.WriteString Status

SendData Buffer.ToArray

Set Buffer = Nothing

```
Then In ModHandleData, in Sub HandlePlayerData add

```

Player(Index).Status = Buffer.ReadString

```
After

```

Call SetPlayerPK(i, Buffer.ReadLong)

```

Once done, go and add

```

Status As String

```
In the PlayerRec Do the same for Server Side

Also Go into modEnumerations and add CStatus in the Client packets same for Server side as well

Go into ModText and goto DrawPlayerName replace

```

Name = Trim$(Player(Index).Name)

```
With

```

If Len(Trim$(Player(Index).Status)) <= 0 Then

Name = Trim$(Player(Index).Name)

Else

Name = Trim$(Player(Index).Name) & "[" & Trim$(Player(Index).Status) & "]"

End If
```

**Server Side**

Goto ModHandleData and Add

```

HandleDataSub(CStatus) = GetAddress(AddressOf HandleSetStatus)

```
Under all the other Messages

Then Add This sub at the bottom

```

Private Sub HandleSetStatus(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer

Dim Status As String

Dim Result As String

Set Buffer = New clsBuffer

Buffer.WriteBytes Data()

Status = Buffer.ReadString

Result = Status

Call SetPlayerStatus(Index, Result)

Call SendPlayerData(Index)

Set Buffer = Nothing

End Sub
```

Then, go to Sub PlayerData And add

```

Buffer.WriteString Player(Index).Status

```
Under the GetPlayerPK one

That should be it…Lemme know if any errors come up! :3

Screenshot

![](http://www.freemmorpgmaker.com/files/imagehost/pics/8add6a0440324149e8a6d2b60a9ee537.png)

EDIT: i have made a mistake, go into ModInput and add

```

Dim Status As String * 20

```
and that should complete everything and also should add a char count limiter

EDIT2:

Ok i forgot a sub…In modPlayer in the server, add this to the bottom of it

```

Sub SetPlayerStatus(ByVal index As Long, Status As String)

Player(index).Status = Status

End Sub
```
Link to comment
Share on other sites

What Status system mean..? You should give a Description about this System… ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)

BTW nice work you can make the System ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

Instead of doing all the Ifs in the /status case, why not just put them all into a Select Case? It's much faster ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png).
Link to comment
Share on other sites

> Instead of doing all the Ifs in the /status case, why not just put them all into a Select Case? It's much faster ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png).

Yea i figured that would be a whole lot faster x3

Lemme update the original post for that. Thanks for that though!

> Looks good! Thanks for sharing!

Thanks!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...