• SteamID
    9 replies, posted
Right, so I know how to get players names serverside using ply:GetName() But I cant get there name using GetSteamID(), probably because it doesnt exists, any other way of getting steamid serverside? P.S ply:SteamID() isnt working either
[b][url=http://wiki.garrysmod.com/?title=Player.SteamID]Player.SteamID [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] It clearly does work, it've always been doing that for me. Where are you trying to use it?
Sorry, I didnt use () at the end D: DerpityHurpaAHurpaDurp How do I get the name of a weapon? Like is it weapon:GetName() ? weapon: is the weapon entity, yes.
Why don't you go check out the wiki? It's explained somewhere there.
[QUOTE=tazy4tazy;32554129]Sorry, I didnt use () at the end D: DerpityHurpaAHurpaDurp How do I get the name of a weapon? Like is it weapon:GetName() ? weapon: is the weapon entity, yes.[/QUOTE] Do you mean the print name (what you see in weapon selection)? If so, there's a nifty little function, [lua]local t = weapons.Get( class )[/lua] which will return the weapon's default table. For example, it'll have stuff like t.WorldModel, t.PrintName etc. So, you'd use [lua]weapons.Get( weapon:GetClass() ).PrintName[/lua]
[QUOTE=Persious;32554582]Why don't you go check out the wiki? It's explained somewhere there.[/QUOTE]Why don't you help him instead, since it's a questions thread. I don't know if theres any other way, but the way I've done it is by calling [lua]weapons.Get(Classname).PrintName[/lua] Note that this doesn't work on c++ weapons like physgun or any hl2 gun. Edit: Ninjad >:(
Right, im gonna paste some code here [lua] function ******( victim, killer, weapon ) -- victim, weapon, killer print(weapon) end hook.Add( "PlayerDeath", "******", ******* ) [/lua] I starred some code out because its a secwet pwoject. When I use that it prints, player
[QUOTE=tazy4tazy;32555855]Right, im gonna paste some code here [lua] function ******( victim, killer, weapon ) -- victim, weapon, killer print(weapon) end hook.Add( "PlayerDeath", "******", ******* ) [/lua] I starred some code out because its a secwet pwoject. When I use that it prints, player[/QUOTE] Weapon and killer are not always given eg. they can be nil, also I have NEVER EVER seen someone censoring their code, thats just low.
[QUOTE=Wizard of Ass;32558271]Weapon and killer are not always given eg. they can be nil, also I have NEVER EVER seen someone censoring their code, thats just low.[/QUOTE] bu-but I WAN DEM B GIVEN DD:
please stop coding just right there
Sorry, you need to Log In to post a reply to this thread.