• What do you need help with? V3
    6,419 replies, posted
[QUOTE=>>;39529829]i know :v:[/QUOTE] What's my other half then?
[QUOTE=jaooe;39529964]What's my other half then?[/QUOTE] korean [editline]9th February 2013[/editline] [t]http://i3.kym-cdn.com/entries/icons/original/000/006/227/1309291821012.jpg[/t]
Nope. Back on-topic though, any help as to why my spawn menu isn't working? [editline]9th February 2013[/editline] [QUOTE=coolkid93;39527414]How would I be able to get the last part of ex. model/human/group3/<Modelname>. Wish to set the model by using different groups, so you get the same, male_xx but with another group. Thanks for yer time :D[/QUOTE] What do you mean by group? Like, all the male_x models? or folders?
are you overriding the SpawnMenuOpen or SpawnMenuEnabled hooks for any reason
How do you make ULX ban someone via an addon. I've tried RunConsoleCommand("ulx ban", Sam, 5) RunConsoleCommand("ulx ban", "Sam", "5") RunConsoleCommand("ulx ban", ply:GetName(), "5") RunConsoleCommand("ulx ban", v:Nick(), "5") Can someone help me out here?
[QUOTE=Sam7100;39530966]How do you make ULX ban someone via an addon. I've tried RunConsoleCommand("ulx ban", Sam, 5) RunConsoleCommand("ulx ban", "Sam", "5") RunConsoleCommand("ulx ban", ply:GetName(), "5") RunConsoleCommand("ulx ban", v:Nick(), "5") Can someone help me out here?[/QUOTE] [code]RunConsoleCommand( "ulx", "ban", ply:Nick(), 5 )[/code] Assuming ply is the player object for the player you want to ban, and this is run clientside for a user who has ban permission on ulx, this should work.
How would you go around getting the number of players currently connected on the server?~
[QUOTE=>>;39530396]are you overriding the SpawnMenuOpen or SpawnMenuEnabled hooks for any reason[/QUOTE] Nope. [editline]9th February 2013[/editline] [QUOTE=Mr.Tactical;39531043]How would you go around getting the number of players currently connected on the server?~[/QUOTE] [lua] for k,v in pairs(player.GetAll()) do print(v:Nick()) end [/lua] Will print the nicknames of all players connected to the server.
[lua] for k,v in pairs(player.GetAll()) do print(v:Nick()) end [/lua] I know about that, but I'm wondering of a way to actually get the number of players and use it as an actual integer.
[QUOTE=Mr.Tactical;39531043]How would you go around getting the number of players currently connected on the server?~[/QUOTE] [code]print( #player.GetAll() )[/code]
[QUOTE=thomasfn;39531282][code]print( #player.GetAll() )[/code][/QUOTE] player.GetAll() returns a table of Player objects. prefixing # to a table will give you the number of elements in that table.
[QUOTE=thomasfn;39531282][code]print( #player.GetAll() )[/code][/QUOTE] Thank you!~ [editline]9th February 2013[/editline] [QUOTE=jaooe;39531370]player.GetAll() returns a table of Player objects. prefixing # to a table will give you the number of elements in that table.[/QUOTE] Ah, I didn't know about that~
[QUOTE=Sam7100;39530966]How do you make ULX ban someone via an addon. I've tried RunConsoleCommand("ulx ban", Sam, 5) RunConsoleCommand("ulx ban", "Sam", "5") RunConsoleCommand("ulx ban", ply:GetName(), "5") RunConsoleCommand("ulx ban", v:Nick(), "5") Can someone help me out here?[/QUOTE] It's RunConsoleCommand("ulx","ban")
Is it possible to add physics to a clientside model?
What's the difference between table.Count(tbl) and #tbl?
returning in 5 mins!
[QUOTE=Sam7100;39531999]Hm, still can't find any solution!? Isn't it correct that it should be pretty easy??[/QUOTE] Try posting the full function you're using it in
How would you include an addon file from an entity directory in a gamamode folder?
[QUOTE=jaooe;39530117] What do you mean by group? Like, all the male_x models? or folders?[/QUOTE] Something that gives me for example "Male_01" or Female_03, just that pice of info. Like if I have this model: model/humans/group3/male_05.mdl, I would like a function or something, that tells me what model I have, that being male_05, and only male_0X, not the other crap. Like I have a function, that set a model like this, model/humans/..group.id../*Here I need the model name* so I can change to diffrent groups, and get the correct model I already have, like if I have male 7 with citizen clothing, and I like to change it to group3m I'd like to have the medical resistance model, with the same face.
How would I go about letting players talk and type while a derma menu is open? I have an end of round votemap for TTT but players cannot communicate with each other.
[QUOTE=Kuro Light;39531495]How do you make ULX ban someone via an addon. I've tried RunConsoleCommand("ulx ban", Sam, 5) RunConsoleCommand("ulx ban", "Sam", "5") RunConsoleCommand("ulx ban", ply:GetName(), "5") RunConsoleCommand("ulx ban", v:Nick(), "5") Can someone help me out here? It's RunConsoleCommand("ulx","ban")[/QUOTE] Progress! The addon is now able to load. Still, by using this: RunConsoleCommand("ulx","ban","ply:GetName()","bantime") I can't get it to ban an player. My console returns this: Command "ulx ban", argument #1: No target found or target has imunity. Hm, i guess i can't use ply:GetName() to find the player. It's serverside lua.
Is there an accurate way to get the exact opposite of a color (excluding alpha)? I know there is but I can't write math functions. Can anyone help me out?
[QUOTE=Sam7100;39532334]Progress! The addon is now able to load. Still, by using this: RunConsoleCommand("ulx","ban","ply:GetName()","bantime") I can't get it to ban an player. My console returns this: Command "ulx ban", argument #1: No target found or target has imunity. Hm, i guess i can't use ply:GetName() to find the player. It's serverside lua.[/QUOTE] You don't put the string tags around it.. it's [lua] RunConsoleCommand("ulx","ban",ply:GetName(),tonumber(args[2]) or 0) [/lua] args[2] being the 2nd string entered in chat or etc. (Assuming the first one is used to find the ply)
[QUOTE=Kuro Light;39532790]You don't put the string tags around it.. it's [lua] RunConsoleCommand("ulx","ban",ply:GetName(),tonumber(args[2]) or 0) [/lua] args[2] being the 2nd string entered in chat or etc. (Assuming the first one is used to find the ply)[/QUOTE] I would like to thank you! It's working now, and i have found some great pages i can read more about strings, tags, ply: and so on. Thank you!
[QUOTE=>>;39532373]Is there an accurate way to get the exact opposite of a color (excluding alpha)? I know there is but I can't write math functions. Can anyone help me out?[/QUOTE] I got it anyways [lua]local function ColorOpposite(color,g,b,a) local iscolor = type(color) ~= "number" if iscolor then r = color.r g = color.g b = color.b a = color.a else r = color end -- invert the colors r = (r + (255-r) - r) g = (g + (255-g) - g) b = (b + (255-b) - b) return Color(r,g,b,a) end[/lua]
The surface things are not showing in singleplayer. [CODE] function ProduceSupportFunc() if ( CLIENT ) then surface.SetFont( "ProduceSupport" ) surface.SetTextPos( ScrW() /2 - 190, ScrH() -140 ) surface.SetTextColor( 255, 255, 255 ) surface.DrawText( "Text" ) end end function CafeBene() if ( CLIENT ) then surface.SetTexture( surface.GetTextureID( "ending/cafebene" ) ) surface.SetDrawColor ( 255, 255, 255, 255 ) surface.DrawTexturedRect( ScrW() /2 - 70, ScrH() -166, 256, 85 ) end end timer.Simple( 0.16, function() hook.Add("HUDPaint", "ProduceSupportFunc", ProduceSupportFunc ) end ) timer.Simple( 0.16, function() hook.Add("HUDPaint", "CafeBene", CafeBene ) end ) timer.Simple( 1.36, function() hook.Remove("HUDPaint", "ProduceSupportFunc" ) end ) [/CODE] but it works fine in multiplayer. i think [CODE]if ( CLIENT ) then[/CODE] is not right, but i can't figure out what to replace. How do I do this?! sorry not good at english
I'm having trouble getting an npc health bar addon working. It worked fine before Gmod 13 but like most addons it no longer works. I read that changing the "info.txt" file to "addon.txt" apparently fixes it. But now when I load up a single player game, it returns to the main menu, apparently from lua errors. When I load up the console it says this: [CODE] [ERROR] addons/healthbar/lua/autorun/healthbar.lua:2: bad argument #2 to 'CreateFont' (table expected, got number) 1. CreateFont - [C]:-1 2. unknown - addons/healthbar/lua/autorun/healthbar.lua:2[/CODE] I am completely unfamiliar with lua scripting and I have no idea how to fix this, I checked this thread: [URL]http://www.facepunch.com/showthread.php?t=1220466[/URL] but I wasn't able to get it working. Could anyone help me out?
-snyup- [vid]http://puu.sh/205db[/vid] In this video, the hat is positioned by adding the offset of the hat to the position of the player's eyes. How can i get an accurate offset so that the hat positions itself like a hat is supposed to?
[QUOTE=>>;39533642]I got it anyways [lua]local function ColorOpposite(color,g,b,a) local iscolor = type(color) ~= "number" if iscolor then r = color.r g = color.g b = color.b a = color.a else r = color end -- invert the colors r = (r + (255-r) - r) g = (g + (255-g) - g) b = (b + (255-b) - b) return Color(r,g,b,a) end[/lua][/QUOTE] You don't need to do [lua] r = (r + (255 - r) -r) [/lua] It's just the same as [lua] r = 255 - r [/lua] same with g and b
[lua] local function SpawnEntities() if SERVER then local zombie = ents.Create("npc_zombie") local pistolammo = ents.Create("item_ammo_pistol") local threefiftyammo = ents.Create("item_ammo_357") local spawn = true for k, v in pairs(ents.FindInSphere(Vector(-4155, -809, 130), 600)) do if v:GetClass() == "npc_zombie" then spawn = false end end if spawn == true then zombie:SetPos(Vector(-4155, -809, 130)) zombie:SetAngles(Angle(0, 0, 0)) zombie:Spawn() end end end timer.Create("SpawnEntityTimer", 4, 0, SpawnEntities) [/lua] Trying to get this code to spawn one zombie, and when that zombie dies, another spawns. Any help?
Sorry, you need to Log In to post a reply to this thread.