OnClientEnter

The script attached to this event fires when a client enters the module. This can be used to perform some initialization of variables for a particular PC or reset encounters.


Trigger

Whenever a player logs into a server or starts the module.


Function(s)

GetEnteringObject() returns the entering PC.


Remarks

All of the items that the PC possesses are re-acquired, causing the module's OnAcquireItem event to fire for each of those items. This means that, if you're using some item restriction script OnAcquireItem, you won't have to put it in OnClientEnter - it is ALL taken care off :)


Known Bugs

GetExitingObject() doesn't return a valid object that you can assign a database value to.


Example

// logs the login name and IP address of the player who just
// joined the server (or started the module)
void main()
{
     object oPC = GetEnteringObject();
     if (GetIsPC(oPC))
     {
          PrintString(GetPCPlayerName(oPC) + " (" +
               GetPCIPAddress(oPC) + ")"
          );
     }
}

See Also

Objects with Events | Module
functions: GetEnteringObject


 Send comments on this topic.