• What do you need help with? V3
    6,419 replies, posted
How would someone draw the model of the LocalPlayer on the hud ?
[QUOTE=havejack;39616320]How would someone draw the model of the LocalPlayer on the hud ?[/QUOTE] [lua] Model = vgui.Create( "SpawnIcon", parent) Model:SetPos( 20, 10 ) Model:SetModel( LocalPlayer():GetModel() ) [/lua]
[QUOTE=theVendetta;39617082][lua] Model = vgui.Create( "SpawnIcon", parent) Model:SetPos( 20, 10 ) Model:SetModel( LocalPlayer():GetModel() ) [/lua][/QUOTE] I Tried to use that, but causes memory leaks in drawhud
How does gameevent.Listen work?
Could someone help me? Getting this error: [CODE][ERROR] LuaCmd:1: ')' expected near 's' 1. unknown - LuaCmd:0 [/CODE] Here is my code: [url]http://pastebin.com/J5MMTDzv[/url]
[QUOTE=theVendetta;39617537]How does gameevent.Listen work?[/QUOTE] Take a look at [url=http://pastebin.com/Nr598C6h]fatekeeper[/url], it's really REALLY simple [editline]17th February 2013[/editline] [QUOTE=Mr Cookieman;39618771]Could someone help me? Getting this error: [CODE][ERROR] LuaCmd:1: ')' expected near 's' 1. unknown - LuaCmd:0 [/CODE] Here is my code: [url]http://pastebin.com/J5MMTDzv[/url][/QUOTE] Stop posting this every 12 hours, it doesn't even look like that code is throwing that error.
How does one make weapons for DarkRP 2.4.3 I have no lua experience.
[QUOTE=Banana Lord.;39619117]Take a look at [url=http://pastebin.com/Nr598C6h]fatekeeper[/url], it's really REALLY simple [editline]17th February 2013[/editline] Stop posting this every 12 hours, it doesn't even look like that code is throwing that error.[/QUOTE] Then at least have the decency/kindness to help me find out WHAT is creating that error, because whenever i remove the entity which uses the code that i posted, it gives me that error. If you require further screenshot or video proof to make you believe me then i will provide it.
[QUOTE=havejack;39617272]I Tried to use that, but causes memory leaks in drawhud[/QUOTE] That's because you've most likely placed that code in drawhud which is called every frame. You're creating a new spawnicon every time drawhud is called, which is unnecessary.
[QUOTE=havejack;39616320]How would someone draw the model of the LocalPlayer on the hud ?[/QUOTE] First you have to make the model outside the HUD so it won't be showed every frame. [LUA] local function ModelView() local iconmodel = vgui.Create("DModelPanel",SulfurHUD) iconmodel:SetModel( LocalPlayer():GetModel()) function iconmodel:LayoutEntity( Entity ) return end iconmodel:SetPos(0,0) iconmodel:SetAnimated(false) iconmodel:SetSize(128,128) iconmodel:SetCamPos( Vector()) ----> Play with the numbers to get the perfect position iconmodel:SetLookAt( Vector()) ----> Play with the numbers to get the perfect lookat angle. iconmodel:ParentToHUD(CoolHUD) end hook.Add( "InitPostEntity", "ModelView", ModelView ) ----> This line mean you don't have to call the function in init.lua [/LUA]
-Snip and facepalm- The function tried removed the map and crashed me .. fixed
[QUOTE=havejack;39617272]I Tried to use that, but causes memory leaks in drawhud[/QUOTE] Never "create" a spawnicon or dmodelpanel or anything intensive in drawhud. Editing(changing model or size) in drawhud seems to work fine for me but definitely don't recreate something this memory intensive over and over again in drawhud.
[QUOTE=joshuadim;39615808]So pretty much i have to make a new folder named content and then put the model in that? P.S.: You helped alot <3[/QUOTE] content/models, content/materials, and content/anything else you want. [editline]17th February 2013[/editline] Is it possible to get the tick time with Lua? Is it possible to get the think time?
[QUOTE=luavirusfree;39620142]content/models, content/materials, and content/anything else you want. [editline]17th February 2013[/editline] Is it possible to get the tick time with Lua? Is it possible to get the think time?[/QUOTE] Hey. The model STILL isn't showing up... Its located in: mygamemode/content/models/characters/Nanosuit2 and in Nanosuit2 I have the .mdl file which is called nanosuit_player.mdl. The lua code for the model is this: "models/characters/Nanosuit2/NanoSuit_player.mdl" Im almost certain I did it right but it's not showing up. I have no idea where I fucked up.
I don't know. That should be working unless there are errors in the model format interfering with the game loading or reading it.
I am in real shit, i need help imediately. I made a loading screen with php and srcds keeps cutting of the fcking ?steamid=%s&mapname=%m so its broken, i really need this fixed ASAP, please, help. If you could even add me on steam to help me fix it. [editline]17th February 2013[/editline] WHY is it doing this! Its a freaking string why the fck would it change it. [editline]17th February 2013[/editline] Well i did a workaround by running this lua: [CODE] function FixShit() game.ConsoleCommand("sv_loadingurl 127.0.0.1/loading/index.php?steamid=%s\n") end hook.Add( "Initialize", "fdfd", FixShit ) [/CODE] But this should get fixed, horrible bug.
[QUOTE=luavirusfree;39620540]I don't know. That should be working unless there are errors in the model format interfering with the game loading or reading it.[/QUOTE] How do I check this (if its possible)?
[QUOTE=joshuadim;39621198]How do I check this (if its possible)?[/QUOTE] That I'm not entirely sure about, but if you can spawn the model in sandbox then it should be working for your gamemode. [editline]17th February 2013[/editline] For that matter, however, you could just leave the models in gmod/gmod/models/ and materials in gmod/gmod/materials/ and when you release, format the zip so that you include models, materials, and gamemodes inside. You might need a readme telling people how to install it, but only include the content that you used, or made in the release.
[QUOTE=Benjiko99;39620924]... srcds keeps cutting of the [B]fcking [/B]... ... why the [B]fck [/B]would it change it ... [/QUOTE] This is the Internet; you can say 'fuck' all you want here. [QUOTE=R@Rdeathmatch;39619892]-Code-[/QUOTE] How would I put that into my HUD? Is there an example you could give?
anyone know why it's seemingly impossible to rotate prop_vehicle_jeep? it doesn't respond to SetAngles() on it or its PhysObj so i don't know what to do
Does anyone know how I would change what the player has entered into the chatbox? It's for an auto-completion thingy where you can press the down and up arrows.
[QUOTE=EvacX;39623437]Does anyone know how I would change what the player has entered into the chatbox? It's for an auto-completion thingy where you can press the down and up arrows.[/QUOTE] I think it would be easiest to create your own chat box, overriding the default one, but making its messages print like regular chat messages. I know that can be done. As for replacing text that's already typed in the regular chat box, I have no idea.
[QUOTE=luavirusfree;39623733]I think it would be easiest to create your own chat box, overriding the default one[/QUOTE] I've been waiting for ages to be able to post this: [img]http://gyazo.com/0ff2122801541b52f8fba385c3a5ea73.png[/img] On the subject of the SpawnIcon in the HUD, how do I call it? As I have it right now, it's just being skipped over completely.
[QUOTE=JVanover;39624317]I've been waiting for ages to be able to post this: [img]http://gyazo.com/0ff2122801541b52f8fba385c3a5ea73.png[/img] On the subject of the SpawnIcon in the HUD, how do I call it? As I have it right now, it's just being skipped over completely.[/QUOTE] You know that's a joke right....? Same with the forum title: L.U.A. Scripting its lua not L.U.A. It's just garry's way of being funny and it is funny because it does in fact, piss people off.
is there anyway i can get an npc to open up _undfinded's pointshop for darkrp use?
-snip-
Could anyone show me how to add a menu entry in the options tab on the q menu? I can't find any tutorials on it.
[QUOTE=JVanover;39624317]I've been waiting for ages to be able to post this: [img]http://gyazo.com/0ff2122801541b52f8fba385c3a5ea73.png[/img] On the subject of the SpawnIcon in the HUD, how do I call it? As I have it right now, it's just being skipped over completely.[/QUOTE] Yeah, so your comment can't be for me, but for that user. I didn't give any tips of modifying the chat box, I said just make a new one to replace it for typing if you want auto correct.
[QUOTE=DoubleElite;39625690]Could anyone show me how to add a menu entry in the options tab on the q menu? I can't find any tutorials on it.[/QUOTE] Look at the source for the spawn menu on luabin. There's probably an easier way than editing the menus source though.
[QUOTE=jaooe;39626013]Look at the source for the spawn menu on luabin. There's probably an easier way than editing the menus source though.[/QUOTE] Alright I'll take a look. I'm having some issues, why isn't the variable "shouldShowHud" being set to true? The HUD isn't being drawn when an entity is hit. [lua] // Enemy HitBox // shouldShowHud = false function DamageTaken( target, dmginfo ) if( target:IsPlayer() == false ) then shouldShowHud = true Msg(shouldDrawHud) Msg( target:GetName(), " Took Damage" ) end end hook.Add("EntityTakeDamage", "HitDetection", DamageTaken) function Hitbox() if( shouldDrawHud ) then // Top line draw.RoundedBox( 0, (ScrW() / 2) - 10, (ScrH() / 2) - 15, 20, 3, Color( 255, 255, 255, 150 ) ) // Bottom line draw.RoundedBox( 0, (ScrW() / 2) - 10, (ScrH() / 2) + 15, 20, 3, Color( 255, 255, 255, 150 ) ) end end hook.Add("HUDPaint", "HUD", Hitbox) [/lua] [B]P.S[/B]: Does anyone have the link to Garrys .gma extractor?
Sorry, you need to Log In to post a reply to this thread.