Ulysses Stuff > Releases

TempAdd (v2.4) - Add a user to another group for a set amount of time

<< < (9/28) > >>

MrPresident:
You are sure that is the right line? Neither one of those should be a string.

os.time() is an integer

and exptime is also an integer.

Bo98:

--- Quote from: Megiddo on March 25, 2013, 01:59:22 PM ---
--- Code: ---ulx luarun Entity(<player's ent number>):SetUserGroup("superadmin")
--- End code ---

:P

--- End quote ---

Hmm, it's not working for me. Does it not work with Entities?


--- Code: ---attempt to call method 'SetUserGroup' (a nil value)
--- End code ---

Megiddo:

--- Quote from: Bo98 on March 27, 2013, 11:42:52 AM ---Hmm, it's not working for me. Does it not work with Entities?


--- Code: ---attempt to call method 'SetUserGroup' (a nil value)
--- End code ---

--- End quote ---

Without going into too many details, a player is-a entity (inheritance relationship). Are you sure you're using the right entity number? They'll always be in the range 1-<max players>.

Bo98:

--- Quote from: Megiddo on March 27, 2013, 12:30:31 PM ---Without going into too many details, a player is-a entity (inheritance relationship). Are you sure you're using the right entity number? They'll always be in the range 1-<max players>.

--- End quote ---

Yeah, I'm aware of the player-entity relationship, just thought for a moment it might've not counted here.

And it doesn't work whatever way I do it:


--- Code: ---Entity(ply:EntIndex()):SetUserGroup("superadmin")
--- End code ---


--- Code: ---print(Entity(1):GetName()) -- prints my nick correctly
Entity(1):SetUserGroup("superadmin") -- error
--- End code ---

Megiddo:
Works for me. Something's wrong in your Lua environment, perhaps?


--- Code: ---lua_run print(Entity(1))
> print(Entity(1))...
Player [1][[ULX]Megiddo]
lua_run Entity(1):SetUserGroup("superadmin")
> Entity(1):SetUserGroup("superadmin")...

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version