Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Npc Targeting
#9
Sweet!

Got it working Smile Thanks alot genusis!

heres what I came up with:
Code:
' Check for an npc
  For i = MAX_MAP_NPCS To 1 Step -1
    If MapNpc(GetPlayerMap(index), i).Num > 0 Then
    If MapNpc(GetPlayerMap(index), i).x = x And MapNpc(GetPlayerMap(index), i).y = y Then
      ' Change target
      Player(index).Target = i
      Player(index).TargetType = TARGET_TYPE_NPC
      SendTarget index
      If Mid(Trim(Npc(MapNpc(GetPlayerMap(index), i).Num).Name), 0, 1) = "a" Then
        Call PlayerMsg(index, "Your target is now a " & Trim(Npc(MapNpc(GetPlayerMap(index), i).Num).Name) & ".", Yellow)
      End If
      Exit Sub
    End If
    End If
  Next i

Works great now Smile
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)