| Mirage Source http://www.miragesource.net/forums/ |
|
| A Little Help with News http://www.miragesource.net/forums/viewtopic.php?f=201&t=4204 |
Page 1 of 1 |
| Author: | DarkX [ Tue Aug 26, 2008 5:15 pm ] |
| Post subject: | A Little Help with News |
Ok, I ended up making a code that does not seem to want to work for me, the Issue is that I can not get it to load on to the frmMainMenu.News.text and it will not save client side. Here is the code please tell me if you see anything missing. Serverside modHandleData Code: ' ::::::::::::::::::::: ' :: Set NEWS packet :: ' ::::::::::::::::::::: If LCase(Parse(0)) = "setNews" Then ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_MAPPER Then Call HackingAttempt(Index, "Admin Cloning") Exit Sub End If Call PutVar(App.Path & "\data\News.ini", "NEWS", "Msg", Parse(1)) Call GlobalMsg("News changed to: " & Parse(1), Yellow) Call AddLog(GetPlayerName(Index) & " changed NEWS to: " & Parse(1), ADMIN_LOG) Exit Sub End If modservertcp Code: Sub SendNewsTo(ByVal index As Long) Dim Packet As String Packet = "NEWS" & SEP_CHAR & ReadINI("DATA", "ServerNews", App.Path & "\Data\News.ini") & SEP_CHAR & END_CHAR Call SendDataTo(index, Packet) End Sub clientside modclienttcp Code: Sub SendNEWSChange(ByVal NEWS As String) Dim packet As String packet = "SETNEWS" & SEP_CHAR & NEWS & SEP_CHAR & END_CHAR Call SendData(packet) End Sub modhandledata Code: ' ::::::::::::::::::::::::::::::::: ' :: News Recieved packet :: ' ::::::::::::::::::::::::::::::::: If LCase(Parse(0)) = "news" Then Call WriteINI("DATA", "News", Parse(1), (App.Path & "\Data\News.ini")) Exit Sub End If modGameLogic Code: Public sub InitNews
Dim I as long Dim News As String Dim News2 As String News= "" News2 = ReadINI("DATA", "Desc", App.Path & "\Data\News.ini") For I = 1 To Len(News) If Mid$(News, I, 1) = "*" Then News2 = News2 Else News2 = News2 & Mid$(News, I, 1) End If Next frmMainMenu.News.Text = News2 End Sub |
|
| Author: | Jacob [ Tue Aug 26, 2008 5:22 pm ] |
| Post subject: | Re: A Little Help with News |
I only looked briefly, but why are you saving / loading to an .ini client side. Just store it to a variable. Change Code: If LCase(Parse(0)) = "setNews" To Code: If LCase(Parse(0)) = "setnews"
|
|
| Author: | DarkX [ Tue Aug 26, 2008 5:30 pm ] |
| Post subject: | Re: A Little Help with News |
I'm not around my VBsoftware right now but, would changing the cap size of letters in a packet actually make that much of a diffrence? |
|
| Author: | Rian [ Tue Aug 26, 2008 5:35 pm ] |
| Post subject: | Re: A Little Help with News |
Well, if Parse(0) = SETNEWS than it's LCase (lower case) isn't going to be setNews |
|
| Author: | Shadow Dragon [ Tue Aug 26, 2008 5:39 pm ] |
| Post subject: | Re: A Little Help with News |
so a Lcase(Parse(0)) has to be all the same size for it to correctly work, is that what your saying? Dark didn't you tell me something like that a while ago? |
|
| Author: | DarkX [ Tue Aug 26, 2008 5:42 pm ] |
| Post subject: | Re: A Little Help with News |
I told you Shadow, the last thing I wrote was that BlackJack code I did for your request. So do you think that could solve my issue? |
|
| Author: | Lea [ Tue Aug 26, 2008 7:24 pm ] |
| Post subject: | Re: A Little Help with News |
LCase is a function that takes a string as an argument, and returns the same string with all letters lowercase. String comparison is case sensitive on VB6. |
|
| Author: | DarkX [ Tue Aug 26, 2008 7:28 pm ] |
| Post subject: | Re: A Little Help with News |
Ok that makes sense, might explain why most of my other codes have slight bugs in them. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|