Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function problem
#1
For some reason this function is constantly returning 0...

Code:
Function GetPlayerClassSprite(ByVal Index As Long) As Long
Dim Sex As Byte

    Player(Index).Char(Player(Index).CharNum).Sex = Sex
    
    If Sex = 0 Then
        GetPlayerClassSprite = Int(Class(GetPlayerClass(Index)).MSprite)
    Else
        GetPlayerClassSprite = Int(Class(GetPlayerClass(Index)).FSprite)
    End If
End Function

I have tested the GetPlayerClass(Index) elsewhere and it works fine. Also if I replace the GetPlayerClass(Index) with 1 it returns the proper numbers for thats classes sprites. Any ideas?
Reply
#2
Code:
Function GetPlayerClassSprite(ByVal Index As Long) As Long
    If Player(Index).Char(Player(Index).CharNum).Sex = 0 Then
        GetPlayerClassSprite = Int(Class(GetPlayerClass(Index)).MSprite)
    Else
        GetPlayerClassSprite = Int(Class(GetPlayerClass(Index)).FSprite)
    End If
End Function
Thats should be correct Tongue
Reply
#3
I see what you did there but it didn't fix it. Thanks for making me realize my function was retarded though haha.

I guess it wasn't the function but is something else haha. I noticed now that GetPlayerClass will return 0 unless the player is logged in as that character... Duh... So how do I get the class sprite of the character 1 or 2 before I am logged in as that character?
Reply
#4
Thanks for all the help guys, but I ended up going a different route for what I was trying to do haha.
Reply
#5
Hehehe, good luck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)