Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Command


Recommended Posts

I put this jail command in but when i go in server and under scripts say turn on so i closed i also went/server/data and said scripting=1 but its freezes on loading scripts even with out it no script works always freezes on loading scripts

ps im using ee 2,8

this is where i put the command please help

' Executed whenever a slash command is sent to the server.
Sub Commands(Index)
  Dim TextSay
  Dim PlayerID
  Dim MapNum

  ' Get the command and arguments from the cache.
  TextSay = Trim(GetVar("Scripts\Command.ini", "TEMP", "Text" & Index))

  ' Split the command into an array. All arguments are seperated by spaces.
  TextSay = Split(TextSay)

  Select Case TextSay(0)
      Case "/testscripts"
        Call TestMain(Index)
        Exit Sub

      Case "/help"
        Call PlayerMsg(Index, "Social Commands:", WHITE)
        Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE)
        Call PlayerMsg(Index, "-msghere = Emote Message", WHITE)
        Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE)
        Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE)
        Exit Sub 

      Case "/calladmins"
        If GetPlayerAccess(Index) = 0 Then
            Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN)
        Else
            Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN)
        End If
        Exit Sub 

      Case "/admin"
        If GetPlayerAccess(Index) > 0 Then
            Call PlayerMsg(Index, "Social Commands:", WHITE)
            Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE)
            Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE)
            Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE)
        End If
        Exit Sub

      Case "/warpmeto"
        If GetPlayerAccess(Index) > 0 Then
            PlayerID = FindPlayer(TextSay(1))

            If PlayerID > 0 Then
              Call PlayerWarp(Index, GetPlayerMap(PlayerID), GetPlayerX(PlayerID), GetPlayerY(PlayerID))
              Call PlayerMsg(Index, "You have been warped to " & GetPlayerName(PlayerID) & ".", BROWN)
            Else
              Call PlayerMsg(Index, "Player is not online.", WHITE)
            End If
        End If
        Exit Sub

      Case "/warptome"
        If GetPlayerAccess(Index) > 0 Then
            PlayerID = FindPlayer(TextSay(1))

            If PlayerID > 0 Then
              Call PlayerWarp(PlayerID, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
              Call PlayerMsg(PlayerID, "You have been warped to " & GetPlayerName(Index) & ".", BROWN)
            Else
              Call PlayerMsg(Index, "Player is not online.", WHITE)
            End If
        End If
        Exit Sub

      Case "/warpto"
        If GetPlayerAccess(Index) > 0 Then
            MapNum = TextSay(1)

            If MapNum > 0 And MapNum <= MAX_MAPS Then
              Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index))
              Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", BRIGHTBLUE)
            Else
              Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED)
            End If
        End If
        Exit Sub
  End Select

  Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)
End Sub

Case "/jail"
            If GetPlayerAccess(Index) > 0 Then
              PlayerID = FindPlayer(TextSay(1))

              If PlayerID > 0 Then
                  Call PlayerWarp(PlayerID, 50, 15, 17)
                  Call PlayerMsg(PlayerID, "Administrator " & GetPlayerName(index) & " has jailed you, If you feel you have been wrongly jailed please you the command /calladmins or /appeal for the owners, when they are online.", BRIGHTGREEN)
                  Call PlayerMsg(Index, "You have jailed " & GetPlayerName(PlayerID) & ".", WHITE)
              Else
                  Call PlayerMsg(Index, "Player is not online", BRIGHTRED)

              End If
            End If             
            Exit Sub
Link to comment
Share on other sites

You realize you have it OUTSIDE the command sub, right?
Notice you have it pasted AFTER the "End Sub", when it's suppose to be before the "End Select" (since it's a Select Case).
Why isn't it with the other "Cases"?

EDIT: Does this problem only happen when you have the Jail command installed?
Link to comment
Share on other sites

```
  Case "/warpto"
        If GetPlayerAccess(Index) > 0 Then
            MapNum = TextSay(1)

            If MapNum > 0 And MapNum <= MAX_MAPS Then
              Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index))
              Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", BRIGHTBLUE)
            Else
              Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED)
            End If
        End If
        Exit Sub

Case "/jail"
            If GetPlayerAccess(Index) > 0 Then
              PlayerID = FindPlayer(TextSay(1))

              If PlayerID > 0 Then
                  Call PlayerWarp(PlayerID, 50, 15, 17)
                  Call PlayerMsg(PlayerID, "Administrator " & GetPlayerName(index) & " has jailed you, If you feel you have been wrongly jailed please you the command /calladmins or /appeal for the owners, when they are online.", BRIGHTGREEN)
                  Call PlayerMsg(Index, "You have jailed " & GetPlayerName(PlayerID) & ".", WHITE)
              Else
                  Call PlayerMsg(Index, "Player is not online", BRIGHTRED)

              End If
            End If             
            Exit Sub

  End Select

    Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)
End Sub
```
Link to comment
Share on other sites

At the very last line of your main.txt, you have this:
```
End Sub If GetPlayerHP(n) > 0 And GetPlayerMap(Index) = GetPlayerMap(n) And GetPlayerLevel(Index) >= 10 And GetPlayerLevel(n) >= 10 And (Map(GetPlayerMap(Index)).Moral = MAP_MORAL_NONE Or Map(GetPlayerMap(Index)).Moral = MAP_MORAL_NO_PENALTY) And GetPlayerAccess(Index) <= 0 And GetPlayerAccess(n) <= 0 Then

```instead of
```
Exit Sub
```Why?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...