View Single Post
  #2  
Old 11-01-2005, 07:17 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
findplayer(account) is the GS2 version of getplayer(account).

It only works on the serverside, because it does all actions to the player you specify.
For example..
findplayer("Yen").hearts = 0;
This would set my hearts to 0.

If you want to find an NPC or player by coordinates, you can use testplayer(x,y) or testnpc(x,y). This returns the ID of the player/NPC on those coordinates. You can then access that player/NPC by npcs[#] or players[#].

For example, if testnpc(30,30) returned 3, you could do npcs[3].chat = "Hi.";
This would set the chat of the NPC at 30,30's chat to 'Hi.'
Reply With Quote