• What do you need help with? V3
    6,419 replies, posted
The problems have been fixed. Thanks to all who helped.
[QUOTE=Darkwater124;38676235]Don't call a variable 'Player'[/QUOTE] For the ones who rated me disagree: Player is already a function. [code]lua_run MsgN(Player) > MsgN(Player)... function: 0x19954230[/code] [editline]2nd December 2012[/editline] Just use ply.
[QUOTE=Jova;38677453]I've got a few questions. First off, I will be straight-forward. These are the errors I am having, and these are the codes affiliated with these errors. I could use some assistance in fixing them, but I would appreciate if someone fixed it for me and resupplied the code. [U][B]First errors,[/B][/U] [ERROR] addons/quick mod latest beta/lua/qmod/cl/qmod_web.lua:110: bad argument #2 to 'Exists' (string expected, got no value) 1. Exists - [C]:-1 2. unknown - addons/quick mod latest beta/lua/qmod/cl/qmod_web.lua:110 3. unknown - lua/includes/modules/concommand.lua:69 [B]Code affiliated with previous errors ^[/B] [url]http://pastebin.com/UvcSHDRc[/url] [B][U]Second errors,[/U][/B] [ERROR] addons/quick mod latest beta/lua/qmod/cl/qmod_chat.lua:127: attempt to call global 'ValidEntity' (a nil value) 1. v - addons/quick mod latest beta/lua/qmod/cl/qmod_chat.lua:127 2. unknown - lua/includes/modules/hook.lua:75 [ERROR] addons/quick mod latest beta/lua/qmod/cl/qmod_chat.lua:33: attempt to call global 'ValidEntity' (a nil value) 1. SendText - addons/quick mod latest beta/lua/qmod/cl/qmod_chat.lua:33 2. v - addons/quick mod latest beta/lua/qmod/cl/qmod_chat.lua:139 3. unknown - lua/includes/modules/hook.lua:75 [B]Code affiliated with previous errors ^[/B] [url]http://pastebin.com/jY4eMBnK[/url] Much thanks in advance.[/QUOTE] You could've just looked on the wiki... [url]http://wiki.garrysmod.com/page/Libraries/file/Exists[/url] ValidEntity -> IsValid
The problems have been fixed, thanks to some. Thanks to all who helped.
Anyone know how to fix the Module libary error when using the latest tmysql4 and libmysql?
Quick question I'm a learner and I've gone through the gamemode scripting tutorials. Now I'd love to see if this works at all, but I can't figure out how to run the gamemode in Garry's Mod. I haven't played Garry's Mod in a few years so I'm new to the interface and all.
[QUOTE=Grondo4;38670866]How can I send a message between the server and an entity?[/QUOTE] The entity exists on the server so you don't have to send any messages. You'll have to be clearer.
[QUOTE=Fisker;38679676]Quick question I'm a learner and I've gone through the gamemode scripting tutorials. Now I'd love to see if this works at all, but I can't figure out how to run the gamemode in Garry's Mod. I haven't played Garry's Mod in a few years so I'm new to the interface and all.[/QUOTE] [url]http://screencloud.net/v/qPHJ[/url] the bottom right of the main menu
Oh, I feel silly. Thank you :)
in other semi-related news; [img]http://screencloud.net/img/screenshots/924fec6d560c874953e47fda837d2212.png[/img] why does my gamemode show as Sandbox? hope.txt - "Gamemode" { "base" "base" "title" "hope" "maps" "^bhop_" "menusystem" "1" "workshopid" "" } happens on linux and windows dedi servers this cannot be a lua error can it?
How do you make it so that when people spawn they are forced to become a certain player model? I tried PlayerSetModel and PlayerSpawn hooks but neither worked.
[QUOTE=Kwaq;38680769]in other semi-related news; [img]http://screencloud.net/img/screenshots/924fec6d560c874953e47fda837d2212.png[/img] why does my gamemode show as Sandbox? hope.txt - "Gamemode" { "base" "base" "title" "hope" "maps" "^bhop_" "menusystem" "1" "workshopid" "" } happens on linux and windows dedi servers this cannot be a lua error can it?[/QUOTE] Did you start your server in sandbox then change it? It caches the game description.
Did you set GM.Name?
[QUOTE=Drakehawke;38681469]Did you set GM.Name?[/QUOTE] [shared.lua] -- Info ------------------------------------------------------------------------------- GM.Name = "hope" GM.Author = "msiao" GM.Email = "nothing" GM.Website = "owo.im" [QUOTE=BlackAwps;38681137]Did you start your server in sandbox then change it? It caches the game description.[/QUOTE] srcds.exe -console -game garrysmod +map bhop_monster_jam -gamemode hope -tickrate 100 +maxplayers 99 is it staying on sandbox a bad thing now?
[QUOTE=Kwaq;38682041][shared.lua] -- Info ------------------------------------------------------------------------------- GM.Name = "hope" GM.Author = "msiao" GM.Email = "nothing" GM.Website = "owo.im" srcds.exe -console -game garrysmod +map bhop_monster_jam -gamemode hope -tickrate 100 +maxplayers 99 is it staying on sandbox a bad thing now?[/QUOTE] SRCDs does this to all the gamemodes I tried that were custom. It's SRCDs, not you. When I added my fixed version of an old script, it worked ingame but the name said sandbox.
[t]http://screencloud.net/img/screenshots/be2f81c7f870d95d9b3c3d86fbc9c9ad.png[/t] may be related, i just noticed that launching srcds and not changing the map to something else loads a kind of psuedo sandbox - my gamemode thing... changing the map fixes it but what the hell
How do I make a multi-line string single-line? I mean, if i have a txt file that has multiple lines in it, then use file.Read to store the txt file contents to a stringvalue and then print the string to the output the output will be: [CODE]line1 line2 line3 line4 line5[/CODE] How do i make the string like [CODE]line1line2line3line4line5[/CODE]
[lua] str = str:gsub("[\n\r]", "") [/lua]
How can I check if a vector is inside box created with 2 vectors? Almost like ents.FindInBox, but instead of entity it uses vector. But there is a twist, the 2 vectors are always opposite corners such as top-left-back and bottom-right-front, but they might sometimes be top-right-back and bottom-left-front or any other combination but they still remain opposite. That was a weird explanation, I hope someone can help me. :v:
[QUOTE=ollie;38688596]How can I check if a vector is inside box created with 2 vectors? Almost like ents.FindInBox, but instead of entity it uses vector. But there is a twist, the 2 vectors are always opposite corners such as top-left-back and bottom-right-front, but they might sometimes be top-right-back and bottom-left-front or any other combination but they still remain opposite. That was a weird explanation, I hope someone can help me. :v:[/QUOTE] Check if point.x > math.min(vec1.x, vec2.x) and point.x < math.max(vec1.x, vec2.x) Same for y and z
[QUOTE=Darkwater124;38688844]Check if point.x > math.min(vec1.x, vec2.x) and point.x < math.max(vec1.x, vec2.x) Same for y and z[/QUOTE] Or just use this [URL="http://wiki.garrysmod.com/page/Classes/Vector/WithinAABox"]function[/URL].
Thanks, didn't know that such function existed!
How do I get textures created by meshes to not stretch out? [img]http://cloud-2.steampowered.com/ugc/1101391729646000566/72787F9B134F1EDA3E63F65B25732D2A38DDFBDE/[/img]
Change the texture coordinates of the vertices.
[img]https://dl.dropbox.com/u/10518681/Screenshots/2012-12-03_23-04-27.jpg[/img] How can I alter the skew/perspective on the image drawn at the bottom, such that it appears to lie flat on the ground? Currently drawing the circles as a texture with draw.TexturedQuad, but I can probably make them with the drawcircle function. I just need to know how to make it look like it lies flat on the ground Thanks for any help
If I make a shared table of map entities in InitPostEntity, most of the entities return null clientside. This isn't a very good example as my table is a lot larger and the entities seem to go null randomly. [LUA] // Shared hook.Add("InitPostEntity", "test", function() TABLETEST = { Entity(803), Entity(802), Entity(800), }; end) [/LUA] [IMG]http://i.imgur.com/E6cai.png[/IMG]
[QUOTE=Trumple;38693449]How can I alter the skew/perspective on the image drawn at the bottom, such that it appears to lie flat on the ground? Currently drawing the circles as a texture with draw.TexturedQuad, but I can probably make them with the drawcircle function. I just need to know how to make it look like it lies flat on the ground Thanks for any help[/QUOTE] You could draw it in a 3D2D camera and change the angles around a bit.
[QUOTE=A Lost Sandwich;38693806]If I make a shared table of map entities in InitPostEntity, most of the entities return null clientside. This isn't a very good example as my table is a lot larger and the entities seem to go null randomly. [LUA] // Shared hook.Add("InitPostEntity", "test", function() TABLETEST = { Entity(803), Entity(802), Entity(800), }; end) [/LUA] [IMG]http://i.imgur.com/E6cai.png[/IMG][/QUOTE] Entities don't always exist clientside (only when the player is inside that visleaf)
[QUOTE=`impulse;38693809]You could draw it in a 3D2D camera and change the angles around a bit.[/QUOTE] Thanks for the info. I looked it up a little, however I couldn't get anything to show up.... [lua] cam.Start3D2D( Vector(0, 0, 0), Angle(0, 0, 0), 1 ) draw.SimpleText( "Hello!", "SBTextHead", 0, 0, Color(0,0,0), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT) cam.End3D2D() [/lua] That didn't show up anywhere, am I doing something wrong? Cheers [editline]4th December 2012[/editline] Called in a HUDPaint hook, and the hook is working correctly
It's not solid for some reason. What am I missing? [lua] function ENT:Initialize() if self.UseModel2 then self:SetModel("models/props_combine/combine_fence01b.mdl") else self:SetModel("models/props_combine/combine_fence01a.mdl") end self:PhysicsInit(SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) // Wake the physics object up. It's time to have fun! self:GetPhysicsObject():EnableMotion( false ); local phys = self:GetPhysicsObject() if (phys:IsValid()) then phys:SetMass(300) phys:EnableGravity( false ) phys:Wake() end end [/lua]
Sorry, you need to Log In to post a reply to this thread.