• What do you need help with? V3
    6,419 replies, posted
[QUOTE=Pon-3;38184362]I have this: [CODE]surface.CreateFont("Trebuchet", 34, 400, false, false, "Trebuchet34" )[/CODE] and Garry's Mod is telling me I need a table instead of a number. How do I fix?[/QUOTE] [b][url=http://wiki.garrysmod.com/page/Libraries/surface/CreateFont]Libraries/surface/CreateFont[img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
[QUOTE=.\\Shadow};38184491][b][url=http://wiki.garrysmod.com/page/Libraries/surface/CreateFont]Libraries/surface/CreateFont[img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b][/QUOTE] Thank you for updating that, but how would those numbers relate to the numbers in my old lua code?
[QUOTE=Pon-3;38184991]Thank you for updating that, but how would those numbers relate to the numbers in my old lua code?[/QUOTE] Any fields can be left out and the default ones will be put in for you.
Anyone know how the button entity makes the player use the key that it's set for? I need it to fix keypad
I decided to start working on my HUD today but can't quite figure out why my images aren't appearing. I have the image in content/materials/hud/test.png The error im getting is [Code]--- Missing Vgui material hud/test.png[/Code] Here is my code: [Lua]include( 'shared.lua' ) include( 'cl_shop.lua') include( 'cl_perks.lua') include( 'cl_chat.lua') local hud = surface.GetTextureID("hud/test.png") function DrawHUD() surface.SetTexture(hud) surface.DrawColor(255,255,255,255) end [/Lua]
[QUOTE=sarge997;38154365]I need help, I'm currently trying to fix MelonRacer for Gmod 13. But when the player spawns its just the normal player entity not the melon entity. Here is the console log when i first start the game. [I][ERROR] gamemodes/melonracer/gamemode/init.lua:7: bad argument #2 to 'Find' (string expected, got no value) 1. Find - [C]:-1 2. unknown - gamemodes/melonracer/gamemode/init.lua:7 Couldn't Load Init Script: 'melonracer/gamemode/init.lua' [ERROR] ...melonracer/entities/entities/trigger_checkpoint/init.lua:19: ')' expected near 'then' 1. unknown - gamemodes/melonracer/entities/entities/trigger_checkpoint/init.lua:0 Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Garry's Mod melonracer mr_eight 1 76561197999127845 clientside lua startup! env_cubemap used on world geometry without rebuilding map. . ignoring: building_template/building_template002l env_cubemap used on world geometry without rebuilding map. . ignoring: building_template/building_template002p Redownloading all lightmaps [/I] I need some help please.[/QUOTE] fix that "find" error. The script is not completing due to it. EDIT: My own issue: Derma is being weird. i fixed it up and all but it's not obeying previous laws. Menus have lost their weight and spawn in random accordance all over eachother, behind eachother, etc etc. Anyone hit an issue like this?
[QUOTE=comet1337;38182817]how would i go about removing a players head from their player model clientside[/QUOTE] BuildBonePositions was removed without implementing the new one first, So we cant right now unless we use Inflator tool code. [QUOTE=Archemyde;38185712]Derma is being weird. i fixed it up and all but it's not obeying previous laws. Menus have lost their weight and spawn in random accordance all over eachother, behind eachother, etc etc. Anyone hit an issue like this?[/QUOTE] I think garry messed with a ton of derma names and functions, Might wanna look that up and see if anythings changed that your using?
[QUOTE=Magenta;38185914]BuildBonePositions was removed without implementing the new one first, So we cant right now unless we use Inflator tool code. I think garry messed with a ton of derma names and functions, Might wanna look that up and see if anythings changed that your using?[/QUOTE] As far as i can see, he only removed one thing, and the things he changed are small and not in need of fixing
[QUOTE=Archemyde;38185965]As far as i can see, he only removed one thing, and the things he changed are small and not in need of fixing[/QUOTE] Hmm, i'm unsure then, Most misplacement means the Parent panel isn't valid.
Can anyone help me, I am curious if there is any way or perhaps someone that could help me get this gamemode to work with gmod 13. [url]http://www.garrysmod.org/downloads/?a=view&id=35199[/url] Its a bit of a fossil I warn, and most will probably wonder why would I want this janky gamemode for gmod 13 anyways? well Its a personal old time favorite and Id like to be able to host it again.
uhm thats just darkrp with zombies
[QUOTE=G4MB!T;38186744]uhm thats just darkrp with zombies[/QUOTE] Actually, its close but the one thing that made it fun for me was the zombie class. The zombie class was different then the typical model of a zombie. When a zombie NPC killed a player, that player would respawn on the spot as a zombie. As a zombie class you cannot turn back into a human unless you have been a zombie for 5 minutes or there are a lot of zombies already. But, you run around and try to kill any other human players. The zombie doesn't run as fast so stealth is key, as a zombie you can kill someone in roughly 2 hits, and that is hard. Once you kill a human player, that human player no matter what class he is respawns on the spot as another zombie, and the terror continues. One way to heal a zombie is have a medic cure him, but there are not many medics. All and all this creates a very on edge scary DarkRP where staying vigilant is always key, CP's sometimes quarantine parts of city with non infected still inside, players request CP escorts. bases are bulkier, players are frantic, its a blast. Sorry for long reply, just had to establish what it all was and such.
[lua] function AddItem_Car(ply, cmd, args) local arg1 = tostring(args[1]) result = sql.Query("SELECT " .. cars[arg1].EntName .. " FROM darkrp_player WHERE uid = " .. ply:UniqueID() .. ";") if not arg1 then return end if not cars[arg1] then return end if not ply:CanAfford(cars[arg1].Price) then GAMEMODE:Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "Car")) return "" end if not result[1] then ply:AddMoney(-cars[arg1].Price) sql.Query("UPDATE darkrp_player SET " .. cars[arg1].EntName .. " = '1' WHERE uid = " .. ply:UniqueID() .. ";") end local car = ents.Create(cars[arg1].EntName) if car:IsValid() then car:SetKeyValue("vehiclescript", cars[arg1].Script) car:SetModel(cars[arg1].Model) car:Own(ply) car:SetPos(cars[arg1].Vector) car:Spawn() car:Activate() end end concommand.Add("buy_car", AddItem_Car) [/lua] No errors but it just spawns the car instead of charging money(line 10) and running the sql query(line 11).
[QUOTE=J.R.;38187522][lua] function AddItem_Car(ply, cmd, args) local arg1 = tostring(args[1]) result = sql.Query("SELECT " .. cars[arg1].EntName .. " FROM darkrp_player WHERE uid = " .. ply:UniqueID() .. ";") if not arg1 then return end if not cars[arg1] then return end if not ply:CanAfford(cars[arg1].Price) then GAMEMODE:Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "Car")) return "" end if not result[1] then ply:AddMoney(-cars[arg1].Price) sql.Query("UPDATE darkrp_player SET " .. cars[arg1].EntName .. " = '1' WHERE uid = " .. ply:UniqueID() .. ";") end local car = ents.Create(cars[arg1].EntName) if car:IsValid() then car:SetKeyValue("vehiclescript", cars[arg1].Script) car:SetModel(cars[arg1].Model) car:Own(ply) car:SetPos(cars[arg1].Vector) car:Spawn() car:Activate() end end concommand.Add("buy_car", AddItem_Car) [/lua] No errors but it just spawns the car instead of charging money(line 10) and running the sql query(line 11).[/QUOTE] sorry mis-rated. uh i have no experience with sql lite (that comes with gmod) but id say try removing the semi colons (;) from the end of your queries
[QUOTE=G4MB!T;38187603]sorry mis-rated. uh i have no experience with sql lite (that comes with gmod) but id say try removing the semi colons (;) from the end of your queries[/QUOTE] That didn't help or hurt.
I need to get keypads to work for a DarkRP server, how can I fix the lua and get it ready for server use?
[QUOTE=J.R.;38187699]That didn't help or hurt.[/QUOTE] well i did that i have no experience with it. have you tried printing result?
[QUOTE=G4MB!T;38188149]well i did that i have no experience with it. have you tried printing result?[/QUOTE] Yeah: [ERROR] attempt to concatenate global 'result' (a table value)
[QUOTE=Gamz365;38185488]question[/QUOTE] Use Material() instead of surface.GetTextureID() when using PNG files.
[QUOTE=J.R.;38188226]Yeah: [ERROR] attempt to concatenate global 'result' (a table value)[/QUOTE] try [lua] function AddItem_Car(ply, cmd, args) local arg1 = tostring(args[1]) result = sql.Query("SELECT " .. cars[arg1].EntName .. " FROM darkrp_player WHERE uid = '" .. ply:UniqueID() .. "'") if not arg1 then return end if not cars[arg1] then return end if not ply:CanAfford(cars[arg1].Price) then GAMEMODE:Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "Car")) return "" end if not result[1] then ply:AddMoney(-cars[arg1].Price) sql.Query("UPDATE darkrp_player SET " .. cars[arg1].EntName .. " = '1' WHERE uid = '" .. ply:UniqueID() .. "'") end local car = ents.Create(cars[arg1].EntName) if car:IsValid() then car:SetKeyValue("vehiclescript", cars[arg1].Script) car:SetModel(cars[arg1].Model) car:Own(ply) car:SetPos(cars[arg1].Vector) car:Spawn() car:Activate() end end concommand.Add("buy_car", AddItem_Car) [/lua]
[QUOTE=G4MB!T;38188254]try [/QUOTE] Still same problem
PrintTable(result)?
[QUOTE=G4MB!T;38188294]PrintTable(result)?[/QUOTE] [code] 1: prop_vehicle_jeep = [/code] ^ that is how it is printed in console
On second thought, can someone help with just making a swep for darkrp. Its kinda like the baton except instead of arresting you, it hurts you and when you die to it your class changes.
i still need to know how to remove a playermodels head
[QUOTE=J.R.;38188330][code] 1: prop_vehicle_jeep = [/code] ^ that is how it is printed in console[/QUOTE] gah.. do you actually know how sql works? you cant update something that doesnt exist. so im assuming that somewhere in your darkrp you have it inserting "prop_vehicle_jeep" into the database. it seems like its half worked, but you will need to truncate your database and start again (it will remove any corrupted data entries) [editline]26th October 2012[/editline] [QUOTE=comet1337;38188529]i still need to know how to remove a playermodels head[/QUOTE] use the inflator tool or decompile the model and remove its head
[QUOTE=G4MB!T;38188560]gah.. do you actually know how sql works? you cant update something that doesnt exist. so im assuming that somewhere in your darkrp you have it inserting "prop_vehicle_jeep" into the database. it seems like its half worked, but you will need to truncate your database and start again (it will remove any corrupted data entries) [/QUOTE] I have prop_vehicle_jeep created, but I don't have a default value for prop_vehicle_jeep (which should be false or 0) i'm not too sure on how to do that, maybe in data.lua in darkrp.
where ever your CREATE darkrp_player query you will (unless someone else made it) have entered something like [code]bool prop_vehicle_jeep[/code] change it to [code]bool prop_vehicle_jeep DEFAULT 0[/code]
[QUOTE=G4MB!T;38188606]where ever your CREATE darkrp_player query you will (unless someone else made it) have entered something like [code]bool prop_vehicle_jeep[/code] change it to [code]bool prop_vehicle_jeep DEFAULT 0[/code][/QUOTE] Got it working, used prop_vehicle_jeep NUMERIC DEFAULT 0 (sqlite doesn't have Boolean apparently) final code: [lua] function AddItem_Car(ply, cmd, args) local arg1 = tostring(args[1]) result = sql.QueryValue("SELECT " .. cars[arg1].EntName .. " FROM darkrp_player WHERE uid = " .. ply:UniqueID()) print(result) if not arg1 then return end if not cars[arg1] then return end if not ply:CanAfford(cars[arg1].Price) then GAMEMODE:Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "Car")) return "" end if result == '0' then ply:AddMoney(-cars[arg1].Price) sql.Query("UPDATE darkrp_player SET " .. cars[arg1].EntName .. " = '1' WHERE uid = " .. ply:UniqueID()) end local car = ents.Create(cars[arg1].EntName) if car:IsValid() then car:SetKeyValue("vehiclescript", cars[arg1].Script) car:SetModel(cars[arg1].Model) car:Own(ply) car:SetPos(cars[arg1].Vector) car:Spawn() car:Activate() end end concommand.Add("buy_car", AddItem_Car) [/lua]
[QUOTE=G4MB!T;38188560] use the inflator tool or decompile the model and remove its head[/QUOTE] toolgunning yourself is impossible and i need it to be automatically done when the player spawns and it should be clientside so its only headless for the said players model
Sorry, you need to Log In to post a reply to this thread.