Scripting/Client/Functions/FindPlayer
Player handle for any connected player including yourself, or null.
Syntax
FindPlayer(id)Arguments
- int id
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "pos" )
{
local target = FindPlayer( params.tointeger() ); // by id
if ( target ) MessagePlayer( target.Name + " is at " + target.Pos.x + ", " + target.Pos.y, player );
else MessagePlayer( "No such player.", player );
}
}Related pages
Section: Looking up entities
Categories: Client functions | Looking up entities