• Few Codes not working.
    4 replies, posted
All these codes are in garrysmod/gamemodes/terrortown/gamemode and worked on the old server. (This is Garry's TTT not BKU's.) Init.lua [lua] include("steamiddisplay") include("killinformation") [/lua] Steamiddisplay [lua] function diplayID( ply ) PrintMessage(HUD_PRINTTALK, ply:GetName().." has left the server. Their SteamID is "..ply:SteamID()) end hook.Add( "PlayerDisconnected", "playerdisconnected", displayID ) [/lua] killinformation [lua] function informTheVictims(victim,inflictor,killer) if killer:IsRole(ROLE_INNOCENT) then victim:PrintMessage(HUD_PRINTTALK, ..killer:Nick().." killed you! He was an innocent!\n") elseif killer:IsRole(ROLE_TRAITOR) then victim:PrintMessage(HUD_PRINTTALK, ..killer:Nick().." killed you! He was a traitor!\n") else victim:PrintMessage(HUD_PRINTTALK, ..killer:Nick().." killed you! He was a detective!\n") end end hook.Add("PlayerDeath","informTheVictims",informTheVictims) [/lua]
I don't know exactly but to get a player's name I would use ply:Nick() instead of GetName(). Don't know how to fix your other problems though.
That include stuff needs to have the file extension in it. And it doesn't matter what you use Brendan, ply:Nick(), ply:GetName(), and ply:Name() are all valid functions.
Yah I knew Drew, I just figured that out and went "DERP"... Good thing it wasn't me that actually put it in. But I fixed it and Imma make fun of the person who did it.. Testing it soon. Thanks anyways guys :P
:P
Sorry, you need to Log In to post a reply to this thread.