GetPlayerPropertyValue: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server & Client|1.0}} {{FuncDescription|Gets a property value for this entity.}} {{FuncSyntax|GetPlayerPropertyValue(player, PropertyName)}} {{FuncParameter..." |
No edit summary |
||
Line 28: | Line 28: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
*[[SetPlayerPropertyValue]] |
Latest revision as of 18:36, 30 August 2020
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)