Private Sub Command1_Click()' GMOTD change Call WriteINI("GuildMessage", GetPlayerGuild(MyIndex), txtGMOTD, (App.path & "\GMOTD.ini")) FrmGMOTD.Visible = False FrmGuildOwner.Visible = True End Sub
Way, way simple to do that with a few easy lines of sadscript
You would have a SendDatatoCall SendDataTo("guildmotd" & SEP_CHAR & GetPlayerGuild(MyIndex) & SEP_CHAR & txtGulid & END_CHAR)Then in the server (I think IncomingData... Wherever packets are handled (looks like ScriptedItems with a select Case and stuff but with strings as cases).Case "gulidmotd" Call WriteINI("GuildMessage", Parse(1), Parse(2), (App.path & "\GMOTD.ini"))
Call SendData("guildmotd" & SEP_CHAR & GetPlayerGuild(MyIndex) & SEP_CHAR & txtGMOTD & END_CHAR)
Case "guildmotd" Call PutVar(App.Path & "\GMOTD.ini", "GuildMessage", Parse(1), Trim$(parse(2)))Exit Sub
Code: [Select]Case "guildmotd" Call PutVar(App.Path & "\GMOTD.ini", "GuildMessage", Parse(1), Trim$(parse(2)))Exit SubThe Server uses PutVar and GetVar, while the Client uses ReadINI and WriteINI, unless you've changed that, of course.
Sub IncomingData(Socket As JBSOCKETSERVERLib.ISocket, Data As JBSOCKETSERVERLib.IData)
Case "readgmotd" Gmotd = ReadINI(App.Path & "\GMOTD.ini", "GuildMessage", Parse(1))Call SendDataTo(index, "gmotdres" & SEP_CHAR & Gmotd & END_CHAR)Exit Sub
Woot, thx both of you, I got that part to work.Now im having a problem with my next part (Yes, Im a newb at this) How do I make it so when a Player logs into the game now, it displays the Guild Message Of The Day for their guild?But it would have to check to see if the Players Guild has a MOTD set, so each guild has its own MOTD.Right now my GMOTD.ini in my Server Folder looks like this[GuildMessage]Test=Guild Message Of The Day Test1Test is the name of my guild. Then after the = is the MOTD for the guild.
Dim gmotd As Stringgmotd = GetVar(App.Path & "\GMOTD.ini", "GuildMessage", GetPlayerGuild(Index))If gmotd <> vbNullString Then Call PlayerMsg(Index, gmotd, YELLOW)End If
' Send the player the welcome message. MOTD = Trim$(GetVar(App.Path & "\MOTD.ini", "MOTD", "Msg")) If LenB(MOTD) <> 0 Then Call PlayerMsg(index, "MOTD: " & MOTD, 11) End If ' Send the Guild Message Of The Day GMOTD = GetVar(App.Path & "\GMOTD.ini", GetPlayerGuild(index), "GuildMessage") If GMOTD <> vbNullString Then Call PlayerMsg(index, GMOTD, YELLOW) End If
' Send the player the welcome message. MOTD = Trim$(GetVar(App.Path & "\MOTD.ini", "MOTD", "Msg")) If LenB(MOTD) <> 0 Then Call PlayerMsg(index, "MOTD: " & MOTD, 11) End If ' Send the Guild Message Of The Day GMOTD = Trim$(GetVar(App.Path & "\GMOTD.ini", "GuildMessage", GetPlayerGuild(Index))) If GMOTD <> vbNullString Then Call PlayerMsg(index, GMOTD, YELLOW) End If
GMOTD = ReadINI(App.path & "\GMOTD.ini", "GuildMessage", GetPlayerGuild(MyIndex)) frmStable.GuildMsg.Caption = GMOTD
frmStable.GuildMsg.Caption = Trim$(ReadINI("GuildMessage", GetPlayerGuild(MyIndex), App.path & "\GMOTD.ini"))