Skip to content

GetPlayerThirdPerson

The third-person view the mode gave a player (SetPlayerThirdPerson).

"off" until a mode changed it, with third person kept on in fights and when aiming and the aiming dot on. With "allow", which view the player looks from at the moment is their own choice and the server does not know it.

GetPlayerThirdPerson(pid)
Parameter Type
pid number the player

string, boolean, boolean, boolean - four values mode, inFights, whenAiming, crosshair: "off", "allow" or "force", then false where the player is held in first person (a fight, aiming) and true where third person stays on, then whether the aiming dot shows in third person; a single nil when not connected

local mode, inFights, whenAiming, crosshair = GetPlayerThirdPerson(pid)
if mode ~= "off" and not whenAiming then
SendClientMessage(pid, COLOR_SERVER, "The third-person view gives way to first person while you aim.")
end

SetPlayerThirdPerson · the Players group of the index