Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Little Help with News
#1
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)