| Mirage Source http://miragesource.net/forums/ |
|
| Function problem http://miragesource.net/forums/viewtopic.php?f=201&t=3312 |
Page 1 of 1 |
| Author: | Anthony [ Thu Jan 24, 2008 4:51 pm ] |
| Post subject: | Function problem |
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? |
|
| Author: | Dragoons Master [ Thu Jan 24, 2008 5:23 pm ] |
| Post subject: | Re: Function problem |
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 |
|
| Author: | Anthony [ Thu Jan 24, 2008 5:58 pm ] |
| Post subject: | Re: Function problem |
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? |
|
| Author: | Lea [ Thu Jan 24, 2008 7:43 pm ] |
| Post subject: | Re: Function problem |
There's a way... just can't remember. This is server side, right? Look where the server sends the client the information about the characters after login, it should pretty much be copy and paste from there. |
|
| Author: | Anthony [ Thu Jan 24, 2008 8:17 pm ] |
| Post subject: | Re: Function problem |
Thanks for all the help guys, but I ended up going a different route for what I was trying to do haha. |
|
| Author: | Dragoons Master [ Fri Jan 25, 2008 12:44 am ] |
| Post subject: | Re: Function problem |
Hehehe, good luck. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|