GetPlayerPropertyValue

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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