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

[Bug Fix] Correction in Time Attack in Resource


Valentine90
 Share

Recommended Posts

**Sorry my english**

When you attack a Resource (eg a tree) is not observed the attack time of the gun, causing the player to attack more than it should.

**Open Server**

**1-** In **modPlayer**, search for:

```
If Map(GetPlayerMap(index)).Tile(x, y).Type = TILE_TYPE_RESOURCE Then
```

**2-** ABOVE add:

```
' Check attack timer

If GetPlayerEquipment(index, Weapon) > 0 Then

If GetTickCount < TempPlayer(index).AttackTimer + Item(GetPlayerEquipment(index, Weapon)).Speed Then Exit Sub

Else

If GetTickCount < TempPlayer(index).AttackTimer + 1000 Then Exit Sub

End If
```

**3 -** After of:

```
' send message if it exists

If Len(Trim$(Resource(Resource_index).EmptyMessage)) > 0 Then

SendActionMsg GetPlayerMap(index), Trim$(Resource(Resource_index).EmptyMessage), BrightRed, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32)

End If

End If
```

**4 -** Add:

```
' Reset attack timer

TempPlayer(index).AttackTimer = GetTickCount
```

**Credits:**

Valentine
Link to comment
Share on other sites

  • 2 years later...

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...