GetPlayerPropertyValue

From Onset Developer Wiki
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