• Print

Author Topic: GetUserGroup()  (Read 4213 times)

0 Members and 1 Guest are viewing this topic.

Offline OpticPotatOS

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
  • GLaDOS
    • Gaming for Everyone
GetUserGroup()
« on: June 12, 2016, 08:56:56 am »
Small question: can you store the return from player:GetUserGroup() in a string? Say like this:

Code: Lua
  1. local player_group = ply:GetUserGroup()
My website isn't my website, rather, it's the gaming network my sever is connected to.

ttt.gfe.nu

Unforeseen Consequences

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: GetUserGroup()
« Reply #1 on: June 12, 2016, 09:00:06 am »
According to the wiki, I'd assume so as it returns a string. I think it would be much easier to use IsUserGroup(), though, depending on what you're trying to do.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline OpticPotatOS

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
  • GLaDOS
    • Gaming for Everyone
Re: GetUserGroup()
« Reply #2 on: June 12, 2016, 09:01:51 am »
Nah, GetUserGroup() is fine. Thanks though!  :)
My website isn't my website, rather, it's the gaming network my sever is connected to.

ttt.gfe.nu

Unforeseen Consequences

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: GetUserGroup()
« Reply #3 on: June 12, 2016, 09:35:15 am »
Just for future reference, variables can store the return values of functions just fine. Variables are meant to store things, after all.
Any function that returns a value (and any function that doesn't return a value) can be on the right side of an assignment operation, and the variable will contain what was returned, always.
bw81@ulysses-forums ~ % whoami
Homepage

  • Print