Menu

Playerattached

Brynner

Syntax

  • playerattached ();

Description

Returns the [RID] of the player currently attached to the script. It will
return 0 if none is attached, or if the attached player is no longer on the
map server. It is wise to check for the attached player in script functions
that deal with timers as there is no guarantee the player will still be logged
on when the timer triggers.

Example

[Mes] "Please wait for a bit...";
[Sleep2] 5000;

[If](!playerattached())
{
    [Announce] "It appears, that the winner could not even wait 5 seconds for the prize..",bc_all;
    [End];
}

[Getitem] 512,100;  // Apple
mes "Here you go, enjoy your prize.";
[Close];

[Category:Script_Command]


Related

Wiki: RID

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.