GetPlayerPropertyValue

From Onset Developer Wiki
Revision as of 09:30, 11 September 2019 by BlueMountains (talk | contribs) (Created page with "{{Info|Function|Server & Client|1.0}} {{FuncDescription|Gets a property value for this entity.}} {{FuncSyntax|GetPlayerPropertyValue(player, PropertyName)}} {{FuncParameter...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
GetPlayerPropertyValue

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Gets a property value for this entity.

Syntax

GetPlayerPropertyValue(player, PropertyName)

Parameters

  • player
    The player identifier
  • PropertyName
    Name of the property variable

Return Value

  • Returns the value.

Example

Server

function OnPlayerJoin(player)
	SetPlayerPropertyValue(player, "testValue", player + 1, true)
end
AddEvent("OnPlayerJoin", OnPlayerJoin)

Client

AddEvent("OnPlayerStreamIn", function(player)
	AddPlayerChat("P: "..GetPlayerPropertyValue(player, "testValue"))
end)

See also

__EDIT_ME__