• DarkRP Help Thread V1
    1,767 replies, posted
  • [QUOTE=chandlerR;46036395][B]i made a custom HUD but it gets badly offset-ed when people have different revolutions... is there a way to make it so my HUD auto sets to the revolution that my users have?[/B][/QUOTE] This is kinda unrelated to DarkRP, but you must set the size and position of the HUD elements using a ratio of the ScrW( ) and ScrH( ) functions. [url]http://wiki.garrysmod.com/page/Global/ScrW[/url] [url]http://wiki.garrysmod.com/page/Global/ScrH[/url]
  • [QUOTE=Jeezy;46036562]This is kinda unrelated to DarkRP, but you must set the size and position of the HUD elements using a ratio of the ScrW( ) and ScrH( ) functions. [url]http://wiki.garrysmod.com/page/Global/ScrW[/url] [url]http://wiki.garrysmod.com/page/Global/ScrH[/url][/QUOTE] i did that already and this is what happens: At 1280-720 revolution: [url]http://gyazo.com/7b1a5788fdbce6174262f3fcce146212[/url] But now at 1600-900 : [url]http://gyazo.com/329d6c5dcefb04e6df1d10952ba80a76[/url] How can i fix this? (make it so it will be the same as 1280-720 but on any revolution) ps. It's an Darkrp Hud so i thought it will fit in this thread.
  • [QUOTE=chandlerR;46036609]i did that already and this is what happens: At 1280-720 revolution: [url]http://gyazo.com/7b1a5788fdbce6174262f3fcce146212[/url] But now at 1600-900 : [url]http://gyazo.com/329d6c5dcefb04e6df1d10952ba80a76[/url] How can i fix this? (make it so it will be the same as 1280-720 but on any revolution) ps. It's an Darkrp Hud so i thought it will fit in this thread.[/QUOTE] Did you restart after changing solution? If no you gotta do so. Also rather use relative functions to declare the positions and not exact pixels. Like x pos = ScrW()/0.1 and such.
  • Creating HUDs: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/proper_hud_creation.lua.html[/url] Hardcoding HUD resolution, and using a modifier ( multiplier ) to scale the HUD for different resolutions: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/understanding_hardcoding_of_screensizes.lua.html[/url] Auto-refresh should be fine if they're using Windows. Otherwise a console command would be needed to refresh the code. If it is an addon, it'll refresh independently of the game-mode if I recall correctly.
  • [QUOTE=Acecool;46039043]Creating HUDs: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/proper_hud_creation.lua.html[/url] Hardcoding HUD resolution, and using a modifier ( multiplier ) to scale the HUD for different resolutions: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/understanding_hardcoding_of_screensizes.lua.html[/url] Auto-refresh should be fine if they're using Windows. Otherwise a console command would be needed to refresh the code. If it is an addon, it'll refresh independently of the game-mode if I recall correctly.[/QUOTE] ok, this is helping but how can i do the same with texts?
  • Do you mean font size? There is a function so when you CreateFont, you'd use ScreenScale( x ) for the size, where x is the size you want to scale.
  • [QUOTE=Acecool;46040422]Do you mean font size? There is a function so when you CreateFont, you'd use ScreenScale( x ) for the size, where x is the size you want to scale.[/QUOTE] nvm i found it out already :D thanks!
  • hey so i'm making a npc that is supposed to make a window come up and display 1 job at a time until i click the next button to display the next job in the list. so i made the npc and the vgui but now im stuck and idk how to get the job list into a tabel that i can cycle thru or even change the job of the player.. i have looked in the darkrp code and for a beginner it is really confusing. posting here for help is all i can think of doing. so the question summed up is how can i get the darkrp job list into a tabel(if it is not one) and change the players job when he clicks a button? if my rant confused you here is a pic [IMG]http://i.imgur.com/kXHXnNX.jpg[/IMG] so in the middle its supposed to show the job model and info and the number 6 is supposed to display the team name but it just shows the number. [CODE]net.Receive("hello", function() pie = net.ReadBit() if pie == true then ply.SetTeam = TEAM_CITIZEN else end end)[/CODE] tryed doing this in the server side after i click the button. yes i know i'm a noob..
  • [code][ERROR] gamemodes/darkrp/gamemode/modules/fpp/pp/server/ownability.lua:466: attempt to call method 'CPPIGetOwner' (a nil value) 1. v - gamemodes/darkrp/gamemode/modules/fpp/pp/server/ownability.lua:466 2. unknown - lua/includes/modules/hook.lua:84[/code] What's up with this error, and how can i solve it? I don't think it's causing any problems.
  • Having a major problem with the footsteps sounds in DRP. They sound like static and beeping every step I take. I hate it! Any way to fix it? Help appreciated c:
  • [QUOTE=Giraffen93;46183517][code][ERROR] gamemodes/darkrp/gamemode/modules/fpp/pp/server/ownability.lua:466: attempt to call method 'CPPIGetOwner' (a nil value) 1. v - gamemodes/darkrp/gamemode/modules/fpp/pp/server/ownability.lua:466 2. unknown - lua/includes/modules/hook.lua:84[/code] What's up with this error, and how can i solve it? I don't think it's causing any problems.[/QUOTE] [url]https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/fpp/pp/sh_cppi.lua#L35[/url] Unless ents.GetAll returns things that aren't entities, CPPIGetOwner should be defined.
  • [QUOTE=FPtje;46212480][url]https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/fpp/pp/sh_cppi.lua#L35[/url] Unless ents.GetAll returns things that aren't entities, CPPIGetOwner should be defined.[/QUOTE] I never use that function though, that's what's odd. Same with IsConstraint, throws some error too.
  • [QUOTE=Giraffen93;46213886]I never use that function though, that's what's odd. Same with IsConstraint, throws some error too.[/QUOTE] FPP uses it in ownability, see error. Looks like Ents.GetAll returns things that aren't entities.
  • [QUOTE=FPtje;46214050]FPP uses it in ownability, see error. Looks like Ents.GetAll returns things that aren't entities.[/QUOTE] well it is removing a bunch of entities when the player leaves, maybe that's it? i don't have the fpp prop remove thing enabled
  • How can I get how much tax a player has paid? I don't see a hook or any related functions on the DarkRP wiki. [editline]12th October 2014[/editline] Nevermind, I made a pull request to add onPaidTax hook to DarkRP
  • [IMG]http://i.imgur.com/MLhlOM5.png[/IMG] so.. how do i get out of a loop like this? if i run .commit if there's no begin it errors, and i can't seem to reset it if it's stuck
  • [QUOTE=Giraffen93;46292226][IMG]http://i.imgur.com/MLhlOM5.png[/IMG] so.. how do i get out of a loop like this? if i run .commit if there's no begin it errors, and i can't seem to reset it if it's stuck[/QUOTE] After begin, run commit. This error is thrown when you try to begin a transaction while the previous one isn't finished yet. Not throwing the error will lead to unexpected and even crazy behaviour. You're not supposed to start transactions within transactions.
  • [QUOTE=FPtje;46294288]After begin, run commit. This error is thrown when you try to begin a transaction while the previous one isn't finished yet. Not throwing the error will lead to unexpected and even crazy behaviour. You're not supposed to start transactions within transactions.[/QUOTE] but what if there's a fatal error before commit has been run? that's what can happen
  • [QUOTE=Giraffen93;46294549]but what if there's a fatal error before commit has been run? that's what can happen[/QUOTE] What, Lua errors? If I recall correctly an SQL error should cancel the transactions.
  • [QUOTE=FPtje;46295419]What, Lua errors? If I recall correctly an SQL error should cancel the transactions.[/QUOTE] lua errors, yes can't check if the query is populated either, since it's a local variable
  • [QUOTE=Giraffen93;46295454]lua errors, yes can't check if the query is populated either, since it's a local variable[/QUOTE] The queued queries system doesn't account for errors. It might break. Always fix Lua errors.
  • Hey, I've been having some issues with my DarkRP server. It seems that none of my GM confit changes do anything, there is no console error which is strange. an explains of this is the restrict pistol one, I set it to false and the weapons tab is still available to everyone. My other issue is here: [url]http://facepunch.com/showthread.php?t=1432409[/url] I don't want to come off as rude to anyone, so sorry if I offend you :(
  • [QUOTE=FPtje;46296164]The queued queries system doesn't account for errors. It might break. Always fix Lua errors.[/QUOTE] unforeseen lua errors can always happen
  • [QUOTE=Giraffen93;46303527]unforeseen lua errors can always happen[/QUOTE] You control the code between two transactions. You shouldn't queue queries over several frames. You are responsible for any errors within the transaction block. Fix them.
  • [QUOTE=FPtje;46309222]You control the code between two transactions. You shouldn't queue queries over several frames. You are responsible for any errors within the transaction block. Fix them.[/QUOTE] It's a for loop, and i'm stress testing it for errors really hard. If an item has an error in it, the whole thing fails and all queries in the future.
  • [QUOTE=Giraffen93;46309241]It's a for loop, and i'm stress testing it for errors really hard. If an item has an error in it, the whole thing fails and all queries in the future.[/QUOTE] The api maintains state across function calls. It trusts the programmer to use it correctly. I cannot check whether any error occurs in YOUR code. I cannot know when the programmer decides to commit a transaction. What do you even expect me to do?
  • Hi all , I have installed a darkrp 2.4.3 but i'm got a problem : Entities (like money printer / gun /etc ) and props are not removing on disconnected . I have try to instal FPP , nadmod but there don't work . If you have a issue i'm listenning you =) Nico
  • [QUOTE=FPtje;46309894]The api maintains state across function calls. It trusts the programmer to use it correctly. I cannot check whether any error occurs in YOUR code. I cannot know when the programmer decides to commit a transaction. What do you even expect me to do?[/QUOTE] maybe have something to check whether .begin has been run already?
  • [QUOTE=Giraffen93;46310086]maybe have something to check whether .begin has been run already?[/QUOTE] [url]https://github.com/FPtje/MySQLite/blob/master/mysqlite.lua#L60[/url] Already there
  • [QUOTE=FPtje;46317737][url]https://github.com/FPtje/MySQLite/blob/master/mysqlite.lua#L60[/url] Already there[/QUOTE] But I can't really do a bool comparison with that, right?