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

Debbuging plz


adamsharp
 Share

Recommended Posts

hey guys can you debugg these for me?
```
Case "/visitjail"
Call PlayerWarp(Index,10,10,149)
Exit Sub

``````
Case "/roll"
    Dim D1
    D1 = Rand(1,100)
    Call MapMsg(GetPlayerMap(index), & GetPlayerName(index) & " Just Rolled " & D1 & " Out Of 100", BLUE)
Exit Sub

```Thanks AdamSharp
Link to comment
Share on other sites

@IceCream:

> ooh. missed the &
>
> You putting in the correct sub?

im putting it just above /help
```
Case "/visitjail"
Call PlayerWarp(Index,10,10,149)
Exit Sub

Case "/roll"
    Dim D1
    D1 = Rand(1,100)
    Call MapMsg(index, GetPlayerName(index) & " Just Rolled " & D1 & " Out Of 100", BLUE)
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

```
Link to comment
Share on other sites

```
' 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 "/roll"
Dim D1
D1 = Rand(1,100)
Call MapMsg(GetPlayerMap(index), & GetPlayerName(index) & " Just Rolled " & D1 & " Out Of 100", BLUE)
Exit Sub

Case "/visitjail"
Call PlayerWarp(Index,10,10,149)
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

```
Link to comment
Share on other sites

Try this.. put the Dim D1 by the other dim's instead of inside the case.

and change to this

Case "/roll"
Dim D1
D1 = Rand(1,100)
Call MapMsg(index, GetPlayerName(index) & " Just Rolled " & D1 & " Out Of 100", BLUE)
Exit Sub

if still doesn't work.. could be the Rand.. because i'm not entirely sure about random's in SS.
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...