FindPlayer
From Liberty Unleashed Wiki
This function finds a player from an ID or part of the nick and returns the pointer to that player. If no player is found, null will be returned.
Syntax
FindPlayer can take 2 different lists of parameters. These are:
Player FindPlayer( int id )
Player FindPlayer( string name )
Arguments
- id - The ID of the player to be found
- name - The name (or part of it) of the player to be found
function onPlayerCommand( player, cmd, text ) { if ( cmd == "findplr" ) { local plr; if ( ( text ) && ( IsNum( text ) ) ) plr = FindPlayer( text.tointeger() ); else plr = FindPlayer( text.tointeger() ); if ( plr ) MessagePlayer( "Found player: " + plr + "!", player ); else MessagePlayer( "No player found.", player ); } }
This command will try and find the specified player.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
Related Functions
- FindPlayer
- GetClosestPlayer
- Player.Alpha
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.ClearWeapons
- Player.Colour
- Player.ColouredName
- Player.EnterVehicle
- Player.ExitVehicle
- Player.ForceToSpawnScreen
- Player.Frozen
- Player.GetBoundariesLower
- Player.GetBoundariesUpper
- Player.GetIgnored
- Player.Health
- Player.ID
- Player.IP
- Player.Immune
- Player.Island
- Player.LUID
- Player.Marker
- Player.MarkerScale
- Player.MarkerSprite
- Player.Muted
- Player.Name
- Player.Nametag
- Player.NametagColour
- Player.Ping
- Player.Pos
- Player.RemoveFromVehicle
- Player.RemoveLimb
- Player.Score
- Player.SetAnim
- Player.SetBoundaries
- Player.SetIgnored
- Player.SetIgnoredBy
- Player.SetVehicleEnterDoor
- Player.SetWeapon
- Player.Skin
- Player.Spawn
- Player.Spawned
- Player.Team
- Player.Train
- Player.Vehicle
- Player.VehicleSeat
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.SetWeapon
- Player.WeaponAmmo
- Player.WeaponState