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

Two language, 1 client


LucianL.
 Share

Recommended Posts

I'm trying to make the client have 2 lang, but server send the message for the lang that joined the last one. Can you help me?

client side:

**frmlang**:
```
Private Sub Option1_Click()
lang = 1
Call Main
frmlang.Visible = False
End Sub

Private Sub Option2_Click()
lang = 2
Call Main
frmlang.Visible = False
End Sub

```
**modClientTCP**, on **Public Sub SendLogin**, under **Buffer.WriteLong App.Revision**:
```
Buffer.WriteLong lang
```
**modConstants**:
```
Public Limba As Byte
```

server side:

**modConstants**:
```
Public Const Limba As Byte = 1
Public en As Byte
```
**modHandleData**, on **HandleLogin**:

```
If Buffer.ReadLong = Limba Then
                en = True
Else
                en = False
End If
```
modPlayer, on joingame:  - this one its working becouse server set the languange on every join

```
        If en = True Then
            Call GlobalMsg("English", JoinLeftColor)
        Else
            Call GlobalMsg("y language", JoinLeftColor)
        End If
```
**modCombat**, on **CanPlayerAttackPlayer**: - ok so here if an en client join the game the message will be language 1 for all the other clients, then if a non en client join all the clients get the message with language 2\. any hints ?
```
If Not Map(GetPlayerMap(attacker)).Moral = MAP_MORAL_NONE Then
        If GetPlayerPK(victim) = NO Then
            If en = True Then
                Call PlayerMsg(attacker, "Language 1!", BrightRed)
            Else
                Call PlayerMsg(attacker, "Language 2!", BrightRed)
            End If
```
Update:
The message language 1 and 2 will show when you attack another player in a safe zone.
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...