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

PVJsquad

Members
  • Posts

    461
  • Joined

  • Last visited

    Never

Posts posted by PVJsquad

  1. I made a new color data in my game that I call CUSTOM COLOR nah script like this

    ```
    Case 18 'custom

    dx8Colour = D3DColorARGB(Alpha, Player(MyIndex).Red, Player(MyIndex).Green, Player(MyIndex).Blue)
    ```
    and its application like this

    ```
    If GetPlayerAccess(Index) < 1 Then

    RenderText Font_Default, Name, TextX, TextY, White, 0

    'draw energy

    RenderText Font_Default, LevelString, Text3X, Text3Y, White, 0

    Else

    RenderText Font_Default, Name, TextX, TextY, Custom, 0

    'draw energy

    RenderText Font_Default, LevelString, Text3X, Text3Y, White, 0

    End If
    ```

    is a problem, when I change my favorite color. then the other player was having the privileges more than 0, also change color to what I want.

    picture

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

    so, changes were made to the player who changed his colors will affect the other, how to solve it?
  2. > 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**
  3. > 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
  4. **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**
  5. ```

    If PetMapCache(Player(Index).Map).UpperBound > 0 Then

    For j = 1 To PetMapCache(Player(Index).Map).UpperBound

    Call NPCCache_Create(Index, Player(Index).Map, PetMapCache(Player(Index).Map).Pet(j))

    Next

    End If

    ```

    Can you tell me what worng in this sub ?

    the script is Out of range

    ```
    If PetMapCache(Player(Index).Map).UpperBound > 0 Then
    ```
    in

    UpperBound = **Location :** Sub JoinGame(ByVal Index As Long)

    **Module :** modPlayer

    the error showing after I adding new char in mygame .

    can you solved this ?

    Sorry Bad English
  6. > thanks but i have this guild system ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/sad.png).. problem is in this system
    >
    > –------------------
    >
    > Error1:
    >
    > Call CheckGuild Error Sub or Function
    >
    > Error 2:
    >
    > TempPlayer Error Sub or Function
    >
    > ------------------------------
    >
    > **CLIENT SIDE**
    >
    > i fix, nice system ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
    >
    > add in modDatabase:
    >
    > ```
    >
    > Public Sub CheckGuilds()
    >
    > Dim I As Long
    >
    > ' If debug mode, handle error then exit out
    >
    > If Options.Debug = 1 Then On Error GoTo ErrorHandler
    >
    > I = 1
    >
    > NumGuilds = 1
    >
    > ReDim Tex_Guild(1)
    >
    > While FileExist(GFX_PATH & "guilds\" & I & GFX_EXT)
    >
    > ReDim Preserve Tex_Guild(NumGuilds)
    >
    > NumTextures = NumTextures + 1
    >
    > ReDim Preserve gTexture(NumTextures)
    >
    > Tex_Guild(NumGuilds).filepath = App.Path & GFX_PATH & "guilds\" & I & GFX_EXT
    >
    > Tex_Guild(NumGuilds).Texture = NumTextures
    >
    > NumGuilds = NumGuilds + 1
    >
    > I = I + 1
    >
    > Wend
    >
    > NumGuilds = NumGuilds - 1
    >
    > If NumGuilds = 0 Then Exit Sub
    >
    > For I = 1 To NumGuilds
    >
    > LoadTexture Tex_Guild(I)
    >
    > Next
    >
    > ' Error handler
    >
    > Exit Sub
    >
    > ErrorHandler:
    >
    > HandleError "CheckGuilds", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
    >
    > Err.Clear
    >
    > Exit Sub
    >
    > End Sub
    >
    > ```
    >
    > Add/Declare in Public Sub DrawPlayer
    >
    > ```
    >
    > Dim X2 As Long, Y2 As Long
    >
    > ```
    >
    > If have problems with TempPlayer, Replace all code with this:
    >
    > ```
    >
    > GuildString = Player(Index).GuildName
    >
    > X2 = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2) - 18
    >
    > Y2 = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4)
    >
    > If Not Player(Index).GuildName = vbNullString Then
    >
    > RenderTexture Tex_Guild(Player(Index).GuildLogo), X2, Y2, 0, 0, 16, 16, 16, 16, D3DColorRGBA(255, 255, 255, 200)
    >
    > End If
    >
    > ```
    >
    > **SERVER SIDE**
    >
    > below this in ModConstant
    >
    > Public Const ITEM_TYPE_SPELL As Byte = 7
    >
    > Add this
    >
    > Public Const ITEM_TYPE_LOGO_GUILD As Byte = 8
    >
    > Good Luck!

    cool thank's for fix this
  7. Thank

    > I am not sure but maybe index might be greater than MAX_GUILDS(If there is one)
    >
    > If so add a check after declaring 'i'. Here is how it should be
    >
    > ```
    >
    > if index < 1 or index > max_guilds then exit sub
    >
    > ```

    Thank you is helped
  8. > I wanted to make today an near same system xD But my guild icons wont be random and the players can add new / Choose
    >
    > Thanks for the tutorial that maybe help me with my system :-)

    Sorry before it steals your ideas ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) . But is not it more tense, when the guild logo icon found at random, if the other player can choose icons they would choose the good and ugly that certainly will not be selected.
×
×
  • Create New...