• What do you need help with? V3
    6,419 replies, posted
you dont need to hide the folder for the gamemode.. everyone knows its perp
-snip- Well do you know about anything?
thats a stupid question honestly but im going to assume you mean do i know anything relevant to your problem in which case yes i do
[QUOTE=andre_bule;37937237]Hey guys I had having problems with ValidEntity Heres the code, I have been playing with this for days but i did not found a solution yet. (FOR GM13) [CODE]function GM.CruiseControlTimer() local t = player.GetAll() for k=1, #t do local v = t[k] if(ValidEntity(v:GetVehicle())) then -- <---THIS IS LINE 75! local car = v:GetVehicle() if(v:GetVehicle().CruiseControl) then local iSpeed = car:GetVelocity():Length() / 17.6 local iMaxSpeed = math.abs(car.CruiseControlSpeed) if(iMaxSpeed > 0) then if(iSpeed >= iMaxSpeed) then car:GetPhysicsObject():SetDamping(math.ceil(iSpeed - iMaxSpeed + 4), 0) else car:GetPhysicsObject():SetDamping(0, 0) end end else car:GetPhysicsObject():SetDamping(0, 0) end else if(v.IsInCruiseControl) then v:ConCommand("-forward") v:ConCommand("-back") v:ConCommand("-jump") v.IsInCruiseControl = false end end end end timer.Create("CruiseControlTimer", 0.075, 0, GM.CruiseControlTimer)[/CODE] Thank you in advance[/QUOTE] Stop trying to edit Perp, copying and pasting won't get you anywhere with GMOD13 or at all. [QUOTE=andre_bule;37950264]Hey did garry changed something with SetVisible and IsVisible? because I am getting an error with this: [gamemodes/somegamemode/gamemode/cl_networking.lua:191] attempt to index field 'InventoryPanel' (a nil value) 1. gamemodes/somegamemode/gamemode/cl_networking.lua:191 (Function) 2. lua/includes/modules/usermessage.lua:87 (unknown)[/QUOTE] Also why are you trying to hide that you are editing perp? You changed perp to somegamemode, lol.
[QUOTE=godlike;37951875]Stop trying to edit Perp, copying and pasting won't get you anywhere with GMOD13 or at all. Also why are you trying to hide that you are editing perp? You changed perp to somegamemode, lol.[/QUOTE] Can I? Well, I suppose we could just sit in this room and glare at each other untill somebody drops dead, but i have a better idea, how about we go back to the topic, and btw, I fixed cruise control, i just want to ask if there is any change with the code that i should know, but lets not make a war here, we are all here to help and be helped, i just want to ask if there is any change in SetVisible or IsVisible. Thank you, lets focus on the topic please [QUOTE=G4MB!T;37950783]thats a stupid question honestly but im going to assume you mean do i know anything relevant to your problem in which case yes i do[/QUOTE] Witch is?
no SetVisible sets if the object is visible or not, IsVisible returns if it is or not. the 2 work together. there has been no change (seriously what would you change?) and also your error doesnt even have anything to do with either method
[QUOTE=G4MB!T;37952403]no SetVisible sets if the object is visible or not, IsVisible returns if it is or not. the 2 work together. there has been no change (seriously what would you change?) and also your error doesnt even have anything to do with either method[/QUOTE] Great Now I am confused has hell. I compared with ttt scoreboard and if i replaced everything it would work BUT it appears the sandbox scoreboard without errors, if i try to fix the "mysterious broken piece" it says that error, so idk *scratches his head* thanks anyway
you posted a perp error and wanted help with a ttt scoreboard which you didnt even supply an error or code for.. good work
MOTD doesn't work![lua] local FrameColor = Color(0, 0, 0, 0) --You can set your own frame color, remember to decrease the alpha value. local ButtonColor = Color(0, 0, 0, 0) --You can set your own button color, remember to decrease the alpha value. function OpenMOTDMenu() local MenuFrame = vgui.Create("DFrame") MenuFrame.OPaint = MenuFrame.Paint MenuFrame:SetSize(ScrW() * 0.95, ScrH() * 0.95) MenuFrame:SetPos((ScrW() - MenuFrame:GetWide()) / 2, (ScrH() - MenuFrame:GetTall()) / 2) MenuFrame:SetTitle("Welcome to " .. GetHostName()) MenuFrame:SetVisible(true) MenuFrame:SetDraggable(true) MenuFrame:ShowCloseButton(true) MenuFrame.Paint = function() MenuFrame.OPaint(MenuFrame) surface.SetDrawColor(Color(60, 60, 60, 255)) surface.DrawLine(1, MenuFrame:GetTall() - 27, MenuFrame:GetWide() - 1, MenuFrame:GetTall() - 27) draw.RoundedBox( 6, 0, 1, MenuFrame:GetWide(), MenuFrame:GetTall() + 1, FrameColor ) end MenuFrame:MakePopup() local CloseButton = vgui.Create("DButton", MenuFrame) CloseButton.OPaint = CloseButton.Paint CloseButton:SetSize(150, 35) CloseButton:SetPos(MenuFrame:GetWide() * 0.75, MenuFrame:GetTall() - 27 - CloseButton:GetTall()/2) CloseButton:SetText("Ok, now let me play!") CloseButton.Paint = function() CloseButton.OPaint(CloseButton) surface.SetDrawColor(ButtonColor) surface.DrawRect(1, 1, CloseButton:GetWide() - 2, CloseButton:GetTall() - 2) end CloseButton.DoClick = function(button) MenuFrame:Close() end local MenuPSheet = vgui.Create("DPropertySheet", MenuFrame) MenuPSheet:SetPos(13, 30) MenuPSheet:SetSize(MenuFrame:GetWide() - 25, MenuFrame:GetTall() - 84) local Rules = vgui.Create( "HTML") Rules:SetPos( 25, 50 ) Rules:SetSize( 250, 250 ) Rules:SetHTML([[<body scroll="yes"> <body background="http://op6.site.nfoservers.com/images/motd/background2.png"> <BODY BGCOLOR="black" TEXT="white"> <pre> <img src="http://xenogamers.org/images/styles/ChitChat/style_blue/logo.png" /> <h1><b>You are playing on the xenoGamers Custom TTT!</b></h1> <b> <h2><b>Rules</b></h2> <h3>Global</h3> 1. No Microphone or Chat spam! - This includes high pitched voices. - This includes HLDJ and voice changers. 2. No NSFW sprays.(No genitailia showing) 3. No exploiting, glitching, or hacking. 4. No serious roleplay in chat. JokeRP is fine. 5. Keep your damn life to yourself. Nobody cares if you are a brony. - If somebody asks you about your life that is fine. Don't go overboard. - If you irritate other users then you are held responsible. 6. Do not start arguments. 7. No harrassing other players. If a person violates rule 5 or 6 report it to an admin. 8. Names are to consist of english letters. 9. No duplicate names. Do not impersonate people or players. 10. Do not block other players, or doors/entrances. This rule applies with multiple doors to a room. <h3>Sniper Wars</h3> 1. Do not spawn camp. 2. Do not shoot from spawn. 3. Do not laser designate spawn. 4. Keep a limit on the stealth snipers. -Only 1/4th of a team can be stealth. -Other snipers are better anyway. 5. Ghosting or Metagaming is not allowed. <h3>Trembling Tiles</h3> 1. Global Rules. <h3>Poltergeist</h3> 1. Do not camp props. 2. Ghosts must do their jobs. 3. Humans, do not try to kill yourself, try to survive. 4. Don't break random props. 5. Do not shoot randomly. <h3>Garryware</h3> 1. Do not team up. <h3>Deathrun</h3> 1. Blocking teammates is against the rules. 2. Pushing teammates is against the rules. 3. Death MUST do his job. No alliances. 4. Secrets to maps should remain as secrets. <h3>Prophunt</h3> 1. Do not camp as prop for too long. 2. Do not constantly switch props. 3. Hunters must hunt. No pet props. 4. Props must be constantly moving with 20 seconds left in the round. -Props must be moving far. Do not remain in the same area. -Props must be moving around the map in the wide open or next to a wall. -Keep in mind it is still hard for hunters to shoot you. 5. Do not exploit prop-grabbing as a Prop. </b> </font> </pre> </body> </html> ]]) local GroupPage = vgui.Create("HTML") GroupPage:SetPos( 25, 50 ) GroupPage:SetSize( 250, 250 ) GroupPage:OpenURL("http://xenogamers.org/forum.php") local Donate = vgui.Create("HTML") Donate:SetParent(MenuPSheet) Donate:SetPos( 25, 50 ) Donate:SetSize( 250, 250 ) Donate:OpenURL("http://xenogamers.org/showthread.php?t=8920&p=86286#post86286") local order = {} order[1] = {"Rules", Rules, "gui/silkicons/page", false, false, "Rules are listed here"} order[2] = {"Group Page", GroupPage, "gui/silkicons/group", false, false, "Group page here"} order[3] = {"Donate", Donate, "gui/silkicons/heart", false, false, "Donations"} for _, tab in pairs(order) do MenuPSheet:AddSheet(unpack(tab)) end end concommand.Add("showmotdmenu", OpenMOTDMenu)[/lua] Just a blank white page. Worked before the update. The URL tabs are also blank.
Just a quick question, is there any way to change a player's models bodygroup or skin? would rather a gmod13 method if there is one.
I'm trying to create a console command so I can rank people using evolve, even if they aren't online. Here's what I'm trying to do: Create a concommand called writerank <player> <rank> This will save this data into a .txt file. Then I will run a check on spawn, and if the STEAM_ID is on the server, get their playername and execute the console command "ev rank <player> <rank>". I tried to do this for a little bit, but I feel I'm just writing buggy crap which wont work.. Any ideas? Example code would be awesome... cheers all.
[QUOTE=andre_bule;37952309]but lets not make a war here, we are all here to help and be helped, i just want to ask if there is any change in SetVisible or IsVisible. Thank you, lets focus on the topic please[/QUOTE] Not trying to, i'm just saying GMOD13 Is a fresh start there is no need to bring cancer with us. You may enjoy the gamemode which is fine, but all i'm saying is try something new, learn to code, make a gamemode etc. Sorry if i'm rubbing of as a hater or an asshole. We don't want to fix you're perp so please take it some where else.
godlike....your name speaks for itself son
I still feel so stupid because I've been trying to get this to work for ages now. This is meant to work on a multiplayer server. I have only tested it in Singleplayer so far, so that might be a problem. What I'm trying to do, is create a script that once a player gets beneath 40 hp, they are significantly slowed down. What it does right now, is slow you down as soon as you take damage, no matter how much you take. Is anyone able to understand, or see why it does that? [code] function slowonhealth(player) if not IsValid(player) or not player:IsPlayer() then return end if player:Health() >= 40 then player:SetWalkSpeed(150) player:SetRunSpeed(250) player:SetMaxSpeed(500) else player:SetWalkSpeed(100) player:SetRunSpeed(150) player:SetMaxSpeed(250) end end hook.Add("EntityTakeDamage","slowthemdownpickthemup",slowonhealth) [/code] PS: This is in Garrysmod 12, and running on a clean Garrysmod.
garrysmod 13 is less than 2 weeks away.. stop posting gmod 12 shit
This code is still valid in GMod 13, cool your jets. Reaper, your code may actually be working, but the run speed you set to when the health is greater than 40 is less than what sandbox sets it to (walk: 250 and run: 500)
Hello, gmod crashes when I call [B]ents.Create("npc_zombie")[/B] (or any other entity). The game quits and I get this message: [IMG]https://dl.dropbox.com/u/4801646/gmod_error.png[/IMG] Any idea? [editline]8th October 2012[/editline] Hmm... I actually get this every time I save my lua file. What is the command to disable this buggy feature?
[QUOTE=G4MB!T;37952910]you posted a perp error and wanted help with a ttt scoreboard which you didnt even supply an error or code for.. good work[/QUOTE] look at this above one of my pervious posts (This is the error we are discussing about): [QUOTE=andre_bule;37945020]player:Nick player:Steamid - I think How can I fix this error: [gamemodes/perp3/gamemode/cl_scoreboards.lua:50] attempt to index upvalue 'pScoreBoard' (a nil value)(Hook: ScoreboardShow) [CODE]include( "scoreboards/scoreboard.lua" ) local pScoreBoard = nil /*--------------------------------------------------------- Name: gamemode:CreateScoreboard( ) Desc: Creates/Recreates the scoreboard ---------------------------------------------------------*/ function GM:CreateScoreboard() if ( pScoreBoard ) then pScoreBoard:Remove() pScoreBoard = nil end pScoreBoard = vgui.Create( "ScoreBoard" ) end /*--------------------------------------------------------- Name: gamemode:ScoreboardShow( ) Desc: Sets the scoreboard to visible ---------------------------------------------------------*/ function GM:ScoreboardShow() GAMEMODE.ShowScoreboard = true gui.EnableScreenClicker( true ) if ( !pScoreBoard ) then self:CreateScoreboard() end pScoreBoard:SetVisible( true ) -- <----- LINE 50 pScoreBoard:UpdateScoreboard( true ) end /*--------------------------------------------------------- Name: gamemode:ScoreboardHide( ) Desc: Hides the scoreboard ---------------------------------------------------------*/ function GM:ScoreboardHide() GAMEMODE.ShowScoreboard = false gui.EnableScreenClicker( false ) if ( pScoreBoard ) then pScoreBoard:SetVisible( false ) end end function GM:HUDDrawScoreBoard() // Do nothing (We're vgui'd up) end [/CODE] Thank you in advance[/QUOTE]
[QUOTE=Charrax;37953266]MOTD doesn't work![lua] local FrameColor = Color(0, 0, 0, 0) --You can set your own frame color, remember to decrease the alpha value. local ButtonColor = Color(0, 0, 0, 0) --You can set your own button color, remember to decrease the alpha value. function OpenMOTDMenu() local MenuFrame = vgui.Create("DFrame") MenuFrame.OPaint = MenuFrame.Paint MenuFrame:SetSize(ScrW() * 0.95, ScrH() * 0.95) MenuFrame:SetPos((ScrW() - MenuFrame:GetWide()) / 2, (ScrH() - MenuFrame:GetTall()) / 2) MenuFrame:SetTitle("Welcome to " .. GetHostName()) MenuFrame:SetVisible(true) MenuFrame:SetDraggable(true) MenuFrame:ShowCloseButton(true) MenuFrame.Paint = function() MenuFrame.OPaint(MenuFrame) surface.SetDrawColor(Color(60, 60, 60, 255)) surface.DrawLine(1, MenuFrame:GetTall() - 27, MenuFrame:GetWide() - 1, MenuFrame:GetTall() - 27) draw.RoundedBox( 6, 0, 1, MenuFrame:GetWide(), MenuFrame:GetTall() + 1, FrameColor ) end MenuFrame:MakePopup() local CloseButton = vgui.Create("DButton", MenuFrame) CloseButton.OPaint = CloseButton.Paint CloseButton:SetSize(150, 35) CloseButton:SetPos(MenuFrame:GetWide() * 0.75, MenuFrame:GetTall() - 27 - CloseButton:GetTall()/2) CloseButton:SetText("Ok, now let me play!") CloseButton.Paint = function() CloseButton.OPaint(CloseButton) surface.SetDrawColor(ButtonColor) surface.DrawRect(1, 1, CloseButton:GetWide() - 2, CloseButton:GetTall() - 2) end CloseButton.DoClick = function(button) MenuFrame:Close() end local MenuPSheet = vgui.Create("DPropertySheet", MenuFrame) MenuPSheet:SetPos(13, 30) MenuPSheet:SetSize(MenuFrame:GetWide() - 25, MenuFrame:GetTall() - 84) local Rules = vgui.Create( "HTML") Rules:SetPos( 25, 50 ) Rules:SetSize( 250, 250 ) Rules:SetHTML([[<body scroll="yes"> <body background="http://op6.site.nfoservers.com/images/motd/background2.png"> <BODY BGCOLOR="black" TEXT="white"> <pre> <img src="http://xenogamers.org/images/styles/ChitChat/style_blue/logo.png" /> <h1><b>You are playing on the xenoGamers Custom TTT!</b></h1> <b> <h2><b>Rules</b></h2> <h3>Global</h3> 1. No Microphone or Chat spam! - This includes high pitched voices. - This includes HLDJ and voice changers. 2. No NSFW sprays.(No genitailia showing) 3. No exploiting, glitching, or hacking. 4. No serious roleplay in chat. JokeRP is fine. 5. Keep your damn life to yourself. Nobody cares if you are a brony. - If somebody asks you about your life that is fine. Don't go overboard. - If you irritate other users then you are held responsible. 6. Do not start arguments. 7. No harrassing other players. If a person violates rule 5 or 6 report it to an admin. 8. Names are to consist of english letters. 9. No duplicate names. Do not impersonate people or players. 10. Do not block other players, or doors/entrances. This rule applies with multiple doors to a room. <h3>Sniper Wars</h3> 1. Do not spawn camp. 2. Do not shoot from spawn. 3. Do not laser designate spawn. 4. Keep a limit on the stealth snipers. -Only 1/4th of a team can be stealth. -Other snipers are better anyway. 5. Ghosting or Metagaming is not allowed. <h3>Trembling Tiles</h3> 1. Global Rules. <h3>Poltergeist</h3> 1. Do not camp props. 2. Ghosts must do their jobs. 3. Humans, do not try to kill yourself, try to survive. 4. Don't break random props. 5. Do not shoot randomly. <h3>Garryware</h3> 1. Do not team up. <h3>Deathrun</h3> 1. Blocking teammates is against the rules. 2. Pushing teammates is against the rules. 3. Death MUST do his job. No alliances. 4. Secrets to maps should remain as secrets. <h3>Prophunt</h3> 1. Do not camp as prop for too long. 2. Do not constantly switch props. 3. Hunters must hunt. No pet props. 4. Props must be constantly moving with 20 seconds left in the round. -Props must be moving far. Do not remain in the same area. -Props must be moving around the map in the wide open or next to a wall. -Keep in mind it is still hard for hunters to shoot you. 5. Do not exploit prop-grabbing as a Prop. </b> </font> </pre> </body> </html> ]]) local GroupPage = vgui.Create("HTML") GroupPage:SetPos( 25, 50 ) GroupPage:SetSize( 250, 250 ) GroupPage:OpenURL("http://xenogamers.org/forum.php") local Donate = vgui.Create("HTML") Donate:SetParent(MenuPSheet) Donate:SetPos( 25, 50 ) Donate:SetSize( 250, 250 ) Donate:OpenURL("http://xenogamers.org/showthread.php?t=8920&p=86286#post86286") local order = {} order[1] = {"Rules", Rules, "gui/silkicons/page", false, false, "Rules are listed here"} order[2] = {"Group Page", GroupPage, "gui/silkicons/group", false, false, "Group page here"} order[3] = {"Donate", Donate, "gui/silkicons/heart", false, false, "Donations"} for _, tab in pairs(order) do MenuPSheet:AddSheet(unpack(tab)) end end concommand.Add("showmotdmenu", OpenMOTDMenu)[/lua] Just a blank white page. Worked before the update. The URL tabs are also blank.[/QUOTE] Any ideas?
If that's for GM12, there isn't really anything you can do, it seems like garry doesn't plan on fixing HTML. You're just going to have to wait until the GM13 release.
[QUOTE=.\\Shadow};37961490]If that's for GM12, there isn't really anything you can do, it seems like garry doesn't plan on fixing HTML. You're just going to have to wait until the GM13 release.[/QUOTE] What a shame. But this code will work in GM13?
[QUOTE=nick_9_8;37956716]I'm trying to create a console command so I can rank people using evolve, even if they aren't online. Here's what I'm trying to do: Create a concommand called writerank <player> <rank> This will save this data into a .txt file. Then I will run a check on spawn, and if the STEAM_ID is on the server, get their playername and execute the console command "ev rank <player> <rank>". I tried to do this for a little bit, but I feel I'm just writing buggy crap which wont work.. Any ideas? Example code would be awesome... cheers all.[/QUOTE] Anyone? I tried for a couple hours last night with no luck :/
i would help but i wont know how to work evolved. if i knew how evolved stored its ranks and the format id write you up a script for it
Why is it that ulx modules don't have access to ttt game mode functions IE ply:setLiveKarma(#). Is it because setLiveKarma is an accessor function? [lua] AccessorFunc(plymeta, "live_karma", "LiveKarma", FORCE_NUMBER) [/lua] Or is it my module? [lua] local CATEGORY_NAME = "TTT" ----------------------- Karma ------------------------ function ulx.karma( calling_ply, target_ply, set_karma) if gmod.GetGamemode().Name ~= "Trouble in Terrorist Town" then ULib.tsayError( calling_ply, "We are not playing TTT.", true ) end if ulx.getExclusive( target_ply, calling_ply ) then ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true ) return end print(target_ply) target_ply:setLiveKarma(set_karma) ulx.fancyLogAdmin( calling_ply, "#A set karma of #T to #i", target_ply ) end local karma = ulx.command( CATEGORY_NAME, "ulx karma", ulx.karma, "!karma" ) karma:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional } karma:addParam{ type=ULib.cmds.NumArg, min=600, default=1000, hint="karma", ULib.cmds.optional, ULib.cmds.round } karma:defaultAccess( ULib.ACCESS_ADMIN ) karma:help( "Sets target karma with given value." ) [/lua] Or wait is it because ulx loads before game mode???
Hello everyone. I don't work with [url=http://wiki.garrysmod.com/page/Classes/IMaterial]IMaterial[/url] that much and I am wondering, is there a way to override a material already being painted within the world? Not the texture, but the entire material. I am trying to work out a way to get the new env_skypaint entity to work in maps that don't have the entity compiled in them, but for this to work I need to override skybox materials, or atleast be able to change some properties on them (like their shader). I have tried doing this with the code below, but can't get IMaterial:SetShader to work for the skybox material, I am thinking it doesn't recognize g_sky as a shader. Don't really pay attention to the skypaint entity part, the problem lies in the Material:SetShader. Any ideas? Lua [lua] if( skypaint ) then skypaint:Remove() skypaint = nil end skypaint = ents.Create( "env_skypaint" ); skypaint:SetKeyValue("topcolor", "0.2 0.5 1.0" ); skypaint:SetKeyValue("bottomcolor", "0.8 1.0 1.0" ); skypaint:SetKeyValue("fadebias", "1.0" ); skypaint:SetKeyValue("sunsize", "2.0" ); skypaint:SetKeyValue("sunnormal", "0.4 0.0 0.01" ); skypaint:SetKeyValue("sunposmethod", "1" ); skypaint:SetKeyValue("suncolor", "0.2 0.1 0.0" ); skypaint:SetKeyValue("duskscale", "1.0" ); skypaint:SetKeyValue("duskintensity", "1.0" ); skypaint:SetKeyValue("duskcolor", "1.0 0.2 0.0" ); skypaint:SetKeyValue("drawstars", "1" ); skypaint:SetKeyValue("startexture", "skybox/starfield" ); skypaint:SetKeyValue("starscale", "0.5" ); skypaint:SetKeyValue("starfade", "1.0" ); skypaint:SetKeyValue("starspeed", "0.01" ); skypaint:SetKeyValue("hdrscale", "0.66" ); print("\nCreated env_skypaint [".. tostring(skypaint) .."]"); local sky = Material( "skybox/sky_day01_09up" ); local new = Material( "skybox/paintedUP" ); print("\nOld Shader: ".. tostring( sky:GetShader() ) .."\nNew Shader: ".. tostring( new:GetShader() )); sky:SetShader( new:GetShader() ); print("\nOld Shader set to ".. tostring( sky:GetShader() )); [/lua] Output [code] Created env_skypaint [Entity [73][env_skypaint]] Old Shader: UnlitGeneric New Shader: g_sky Old Shader set to UnlitGeneric [/code]
I am attempting to make an entity that gives you 900 health faster running and walking, but slowly kills you when you are in water. [lua] function ENT:Use(activator,caller) caller:SetHealth(caller:Health() + 900) caller:SetWalkSpeed(450) caller:SetRunSpeed(700) if caller:WaterLevel() >= 1 then caller:SetHealth(caller:Health() - 50) end caller:EmitSound("vo/SandwichEat09.wav", 100, 100) self.Entity:Remove() end [/lua] Could somebody teach me how to make it so you lose 50 health a second in water, rather than if you use it in water you lose 50 once. I just started using lua and couldnt solve this problem.
[QUOTE=G4MB!T;37962769]i would help but i wont know how to work evolved. if i knew how evolved stored its ranks and the format id write you up a script for it[/QUOTE] It literally wouldn't need to touch evolve - it would just need to save a steamid and rank name next to that Id, and if that steamid joins, execute the console command "ev rank <steamid> <rank>", taking <steamid> <rank> from the text file . Get my drift?
[QUOTE=nick_9_8;37967313]It literally wouldn't need to touch evolve - it would just need to save a steamid and rank name next to that Id, and if that steamid joins, execute the console command "ev rank <steamid> <rank>", taking <steamid> <rank> from the text file . Get my drift?[/QUOTE] [lua] local steamids = {} hook.Add( "Initialize", "Refresh SteamIDs", function() if file.Exists( "ids.txt" ) then steamids = glon.decode( file.Read( "ids.txt" ) ) end end ) hook.Add( "PlayerInitialSpawn", "Check ID", function( ply ) if steamids[ply:SteamID()] then local id = ply:SteamID() RunConsoleCommand( "ev", "rank", id, steamids[id] ) steamids[id] = nil file.Write( "ids.txt", glon.encode(steamids) ) end end ) concommand.Add( "writerank", function( ply, cmd, args ) if not ply:IsSuperAdmin() then return end local id = args[1] local rank = args[2] if not (id and rank) then return end if steamids[id] then steamids[id] = rank ply:PrintMessage( HUD_PRINTTALK, "Changed "..id.."'s rank to "..rank ) else steamids[id] = rank ply:PrintMessage( HUD_PRINTTALK, "Added "..id.." with the rank of "..rank ) end file.Write( "ids.txt", glon.encode(steamids) ) end ) [/lua] ? Edit: Sorry about the error below, assumed you were using it on GM12. Do what Chessnut said :v:
[QUOTE=.\\Shadow};37967872]-code-[/QUOTE] [video=youtube;E-WHW-QNswE]http://www.youtube.com/watch?v=E-WHW-QNswE[/video] Please refer to these accurate lyrics describing you :v:
Shadow, this happened: [QUOTE]Hook 'Refresh SteamIDs' Failed: [@addons/writerank/lua/autorun/writerank.lua:4] bad argument #2 to 'Exists' (string expected, got no value) 1. lua/includes/modules/hook.lua:83 (unknown) 2. (tail call):-1 (unknown) [/QUOTE]
Sorry, you need to Log In to post a reply to this thread.