Edit: Err after Falco's comment I simplified this a bit. LOL
Code: Select all
| Find a players pet providing the players ID or Name
|
| To Find a Pet ID by a Players ID : /call FindPCPetByID PlayerID#
|
| To Find a Pet ID by a Players Name : /call FindPCPetByName PlayerName
|
| If the result is equal to 0 then there was no pet for that player found.
| If you get a non zero number returned then you can simply /target id $return or whatever to target the pet.
|
Sub Main
|Example: Checking for Player: Playername's pet with a radius of 5000 for the search limit.
/call FindPCPetByName PlayerName
/if n $return!=0 {
/echo Pets ID is: $return
/echo Pets Name is: $spawn($return,name)
} else {
/echo Pet Not Found!
}
/return
Sub FindPCPetByID(PlayerID)
/return $spawn(@PlayerID,pet)
Sub FindPCPetByName(PlayerName)
/return $spawn($searchspawn("@PlayerName",pc),pet)

