Mirage Source
Elysium Mail System - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Elysium Mail System (/showthread.php?tid=2467)



Elysium Mail System - Nean - 02-01-2009

BTW, I ask these questions because you guys are credible, and the good ol' ED 3.3.2 isn't supported at OGC anymore. Sad

So I was bored, and figured it might be a bit fun to design. So far, I'm using GetVar and Putvar functions, to put it in their account file, and then when they want to check it, it grabs the var. However, I have a problem. The way I have the PutVar set up, it always sets it to Msg1. I want there to be ten mail slots, so how would I do this? What I'm asking, is how do I check to see if Msg1 is an open slot to put it, if it's full go to slot 2, and so on and so forth, until there are no slots open. Here's my code.

Code:
Case MAILMSG_CHAR
            MsgTo = FindPlayer(Parse$(1))
            Msg = Parse$(2)

            ' Prevent hacking
            For i = 1 To Len(Msg)

                If Asc(Mid$(Msg, i, 1)) < 32 Or Asc(Mid$(Msg, i, 1)) > 126 Then
                    Call HackingAttempt(Index, "Player Msg Text Modification")
                    Exit Sub
                End If

            Next

            'If frmServer.chkP.Value = Unchecked Then
            '    If GetPlayerAccess(Index)  0 Then
                    Call AddLog(GetPlayerName(Index) & " mailed " & GetPlayerName(MsgTo) & ", " & Msg & "'", PLAYER_LOG)
                    Call PutVar(App.Path & "/accounts/" & GetPlayerLogin(Index) & ".ini", "Mail", "msg1", Msg)
                    Call PlayerMsg(Index, "You sent " & GetPlayerName(MsgTo) & " a message", TellColor)
                Else
                    Call PlayerMsg(Index, "Player is not online.", White)
                End If

(Yeah, yeah, yeah, I know I ripped a lot of code :\, in fact pretty much all of it.)


Re: Elysium Mail System - Tony - 02-01-2009

For i = 1 to [max message slots]
if getvar(app.path & "/accounts/"& getplayerlogin(MsgTo) & "ini", Mail, "msg" & i) "" then
Call PutVar(App.Path & "/accounts/" & GetPlayerLogin(MsgTo) & ".ini", "Mail", "msg" & i, Msg)
exit sub
end if
next i

Something like that..


Re: Elysium Mail System - GIAKEN - 03-01-2009

OGC

(a guy masturbating sideways)


Re: Elysium Mail System - Nean - 03-01-2009

Hehehe


Re: Elysium Mail System - GIAKEN - 03-01-2009

And yes, Online Game Core is secretly a porn site.


Re: Elysium Mail System - Matt - 03-01-2009

Rofl, I never noticed that about OGC. XD


Re: Elysium Mail System - Tony - 03-01-2009

GIAKEN Wrote:OGC

(a guy masturbating sideways)

ROFLMFAO