GodWar Posted July 9, 2012 Author Share Posted July 9, 2012 This Tutorial will give you a new feature. At the moment you can send via Server, item to one or all players.**Screenshot:**[![](http://www.freemmorpgmaker.com/files/imagehost/pics/78ba99f2987295988cbff5819937228f.png)](http://www.freemmorpgmaker.com/files/imagehost/#78ba99f2987295988cbff5819937228f.png)**Server:**modServerTCPAt the end add:```' New Server CommandsSub SendItem(ByVal playerID As Long, ByVal itemID As Long, ByVal Count As Long)Dim i As LongDim players As String players = "" If frmServer.Combo_ItemPlayerID.ListIndex > 0 Then If IsPlaying(playerID) Then players = GetPlayerName(playerID) SpawnItem itemID, Count, GetPlayerMap(playerID), GetPlayerX(playerID), GetPlayerY(playerID), GetPlayerName(playerID) TextAdd ("Item: " & itemID & " was send to: " & players) Else TextAdd ("The player is not online!") End If Else For i = 1 To frmServer.lvwInfo.ListItems.Count If IsPlaying(i) Then players = players & GetPlayerName(i) & ", " SpawnItem itemID, Count, GetPlayerMap(i), GetPlayerX(i), GetPlayerY(i), GetPlayerName(i) End If Next i If players > vbNullString Then TextAdd ("Item: " & itemID & " was send to: " & players) Else TextAdd ("No user online!") End If End IfEnd Sub```And replace the frmServer.frm with yours in "\server\src\". (Before make secure copy of yours)Maybe more features follow later!And to jcsnider :)You can use it in your next release if you wan't :) Link to comment Share on other sites More sharing options...
jcsnider Posted July 9, 2012 Share Posted July 9, 2012 I would do a check to make sure the player is online (Function: IsPlaying()) before spawning the item. But overall the code looks alright. Link to comment Share on other sites More sharing options...
GodWar Posted July 9, 2012 Author Share Posted July 9, 2012 I do:"If frmServer.lvwInfo.ListItems(i).SubItems(1) > vbNullString Then"!Its the same i think ^^ It search the list and i ther is a entry it is online! I tested it with 4 player and it works also if player goes offline and so on! Link to comment Share on other sites More sharing options...
Stein Posted July 9, 2012 Share Posted July 9, 2012 You're better off using IsPlaying to make sure nothing goes wrong, because you don't need to be fully in-game for that value of yours to change. :] Link to comment Share on other sites More sharing options...
GodWar Posted July 9, 2012 Author Share Posted July 9, 2012 I changed something. Add errormessage if player offline and confirmation message! Only replace the sourcecode with the new in POST 1 here. And replace the new frmServer :)Also use IsPlaying :P Link to comment Share on other sites More sharing options...
Joyce Posted July 9, 2012 Share Posted July 9, 2012 Also, don't use messageboxes for this. It freezes your server's processing, instead add it to the textbox where the chatlog comes up in. Link to comment Share on other sites More sharing options...
GodWar Posted July 9, 2012 Author Share Posted July 9, 2012 OH this i don't know i change this :)*EDIT*CHANGED!Replace the SourceCode in Post 1 with yours :) Link to comment Share on other sites More sharing options...
Kajamaz Posted July 13, 2012 Share Posted July 13, 2012 Does this work for eo 2.0? Link to comment Share on other sites More sharing options...
Exception Posted July 13, 2012 Share Posted July 13, 2012 @Kajamaz:> Does this work for eo 2.0?Of course. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now