Functions/Player/Shared/getDarkRPVar

From DarkRP
Jump to navigation Jump to search
Function
Function name Player:getDarkRPVar(string var)
Description:
Get the value of a DarkRPVar, which is shared between server and client.
Returns: any value
Part of Library: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=Functions/Player/Shared/getDarkRPVar]Player:getDarkRPVar[/url][/b]

Function parameters[edit]

  1. var (string)
  2. The name of the variable.


Function return values[edit]

  1. value (any)
  2. The value of the DarkRP var.


List of DarkRP Variables (To be put in getDarkRPVar( " " ) )[edit]

  • AFK
  • AFKDemoted
  • money
  • salary
  • rpname
  • job
  • HasGunlicense
  • Arrested
  • wanted
  • wantedReason
  • agenda
  • zombieToggle ( Whether the person toggled to a zombie during the zombie event )
  • zPoints ( Amount of points from the zombie event )
  • hasHit
  • hitTarget
  • hitPrice
  • lastHitTime
  • Energy (This is what hungermod uses for hunger)

Example Code[edit]

___________________________________________________________________________________________

for index, player in ipairs(player.GetAll()) do
   print( player:getDarkRPVar("rpname") , player:getDarkRPVar("job") )
end

___________________________________________________________________________________________

Result: Quang Citizen