• What do you need help with? V3
    6,419 replies, posted
Is there any way to draw binary PNG data as a texture?
So I'm making a gamemode that among other things includes cars with passenger slots. I used InitPhysics(SOLID_VPHYSICS) on the player to make the parenting work. After setting the walk type it didn't seem to break anything. The problem I'm having is that crouching somehow breaks the player origin. I tried to reset the player position and disabling duck bind but none of those things helped. Everything seems to work as expected: [URL="http://imageshack.us/scaled/landing/837/gmconstruct0000hj.jpg"][IMG]http://imageshack.us/scaled/thumb/837/gmconstruct0000hj.jpg[/IMG][/URL] But after crouching: [URL="http://imageshack.us/scaled/landing/69/gmconstruct0001cn.jpg"][IMG]http://imageshack.us/scaled/thumb/69/gmconstruct0001cn.jpg[/IMG][/URL]
[QUOTE=JustSoFaded;38055289]Oh, well then on deploy what you want to do is self.Owner:SetModel("zombie/models/path/here"); and then set up the animations properly (Look on the wiki for a full SWEP guide).[/QUOTE] r u c units [editline]17th October 2012[/editline] [QUOTE=Roltzy;38078441]So I'm making a gamemode that among other things includes cars with passenger slots. I used InitPhysics(SOLID_VPHYSICS) on the player to make the parenting work. After setting the walk type it didn't seem to break anything. The problem I'm having is that crouching somehow breaks the player origin. I tried to reset the player position and disabling duck bind but none of those things helped. Everything seems to work as expected: [URL="http://imageshack.us/scaled/landing/837/gmconstruct0000hj.jpg"][IMG]http://imageshack.us/scaled/thumb/837/gmconstruct0000hj.jpg[/IMG][/URL] But after crouching: [URL="http://imageshack.us/scaled/landing/69/gmconstruct0001cn.jpg"][IMG]http://imageshack.us/scaled/thumb/69/gmconstruct0001cn.jpg[/IMG][/URL][/QUOTE] did you include iostream
Can you pass post data in a DHTML panel (GMod 13)?
what do you mean?
[url]http://wiki.garrysmod.com/page/Libraries/http/Post[/url] that but DHTML
How does one include a binary module in gm13?
I'm having trouble with it again.. I know that the module needs to be in lua/bin/, tho now it has to be something like gm(sv/cl)_modulename_(win32/linux/osx) and what the fuck not.
[QUOTE=Persious;38084107]I'm having trouble with it again.. I know that the module needs to be in lua/bin/, tho now it has to be something like gm(sv/cl)_modulename_(win32/linux/osx) and what the fuck not.[/QUOTE] The Answer Is So Fucking Obvious That Im Not Even Going To Help You Figure It Out On Your Own Skid
[QUOTE=Zyler;38073021]Is it possible to make a table of weapons dropped by a specific player when they drop them? I want to make a script where specific weapons are dropped by the player, with no one able to pick them up until I move them (teleport?) to the player so he can pick them up. The weapons would also have to be removed on the death of the player whether they are on the ground or the player (this is to prevent weapon duping). Thanks for your help in advance.[/QUOTE] Just re-posting this because nobody responded before. I still need help with this.
[QUOTE=Zyler;38084713]Just re-posting this because nobody responded before. I still need help with this.[/QUOTE] Do you have any experience with lua? This should kick start you a little bit, I can't really get too in depth right now. [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index3789.html"]GAMEMODE:PlayerCanPickupWeapon()[/URL] Try starting with this, begin the function by checking if the weapon has an owner. If it does have an owner and it is not that player, return false.(This is the whole "prevent players from taking others weapons" thingy you wanted) Now if it doesn't have an owner, set the weapons owner to yourself(WAPON.MyOwner = player). For the death thing just link your script into the player death hook and remove the weapons on hand or loops through all weapons laying around, check to see if the owner is the dead player, then remove them if so. I hope this helps a little, just got off work and my minds a little bubbly (:
[QUOTE=find me;38084809]Do you have any experience with lua? This should kick start you a little bit, I can't really get too in depth right now. [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index3789.html"]GAMEMODE:PlayerCanPickupWeapon()[/URL] Try starting with this, begin the function by checking if the weapon has an owner. If it does have an owner and it is not that player, return false.(This is the whole "prevent players from taking others weapons" thingy you wanted) Now if it doesn't have an owner, set the weapons owner to yourself(WAPON.MyOwner = player). For the death thing just link your script into the player death hook and remove the weapons on hand or loops through all weapons laying around, check to see if the owner is the dead player, then remove them if so. I hope this helps a little, just got off work and my minds a little bubbly (:[/QUOTE] I've done most of this all already, specifically what I'm looking for here is a way to make a table of the weapons that are dropped by a specfic player when they drop them, a table that is attached to those particular weapons so I can make them only able to be picked up by that specific player and only have those specific weapons be removed when they die. Here's what I have done already (before you made your post). [lua]local function PregameSetup() util.AddNetworkString( "ChangeBuildModeCl1" ) util.AddNetworkString( "ChangeBuildModeCl0" ) util.AddNetworkString( "ChangeBuildModeCl3" ) end CurrentBuildMode = 1 PlayerRecentlyRespawned = 0 local function SpawnWithWeapons(ply) if CurrentBuildMode == 1 then ply:GodEnable() elseif CurrentBuildMode == 0 then ply:GodDisable() elseif CurrentBuildMode == 3 then ply:RemoveAllItems() ply:GodDisable() return true end end local function ChangeBuildMode(ply) if CurrentBuildMode == 1 then CurrentBuildMode = 0 net.Start( "ChangeBuildModeCl1", ply ) net.Send(ply) ply:GodDisable() if (ply:GetMoveType() == MOVETYPE_NOCLIP) then ply:SetMoveType(MOVETYPE_WALK) end elseif CurrentBuildMode == 0 then CurrentBuildMode = 1 net.Start( "ChangeBuildModeCl0", ply ) net.Send(ply) ply:GodEnable() for k, v in pairs(ply:GetWeapons()) do if (v:GetClass()!="weapon_physgun") then if (v:GetClass()!="gmod_tool") then if (v:GetClass()!="gmod_camera") then ply:DropWeapon(v) v:Fire("disable") end end end end end end local function WeaponPickups(ply, wep) if CurrentBuildMode == 1 then if PlayerRecentlyRespawned == 1 then timer.Create("fixPlayerRecentlyRespawned", 0.1, 1, function() for k,v in pairs(ply:GetWeapons()) do if (v:GetClass()!="weapon_physgun") then if (v:GetClass()!="gmod_tool") then if (v:GetClass()!="gmod_camera") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 end end end end end ) return true elseif (wep:GetClass()!="weapon_physgun") then if (wep:GetClass()!="gmod_tool") then if (wep:GetClass()!="gmod_camera") then return false end --closes if wep:GetClass is not gmod_tool end --closes wep:GetClass is not gmod camera end elseif CurrentBuildMode == 0 then if PlayerRecentlyRespawned == 1 then timer.Create("fixPlayerRecentlyRespawned", 0.1, 1, function() for k,v in pairs(ply:GetWeapons()) do if (v:GetClass()=="weapon_physgun") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 elseif (v:GetClass()=="gmod_tool") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 elseif (v:GetClass()=="gmod_camera") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 end end end ) elseif (wep:GetClass()=="weapon_physgun") then return false elseif (wep:GetClass()=="gmod_tool") then return false elseif (wep:GetClass()=="gmod_camera") then return false else return true end --closes wep:GetClass is physgun elseif CurrentBuildMode == 3 then return false end --closes if CurrentBuildMode end --closes function local function WeaponPickups2(ply, wep) PlayerRecentlyRespawned = 1 end concommand.Add( "ChangeBuildMode", ChangeBuildMode ) hook.Add("PlayerSpawn","PlayerDropWeapons", WeaponPickups2) hook.Add("PlayerLoadout", "Build Mode Special Weapon Spawns", SpawnWithWeapons) hook.Add("Initialize", "Net String Precaching", PregameSetup) hook.Add("PlayerCanPickupWeapon", "Weapon Pickups Based on Build Mode", WeaponPickups)[/lua] All it does at the moment is check 2 variables: one that checks whether your in a particular build mode that sets what weapons you can carry and one that changes based on whether you have respawned recently. Before I go on, I need a way to make a table or somehow store in a variable the specific weapons that the player drops when they spawn or use the console command to switch build modes. Once I find a way to do that I can make those weapons be removed when the player dies, but also have them only able to be picked up by that specific player when they use the console command again. I just thought I could ask for this without copying the whole code.
[QUOTE=Zyler;38084995]o.o[/QUOTE] [img]http://puu.sh/1g1sa[/img] :suicide: I see people tabbing like this all the time, I don't understand where they learn to tab like this, it's so ugly and completely un proper. You tab to clarify a new scope.
[QUOTE=Zyler;38084995]I've done most of this all already[/QUOTE] [QUOTE=Zyler;38084995]Here's what I have done already (before you made your post). [lua]Flood Mod stuff[/lua] [/QUOTE] Well first of all my good sir that is the code from my flood gamemode, but that tabbing was done by someone else and not me. And I don't think you are getting the concept of what I'm telling you. What I told you to do does exactly what you want. You don't need to create a table on the weapon, you just need to add a variable to the weapon "WEAPON.MyOwner = Player" Then when you first buy the weapon add the owner to the weapon. Therefor if anyone ever tries to pick it up, just check if the owner is == to the player and if not dont let them pick it up. Walla, only owner can pick it up, other players cant. Then all you need to add is to remove all weapons owned by that player when they die.
[QUOTE=find me;38085137]Well first of all my good sir that is the code from my flood gamemode, but that tabbing was done by someone else and not me. And I don't think you are getting the concept of what I'm telling you. What I told you to do does exactly what you want. You don't need to create a table on the weapon, you just need to add a variable to the weapon "WEAPON.MyOwner = Player" Then when you first buy the weapon add the owner to the weapon. Therefor if anyone ever tries to pick it up, just check if the owner is == to the player and if not dont let them pick it up. Walla, only owner can pick it up, other players cant. Then all you need to add is to remove all weapons owned by that player when they die.[/QUOTE] I don't know who you are, but I did all of that code myself regardless of the horrible tabbing (don't worry my friends complain about it all the time). I'll try adding a player owner to the weapon entities, I just didn't think that it was possible to do that with dropped entities. Edit: So I added "print(v:GetOwner())" into the code like this: [lua]for k,v in pairs(ply:GetWeapons()) do if (v:GetClass()!="weapon_physgun") then if (v:GetClass()!="gmod_tool") then if (v:GetClass()!="gmod_camera") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 print(v:GetOwner()) --<---------HERE! end end end end [/lua] Trying to get the owner of a dropped weapon just returns "[NULL Entity]" while getting the owner of the weapon before it's dropped gives the player who dropped it. This would imply that no one owns the entity after it is dropped. How would I be able to find the entities after they've been dropped and also the player who dropped them? Edit2: I think I was able to add dropped weapons into a table. I still need to somehow attach these entities (entrys within the table) to the player who dropped them. Here's what I've got: [lua]CurrentBuildMode = 1 PlayerRecentlyRespawned = 0 PlayerDroppedWeapons = { } local function WeaponPickups(ply, wep) if CurrentBuildMode == 1 then if PlayerRecentlyRespawned == 1 then timer.Create("fixPlayerRecentlyRespawned", 0.1, 1, function() for k,v in pairs(ply:GetWeapons()) do if (v:GetClass()!="weapon_physgun") then if (v:GetClass()!="gmod_tool") then if (v:GetClass()!="gmod_camera") then table.insert( PlayerDroppedWeapons, v ) ply:DropWeapon(v) PlayerRecentlyRespawned = 0 end end end end end ) print( PlayerDroppedWeapons ) return true elseif (wep:GetClass()!="weapon_physgun") then if (wep:GetClass()!="gmod_tool") then if (wep:GetClass()!="gmod_camera") then return false end --closes if wep:GetClass is not gmod_tool end --closes wep:GetClass is not gmod camera end elseif CurrentBuildMode == 0 then if PlayerRecentlyRespawned == 1 then timer.Create("fixPlayerRecentlyRespawned", 0.1, 1, function() for k,v in pairs(ply:GetWeapons()) do if (v:GetClass()=="weapon_physgun") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 elseif (v:GetClass()=="gmod_tool") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 elseif (v:GetClass()=="gmod_camera") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 end end end ) elseif (wep:GetClass()=="weapon_physgun") then return false elseif (wep:GetClass()=="gmod_tool") then return false elseif (wep:GetClass()=="gmod_camera") then return false else return true end --closes wep:GetClass is physgun elseif CurrentBuildMode == 3 then return false end --closes if CurrentBuildMode end --closes function local function WeaponPickups2(ply, wep) PlayerRecentlyRespawned = 1 end hook.Add("PlayerSpawn","PlayerDropWeapons", WeaponPickups2) hook.Add("PlayerCanPickupWeapon", "Weapon Pickups Based on Build Mode", WeaponPickups)[/lua]
[QUOTE=Zyler;38085370]I don't know who you are, but I did all of that code myself regardless of the horrible tabbing (don't worry my friends complain about it all the time). I'll try adding a player owner to the weapon entities, I just didn't think that it was possible to do that with dropped entities. Edit: So I added "print(v:GetOwner())" into the code like this: [lua]for k,v in pairs(ply:GetWeapons()) do if (v:GetClass()!="weapon_physgun") then if (v:GetClass()!="gmod_tool") then if (v:GetClass()!="gmod_camera") then ply:DropWeapon(v) PlayerRecentlyRespawned = 0 print(v:GetOwner()) --<---------HERE! end end end end [/lua] Trying to get the owner of a dropped weapon just returns "[NULL Entity]" while getting the owner of the weapon before it's dropped gives the player who dropped it. This would imply that no one owns the entity after it is dropped. How would I be able to find the entities after they've been dropped and also the player who dropped them?[/QUOTE] Must just be major deja vu and lack of sleep on my end, but that code looks very familiar. And I have a hard time believing you wrote all that if you can't grasp the simple thing I'm trying to tell you. If you didn't write out that code there's no point in lying because you won't get anymore help, you'll just get more complicating answers to your questions when people helping you assume you know what you are doing. OK let's start from scratch, read what I'm about to tell you carefully and maybe you will get it... When a weapon first comes into existence, whether you spawn it to a player, the player buys it, or it is spawned somewhere on the ground, make sure to add a variable to it. [lua] Weapon.MyVariable = 0 --In your case you would want this: Weapon.MyOwner = Player --Weapon being the actual weapon itself and Player being the actual player. [/lua] This weapon will now carry this variable forever until it is set to nil or removed in some other way which doesn't happen unless you intentionally remove it. Now think about it, once you set this weapons "MyOwner" variable, it will always know who the "owner" is. Just use this variable in other functions and scripts that have to deal with the weapon, for example: [lua] function GM:PlayerCanPickupWeapon( pl, weapon ) if weapon.MyOwner == pl then --The weapons "MyOwner" variable matches up with me, the player, so we get to pick it up! return true else pl:Kill() --Kill those dirty pigs trying to take my weapon! end end [/lua] If you still don't know what you are doing you Really need to take a step back and work on a much much smaller project that actually has tutorials before you try to start freelancing this bitch.
[QUOTE=Persious;38084107]I'm having trouble with it again.. I know that the module needs to be in lua/bin/, tho now it has to be something like gm(sv/cl)_modulename_(win32/linux/osx) and what the fuck not.[/QUOTE] It's broken either wait for tonights update or use the SVN
[QUOTE=find me;38085735]Must just be major deja vu and lack of sleep on my end, but that code looks very familiar. And I have a hard time believing you wrote all that if you can't grasp the simple thing I'm trying to tell you. If you didn't write out that code there's no point in lying because you won't get anymore help, you'll just get more complicating answers to your questions when people helping you assume you know what you are doing. OK let's start from scratch, read what I'm about to tell you carefully and maybe you will get it... When a weapon first comes into existence, whether you spawn it to a player, the player buys it, or it is spawned somewhere on the ground, make sure to add a variable to it. [lua] Weapon.MyVariable = 0 --In your case you would want this: Weapon.MyOwner = Player --Weapon being the actual weapon itself and Player being the actual player. [/lua] This weapon will now carry this variable forever until it is set to nil or removed in some other way which doesn't happen unless you intentionally remove it. Now think about it, once you set this weapons "MyOwner" variable, it will always know who the "owner" is. Just use this variable in other functions and scripts that have to deal with the weapon, for example: [lua] function GM:PlayerCanPickupWeapon( pl, weapon ) if weapon.MyOwner == pl then --The weapons "MyOwner" variable matches up with me, the player, so we get to pick it up! return true else pl:Kill() --Kill those dirty pigs trying to take my weapon! end end [/lua] If you still don't know what you are doing you Really need to take a step back and work on a much much smaller project that actually has tutorials before you try to start freelancing this bitch.[/QUOTE] I won't take your recommendation, but I will take your coding help. I also don't need your snide remarks and I don't need your doubting of my own honesty in my coding skill. The way you're saying I didn't code my own script seems very offensive to me. I'm not calling you a douche bag and you don't know me so it's fair enough on your part, but you should know I expect at least a little bit of respect from other people off the bat rather than having them judge me before they even know me. On another, less serious and likely more on-topic note, how would I be able to find all dropped weapons on the map? I've almost got this worked out, but I need a way to find all the dropped weapons so I can do the required checks. Edit: Fixed, just used ent.getall() it's easier that way
Re-posting. Appreciate any help. [QUOTE=101kl;37722851]I am having trouble with the FinishedURL callback. Code: local HtmlFrame = vgui.Create("HTML") HtmlFrame:SetSize(ScrW() - 10, ScrH() - 50) HtmlFrame:Center() HtmlFrame:OpenURL("http://google.com/") HtmlFrame:SetParent( Frame ) function HtmlFrame:FinishedURL(url) print("Loaded: "..url) end Console output: [code] LoadURL: [http://google.com/] [/code] FinishedURL is being called, however its proceeding function is not. Any ideas?[/QUOTE]
e: clocks
[QUOTE=Drakehawke;38085741]It's broken either wait for tonights update or use the SVN[/QUOTE] Oh, I thought it worked in update 39. My bad then. There went hours of raging :)
Can anyone tell me what the replacement for AddValidModel is in GMod 13? nvm, seems like player_manager.AddValidModel works.
[QUOTE=Matt W;38076762]Is there any way to draw binary PNG data as a texture?[/QUOTE]
I figured out how to make it so it shows when a player disconnects from a server, but I was wondering how to make it like the default green text like when a player connects to a server. Right now its printing blue text. [lua] PrintMessage( HUD_PRINTTALK, ply:GetName() .. " has left the server.") [/lua]
[QUOTE=Swiftone;38091804]I figured out how to make it so it shows when a player disconnects from a server, but I was wondering how to make it like the default green text like when a player connects to a server. Right now its printing blue text. [lua] PrintMessage( HUD_PRINTTALK, ply:GetName() .. " has left the server.") [/lua][/QUOTE] You can use chat.AddText clientside, as that supports color arguments.
[QUOTE=Matt W;38092029]You can use chat.AddText clientside, as that supports color arguments.[/QUOTE] thanks a bunch that looks much better!
Does anyone have a working version of the bass module for GMod 13, compiled for the newest headers. Or would somebody be so kind to compile one? If possible. Thank you in advance!
Anyone know the ACT_VM_ thing that makes you hold your weapon close to your body like so? [IMG]http://s13.postimage.org/bhr8vsoc5/111.png[/IMG]
[QUOTE=Kogitsune;38066219]I did this for the fast zombie a while back: [media]http://www.youtube.com/watch?v=Vp-c_tIg4cU[/media] [url=http://www.garrysmod.org/downloads/?a=view&id=102962][img]http://www.garrysmod.org/img/?t=dll&id=102962[/img][/url] Feel free to root around in there to find what you need.[/QUOTE] Oh thanks. But I ran through the code and I can't understands most of the code that has stuff to do with animation because I'm trying to make a classic zombie version of your "Mr. Grundley." Oh and maybe you could just make a classic version so I wouldn't really need to take all that time to learn lua just to make a simple addon.
[img_thumb]http://i.imgur.com/ehwil.jpg[/img_thumb] I've had this problem before but i forget what i did to fix it. some ignorez fuckery or something?
Sorry, you need to Log In to post a reply to this thread.