Author Topic: Detecting player's existence (clientsided)  (Read 516 times)

How can I detect if my player exists? By which I mean:
not dead
not loading
not spectating
nun of that yall

And I need to detect it as a client.

If is object %clientObject.player

check for serverConnection.getControlOb ject().

function getMyPlayer()
{
    if(!isObject(%cl = ServerConnection)) return -1;
    if(!isObject(%pl = %cl.getControlObject())) return -1;
    return %pl;
}

function doIHaveAPlayer()
{
    return isObject(%pl = getMyPlayer()) && (%pl.getType() & $Typemasks::PlayerObjectType);
}

Duck I'm a dumb ass

Missed the client sided thing, sorry