PVJsquad Posted February 11, 2013 Author Share Posted February 11, 2013 **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**sideOpen **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 hourAdd in the bottom **modGameLogic**```Public Function KeepTwoDigit(num As Byte)If (num < 10) Then KeepTwoDigit = "0" & numElse KeepTwoDigit = numEnd IfEnd FunctionSub SendGiftTime(ByVal Index As Long)Dim buffer As clsBufferSet buffer = New clsBufferbuffer.WriteLong CGiftTimeSendData buffer.ToArray()Set buffer = NothingEnd Sub```Open **modGlobals** addin the Bottom```' Client Online TimePublic ClientSeconds As BytePublic ClientMinutes As BytePublic ClientHours As Long```**SERVER**sidein **frmServer** add new 2 label,2 scrollbarLabel 1• (Name) : **lblItem**• Caption : **Item : None**Label 2• (Name) : **lblItemAmount**• Caption : **Amaount : 0**Scrollbar 1• (Name) : **scrlItem**• Max : **255** *whateverScrollbar 1• (Name) : **scrlItemAmount**• Max : **255** *whateverOpen **frmServer** Source CodeAdd 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 IfEnd SubPrivate Sub scrlItemAmount_Change()If scrlItemAmount.Value > 0 Then lblItemAmount.Caption = "Amount : " & scrlItemAmount.ValueElse lblItemAmount.Caption = "Amount : 0"End IfEnd Sub```Open **modEnumurations** find```' Make sure CMSG_COUNT is below everything else```add this code above it```CGiftTime```Open **modHandleData** in **InitMessages()**before End IfAdd```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 clsBufferIf frmServer.scrlItem.Value < 1 Then Exit SubGivePlayerItems Index, frmServer.scrlItem.Value, frmServer.scrlItemAmount.ValuePlayerMsg Index, "You Got '" & Trim$(Item(frmServer.scrlItem.Value).Name) & "' value '" & frmServer.scrlItemAmount.Value & "' from login 10 seconds", YellowEnd Sub```**WELL DONE** Link to comment Share on other sites More sharing options...
hisherwin Posted February 11, 2013 Share Posted February 11, 2013 you took the idea from day and night system … very nice Link to comment Share on other sites More sharing options...
Wortel Angels Posted February 11, 2013 Share Posted February 11, 2013 Very nice :-) but not really usefull of timeYou 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 xDIf 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 More sharing options...
PVJsquad Posted February 11, 2013 Author Share Posted February 11, 2013 > 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 More sharing options...
Wortel Angels Posted February 11, 2013 Share Posted February 11, 2013 I mean that you just get the same item ever time :-)The other thing is logically no one will use it with 10 seconds xD Link to comment Share on other sites More sharing options...
BugSICK Posted February 11, 2013 Share Posted February 11, 2013 10 sec is just an example, this is nice tutorial its like chips in flyff or ragnarok for exchange of an item. Link to comment Share on other sites More sharing options...
xurana321 Posted February 17, 2013 Share Posted February 17, 2013 GivePlayerItems Sub or Function not defined…. Why??? Link to comment Share on other sites More sharing options...
hedgy Posted February 18, 2013 Share Posted February 18, 2013 > 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 clsBufferIf frmServer.scrlItem.Value < 1 Then Exit SubIf FindOpenInvSlot(index, 1) = 0 Then Exit SubGiveInvItem index, frmServer.scrlItem.Value, frmServer.scrlItemAmount.ValuePlayerMsg 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 More sharing options...
boyesjs03 Posted February 18, 2013 Share Posted February 18, 2013 This is nice. Well done. The timer sub can be used in many ways, its well coded. Thankyou. Link to comment Share on other sites More sharing options...
PVJsquad Posted February 19, 2013 Author Share Posted February 19, 2013 > 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now