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

[EO 2.0/3.0]Login Reward System


PVJsquad
 Share

Recommended Posts

**INTRO**

I played very long in this game. I did not get anything?

this is where I create a system that makes your playing time more precious meaning.

it just requires a bit of script code, making it easy to do.

**what i change or adding?**

**CLIENT**

• frmMenu

• modEnumerations

• modGameLogic

• modGlobals

**SERVER**

• frmServer

• modEnumurations

• modHandleData

**Difficulty** : So Easy

**CODING & WORKING**

let's start in client

**CLIENT**side

Open **frmMenu** add new Label

• (Name) : **lblTime**

• Caption : **00:00:00**

Like This

![](http://www.freemmorpgmaker.com/files/imagehost/pics/52c98b883f788a8c30a2ca3fd7f57822.PNG)

Open **modEnumurations** find

```

' Make sure CMSG_COUNT is below everything else

```
add this code above it

```
CGiftTime
```

Open **modGameLogic** find **GameLoop**

add of the top

```
dim tmr1000 as long
```
find

```
If tmr10000 < Tick Then
```
above it add

```

If Tick > tmr1000 Then

' Update the Client Online Time

ClientSeconds = ClientSeconds + 1

If ClientSeconds > 59 Then

ClientMinutes = ClientMinutes + 1

ClientSeconds = 0

If ClientMinutes > 59 Then

ClientMinutes = 0

ClientHours = ClientHours + 1

End If

End If

frmMenu.lblTime.Caption = Trim(KeepTwoDigit(str(ClientHours))) & ":" & Trim(KeepTwoDigit(str(ClientMinutes))) & ":" & Trim(KeepTwoDigit(str(ClientSeconds)))

tmr1000 = GetTickCount + 1000

' this place for set time you gift Item.

If frmMenu.lblTime.Caption = "00:00:10" Then

'AddText "Anda telah bermain 10 detik.", Yellow

Call SendGiftTime(MyIndex)

End If

End If

```
*Notes : in this code the gift send item in 10 seconds

*Notes : 00:00:01 for 1 second,00:00:10 for 10 seconds,00:01:00 for 1 minute,01:00:00 for 1 hour

Add in the bottom **modGameLogic**

```

Public Function KeepTwoDigit(num As Byte)

If (num < 10) Then

KeepTwoDigit = "0" & num

Else

KeepTwoDigit = num

End If

End Function

Sub SendGiftTime(ByVal Index As Long)

Dim buffer As clsBuffer

Set buffer = New clsBuffer

buffer.WriteLong CGiftTime

SendData buffer.ToArray()

Set buffer = Nothing

End Sub

```

Open **modGlobals** addin the Bottom

```

' Client Online Time

Public ClientSeconds As Byte

Public ClientMinutes As Byte

Public ClientHours As Long

```

**SERVER**side

in **frmServer** add new 2 label,2 scrollbar

Label 1

• (Name) : **lblItem**

• Caption : **Item : None**

Label 2

• (Name) : **lblItemAmount**

• Caption : **Amaount : 0**

Scrollbar 1

• (Name) : **scrlItem**

• Max : **255** *whatever

Scrollbar 1

• (Name) : **scrlItemAmount**

• Max : **255** *whatever

Open **frmServer** Source Code

Add in the bottom

```

Private Sub scrlItem_Change()

If scrlItem.Value > 0 Then

lblItem.Caption = "Item : " & Trim$(Item(scrlItem.Value).Name)

Else

lblItem.Caption = "Item : None"

End If

End Sub

Private Sub scrlItemAmount_Change()

If scrlItemAmount.Value > 0 Then

lblItemAmount.Caption = "Amount : " & scrlItemAmount.Value

Else

lblItemAmount.Caption = "Amount : 0"

End If

End Sub

```

Open **modEnumurations** find

```

' Make sure CMSG_COUNT is below everything else

```
add this code above it

```
CGiftTime
```

Open **modHandleData** in **InitMessages()**

before End If

Add

```
HandleDataSub(CGiftTime) = GetAddress(AddressOf HandleGiftTime)
```
and add this code in the bottom

```
Public Sub HandleGiftTime(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer

If frmServer.scrlItem.Value < 1 Then Exit Sub

GivePlayerItems Index, frmServer.scrlItem.Value, frmServer.scrlItemAmount.Value

PlayerMsg Index, "You Got '" & Trim$(Item(frmServer.scrlItem.Value).Name) & "' value '" & frmServer.scrlItemAmount.Value & "' from login 10 seconds", Yellow

End Sub
```

**WELL DONE**
Link to comment
Share on other sites

Very nice :-) but not really usefull of time

You get every time the same item if youre logged in 10 Seconds -> Login wait 10 seconds log out , login again = Item spamming and every time the same xD

If you add an check which item or how many they got already then that it sending an item every 10 seconds where youre online (Or more) and different items (Stackable on serverside in an list)

Then its Epic -)
Link to comment
Share on other sites

> Very nice :-) but not really usefull of time
>
> You get every time the same item if youre logged in 10 Seconds -> Login wait 10 seconds log out , login again = Item spamming and every time the same xD
>
> If you add an check which item or how many they got already then that it sending an item every 10 seconds where youre online (Or more) and different items (Stackable on serverside in an list)
>
> Then its Epic -)

if only logout and login again will not repeat the time from 0, but continuing the logout time.

but if you close the application window and then start it again would be back in time to reset.

I do not recommend using the 10 seconds, you can change it to be as long as 1 hour, 2 hours, etc.

so if someone else did re open the application will take a long time to get the items given: D
Link to comment
Share on other sites

> GivePlayerItems Sub or Function not defined…. Why???

replace the whole HandleGiftTime sub with:

```

Public Sub HandleGiftTime(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer

If frmServer.scrlItem.Value < 1 Then Exit Sub

If FindOpenInvSlot(index, 1) = 0 Then Exit Sub

GiveInvItem index, frmServer.scrlItem.Value, frmServer.scrlItemAmount.Value

PlayerMsg index, "You Got '" & Trim$(Item(frmServer.scrlItem.Value).Name) & "' value '" & frmServer.scrlItemAmount.Value & "' from login 10 seconds", Yellow

```
Link to comment
Share on other sites

> replace the whole HandleGiftTime sub with:
>
> ```
>
> Public Sub HandleGiftTime(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
>
> Dim Buffer As clsBuffer
>
> If frmServer.scrlItem.Value < 1 Then Exit Sub
>
> If FindOpenInvSlot(index, 1) = 0 Then Exit Sub
>
> GiveInvItem index, frmServer.scrlItem.Value, frmServer.scrlItemAmount.Value
>
> PlayerMsg index, "You Got '" & Trim$(Item(frmServer.scrlItem.Value).Name) & "' value '" & frmServer.scrlItemAmount.Value & "' from login 10 seconds", Yellow
>
> ```

Thank's for it,

Sorry I Use Eclipse Advance so the system for send Item is **GivePlayerItems**
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...