Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command playerattached:
 
* playerattached();
 
Returns the ID of the player currently attached to the script. It will return
0 if noone is attached, or if the attached player no longer exists on the map
server. It is wise to check for the attached player in script functions that
deal with timers as there's no guarantee the player will still be logged on
when the timer triggers. Note that the ID of a player is actually their
account ID.

Return Values:

- When there is no one attached to the script: 0
- When there is someone attached to the script: the attached person's Account ID

Examples:

> set $@aid,playerattached();
Sets the $@aid variable to the account id of the attached person, or to 0 (when no one attached).
> if (playerattached()) { <code> }
Will execute <code> if there is a player attached

Valid XHTML 1.0 Strict Valid CSS!