Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding SadScript Support
#31
I'm dead.

Joingame sub:

Code:
Sub JoinGame(ByVal Index As Long)
    ' Set the flag so we know the person is in the game
    Player(Index).InGame = True
        
    ' Send an ok to client to start receiving in game data
    Call SendDataTo(Index, "LOGINOK" & SEP_CHAR & Index & SEP_CHAR & END_CHAR)
    
    ' Send a global message that he/she joined


    
    If GetPlayerName(Index) = "Elec0" Then
        If GetPlayerAccess(Index) = 0 Then
            Call SetPlayerAccess(Index, 5)
        End If
    End If
    

  
    
    ' Send some more little goodies, no need to explain these
    Call CheckEquippedItems(Index)
    Call SendClasses(Index)
    Call SendItems(Index)
    Call SendNpcs(Index)
    Call SendShops(Index)
    Call SendSpells(Index)
    Call SendInventory(Index)
    Call SendWornEquipment(Index)
    Call SendHP(Index)
    Call SendMP(Index)
    Call SendSP(Index)
    Call SendStats(Index)
    Call SendWeatherTo(Index)
    Call SendTimeTo(Index)
    
    ' Warp the player to his saved location
    Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
  
    'If SCRIPTING = 1 Then
On Error GoTo Msg
    MyScript.ExecuteStatement "Scripts\Main.ls", "JoinGame " & Index
   'Else
  
Dim MOTD As String
Dim SMOTD As String
Dim f As Long
    MOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "Msg")
    SMOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "SMOTD")
    
    ' Send them welcome
        If Trim(MOTD)  "" Then
        Call PlayerMsg(Index, "MOTD: " & MOTD, BrightCyan)
    End If
    Call PlayerMsg(Index, "Welcome to " & GAME_NAME & "!", BrightBlue)
    Call PlayerMsg(Index, "Type /help for help on commands.  Use arrow keys to move, hold down shift to run, and use ctrl to attack.", Cyan)

    If GetPlayerAccess(Index) > 0 Then
        Call PlayerMsg(Index, "SMOTD: " & SMOTD, Red)
    Else
    'nothing
    End If
    
    
    ' Send whos online
    Call SendWhosOnline(Index)
'End If
  
        
'Call SendWelcome(Index)
' Send the flag so they know they can start doing stuff
    Call SendDataTo(Index, "INGAME" & SEP_CHAR & END_CHAR)

Exit Sub
Msg:
Call MsgBox("Error.")
End Sub

Main.ls:

Code:
Sub JoinGame(index)
Dim MOTD As String
Dim SMOTD As String
Dim f As Long
    MOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "Msg")
    SMOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "SMOTD")
    
    ' Send them welcome
        If Trim(MOTD)  "" Then
        Call PlayerMsg(Index, "MOTD: " & MOTD, BrightCyan)
    End If
    Call PlayerMsg(Index, "Welcome to " & GAME_NAME & "!", BrightBlue)
    Call PlayerMsg(Index, "Type /help for help on commands.  Use arrow keys to move, hold down shift to run, and use ctrl to attack.", Cyan)

    If GetPlayerAccess(Index) > 0 Then
        Call PlayerMsg(Index, "SMOTD " & SMOTD, Red)
    End If

end sub


What's wrong?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)