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

Slide


iHero
 Share

Recommended Posts

**Introduction**

If you slip into a block or a resource the player will not stop.

You do not slide in the direction chosen in the editor.

![](http://img683.imageshack.us/img683/1885/imagemzg.png)

**Server~Side**

> modPlayer

Find by:

```

' Slide

If .Type = TILE_TYPE_SLIDE Then

ForcePlayerMove Index, MOVING_WALKING, GetPlayerDir(Index)

Moved = YES

End If

```

Replace with:

```

' Slide

If .Type = TILE_TYPE_SLIDE Then

Select Case .Data1

Case DIR_UP

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type = TILE_TYPE_BLOCKED Then Exit Sub

Case DIR_LEFT

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub

Case DIR_DOWN

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type = TILE_TYPE_BLOCKED Then Exit Sub

Case DIR_RIGHT

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub

End Select

ForcePlayerMove Index, MOVING_WALKING, .Data1

Moved = YES

End If

```

**Credits**

* iRicardo
* ValentineBr
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...