Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Again...
#1
ok so can any one tell me why this is crashing my server?
Code:
If Parse(0) = PH_AttackNPC Then
    npcname = Parse(1)
    
    Call AddText("recieved backet", vbBlack)
    For i = 1 To MAX_NPC
        Call AddText("in for loop", vbBlack)
        If Npc(i).Name = npcname Then
            Call AddText("in if statement", vbBlack)
            Call AttackNPC(Index, i)
            Call AddText("recieved attack request", vbBlack)
        End If
    Next i
End If
Reply
#2
Give us more details (error number / whatever, and so on)
Reply
#3
unfortunately i dont have a error number for you as the only way i can get to that part of the sub is if i compile it, and then, it just crashes the entire program.

and im not sure how to go through debug line by line -_-
Reply
#4
Comment it all out, recreate the issue and see if it still happens.
Reply
#5
ok thanks for the advice, should have thought of that earlier -_- but i figured out whats actually crashing it i think
[code]Sub AttackNPC(ByVal Index As Integer, ByVal NPCnum As Integer)
Dim PlayerDmg As Integer
Dim NPCDmg As Integer
Dim PlayerDef As Integer
Dim NPCDef As Integer
Dim BattleFinished As Boolean
Dim battlecount As Byte
Dim LastSec As Integer

BattleFinished = False
battlecount = 0
LastSec = 0

Call AddText("in attack sub", vbBlack)
Do Until BattleFinished = True
If ServerSecond
Reply
#6
Um. If you think that's the spot, YOU sort through it. Learn from your mistakes.

Personally, I'd comment each of it out first, just to make sure it is in fact the issue.
Reply
#7
Dave Wrote:breakpoint
F8 until it stops working
Then you know what line.

wait how do i do the break point and stuff -_-
Reply
#8
Pbcrazy Wrote:
Dave Wrote:breakpoint
F8 until it stops working
Then you know what line.

wait how do i do the break point and stuff -_-

http://www.google.co.uk/search?hl=en&q=v...arch&meta=
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#9
I click the area next to the code, which makes it highlight the line in red. Makes the code break there, and show you what's going on, IF it reaches that point.
Reply
#10
thanks ill see what i can do
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)