Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

/hug


adamsharp
 Share

Recommended Posts

> Case "/hug"
>     ' Try the parameter first, if there's any.
>     If Len(TextSay(1)) <> 0 Then
>         PlayerID = FindPlayer(TextSay(1))
>
>         If PlayerID <> 0 Then
>             Call GlobalMsg(GetPlayerName(Index) & " hugs " & GetPlayerName(PlayerID), BRIGHTRED)
>
>             Exit Sub
>         End If
>     End If
>
>     ' The using the target, if there's any.
>     If GetPlayerTarget(Index) <> 0 Then
>         Call GlobalMsg(GetPlayerName(Index) & " hugs " & GetPlayerName(GetPlayerTarget(Index)), BRIGHTRED)
>
>         Exit Sub
>     ElseIf GetPlayerTargetNpc(Index) <> 0 Then
>         Call GlobalMsg(GetPlayerName(Index) & " hugs " & GetNpcName(GetPlayerTargetNpc(Index)), BRIGHTRED)
>
>         Exit Sub
>     End If
>
>     Call PlayerMsg(Index, "Can't hug when there's no target selected.", BRIGHTRED)
>     Exit Sub

**Addendum**: added support for NPC's + for /hug .

Regards,
  Godlord.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...