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

Directional Blcok


Makendo
 Share

Recommended Posts

```
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
Sub BlockDir(Index)
'warps player back to previous square
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
Dim Xadd
Dim Yadd

Xadd = 0
Yadd = 0

Select Case GetPlayerDir(Index)
  Case 0 ' up
      Yadd = -1     
  Case 1 ' down
      Yadd = 1
  Case 2 ' left
      Xadd = -1
  case 3 ' right
      Xadd = 1
End select

Call PlayerWarp(Index, GetPlayerMap(Index), Int(GetPlayerX(Index) + Xadd), Int(GetPlayerY(Index) + Yadd))

End sub
```
Give it a try, calling it SHOULD send you back a square in the direction you came from.
Backup your main.txt first, not tested it.
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...