| Mirage Source http://web.miragesource.net/forums/ |
|
| NpcOnMap Function http://web.miragesource.net/forums/viewtopic.php?f=210&t=4728 |
Page 1 of 1 |
| Author: | William [ Wed Nov 12, 2008 5:08 pm ] |
| Post subject: | NpcOnMap Function |
For example when I change map I send the npc hp because my monsters has hp bars. But I dont want to send the hp bar packet from server to client unless there are npcs on the map. In that case you could add this. Could also be used for other things similar to the one I explained. Code: Function NpcOnMap(ByVal MapNum As Long) As Boolean
Dim i As Byte NpcOnMap = False For i = 1 To MAX_MAP_NPCS If MapNpc(MapNum, i).num > 0 Then NpcOnMap = True Exit Function End If Next i End Function |
|
| Author: | Kraft [ Wed Nov 12, 2008 6:45 pm ] |
| Post subject: | Re: NpcOnMap Function |
You should put an Exit Function after NpcOnMap = True. |
|
| Author: | William [ Wed Nov 12, 2008 6:46 pm ] |
| Post subject: | Re: NpcOnMap Function |
Yeah, I actually put a Exit For below it. But posted this code before I did that. Both things work. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|