1. Post #1521
    LUModder's Avatar
    January 2014
    1,138 Posts
    My friend is getting weird errors I've never seen in DarkRP. Unmodified base files I believe.

    Code:
    Lua Error: [ERROR] gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:597: attempt to call field 'retrieveTeamSpawnPos' (a nil value) 1. unknown - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:597
    
    Lua Error: [ERROR] gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:741: attempt to index field 'Access' (a nil value) 1. Call - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:741 2. PlayerSpawn - gamemodes/base/gamemode/player.lua:267 3. unknown - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:661
    
    Lua Error: [ERROR] lua/autorun/server/undeadnotifier.lua:4: attempt to index global 'AtmosGlobal' (a nil value) 1. unknown - lua/autorun/server/undeadnotifier.lua:4
    
    Lua Error: [ERROR] gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:741: attempt to index field 'Access' (a nil value) 1. Call - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:741 2. changeTeam - gamemodes/darkrp/gamemode/modules/jobs/sv_jobs.lua:139 3. callback - gamemodes/darkrp/gamemode/modules/base/sh_createitems.lua:275 4. unknown - gamemodes/darkrp/gamemode/modules/chat/sv_chat.lua:141 5. unknown - lua/includes/modules/concommand.lua:69

  2. Post #1522
    A Simple Programmer Learning The Ropes
    bluebull107's Avatar
    July 2014
    536 Posts
    What map are you playing on?

  3. Post #1523
    LUModder's Avatar
    January 2014
    1,138 Posts
    What map are you playing on?
    The map is rp_richland

  4. Post #1524
    A Simple Programmer Learning The Ropes
    bluebull107's Avatar
    July 2014
    536 Posts
    May be something wrong with the map and your atmosphere addon screwing up....
    Thats all I can figure from the few lines of code you gave me

  5. Post #1525

    September 2014
    21 Posts
    In my DarkRP server's addons folder I have darkrpmodification (to edit darkrp stuff).

    When I load up the server, files in darkrpmodification/lua/darkrp_config, such as disabled_defaults.lua, load fine.

    However, other folders, such as darkrpmodification/lua/darkrp_customthings, do not load. So, no custom jobs, ammo's, etc show up in the F4 Menu.

    Everything was working fine until when I recently put something in the darkrp folder by accident, then reinstalled the folder to make it clean again.

    EDIT: This thread is so lonely...

    EDIT: Re-installed my entire server and it's fixed. It was due to a buggy script I had (surprisingly).

  6. Post #1526
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    Is it safe to forcibly remove job changing chat commands? I don't want people to be able to change whenever they want.

  7. Post #1527
    CoreBase's Avatar
    September 2014
    128 Posts
    Is it safe to forcibly remove job changing chat commands? I don't want people to be able to change whenever they want.
    I'm not sure but you could change this
    https://github.com/FPtje/darkrpmodif...ttings.lua#L11

    or (not sure if it will work but it should)
    Code:
     TEAM_PIRATE = DarkRP.createJob("Pirate", { -- That's TEAM_PIRATE (Used for like AddCustomDoorgroup or Add to only that group to a door. Also, never use the same TEAM_)
            color = Color(80, 5, 255, 0), -- Chat / Scoreboard Color
            model = "models/player/swat.mdl", -- Model; to add multiple use  {"models/../model1.mdl","models/../model2.mld},  NOTE the extra comma after the bracket.
            description = [[Description.]], --Description for Job.
            weapons = {"med_kit"}, -- Weapons for a job. Seperate them with a "," eg: "med_kid", "armor_kit" always finish the last one without a ","
            command = nil, --Chat command for job. Don't use the same as another teams.
            max = 5, -- Maximum amount of players for this job.
            salary = 200, -- The salary they get paid.
            admin = 0, -- Requires Admin? 1 for yes, 0 for no.
            vote = true, -- Do they need to vote? true for yes, false for no.
            hasLicense = true, -- Do they have a license for weapons?
         })
    I changed
    Code:
    command = "blabla",
    to
    Code:
    command = nil,
    if you didn't see it

  8. Post #1528
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    I'm not sure but you could change this
    https://github.com/FPtje/darkrpmodif...ttings.lua#L11

    or (not sure if it will work but it should)

    I changed
    Code:
    command = "blabla",
    to
    Code:
    command = nil,
    if you didn't see it
    first one probably only applies to custom job titles (didn't stop me from changing regular jobs), and the second one fatal errors because you need to put a command in there

  9. Post #1529
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    Is it safe to forcibly remove job changing chat commands? I don't want people to be able to change whenever they want.
    I added a canChatCommand hook in the latest update of DarkRP.

    http://wiki.darkrp.com/index.php/Hoo...canchatcommand
    -- Example:
    
    hook.Add("canChatCommand", "cocks", function(ply, cmd, args)
        if ply:IsAdmin() then return end
        if cmd == "buymoneyprinter" then return false end
    end)
    
    You would use a something that checks against the team commands and the team vote commands.

    Edited:

    Reply With Quote Edit / Delete Reply Show Events Winner Winner x 2Friendly Friendly x 1 (list)

  10. Post #1530

    September 2014
    4 Posts
    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?

  11. Post #1531
    tired of being tired
    Jeezy's Avatar
    August 2012
    890 Posts
    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?
    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.
    http://wiki.garrysmod.com/page/Global/ScrW
    http://wiki.garrysmod.com/page/Global/ScrH
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 1 (list)

  12. Post #1532

    September 2014
    4 Posts
    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.
    http://wiki.garrysmod.com/page/Global/ScrW
    http://wiki.garrysmod.com/page/Global/ScrH


    i did that already and this is what happens:


    At 1280-720 revolution: http://gyazo.com/7b1a5788fdbce6174262f3fcce146212
    But now at 1600-900 : http://gyazo.com/329d6c5dcefb04e6df1d10952ba80a76

    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.

  13. Post #1533
    Xaotic's Avatar
    May 2013
    221 Posts
    i did that already and this is what happens:


    At 1280-720 revolution: http://gyazo.com/7b1a5788fdbce6174262f3fcce146212
    But now at 1600-900 : http://gyazo.com/329d6c5dcefb04e6df1d10952ba80a76

    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.
    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.
    Reply With Quote Edit / Delete Reply Show Events Disagree Disagree x 1 (list)

  14. Post #1534
    Acecool discovered a way to get classes working in Lua; MetaTable users hate him, ArmA devs love him

    February 2012
    5,839 Posts
    Creating HUDs:
    https://dl.dropboxusercontent.com/u/...ation.lua.html

    Hardcoding HUD resolution, and using a modifier ( multiplier ) to scale the HUD for different resolutions:
    https://dl.dropboxusercontent.com/u/...sizes.lua.html

    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.
    Reply With Quote Edit / Delete Reply Show Events Agree Agree x 1 (list)

  15. Post #1535

    September 2014
    4 Posts
    Creating HUDs:
    https://dl.dropboxusercontent.com/u/...ation.lua.html

    Hardcoding HUD resolution, and using a modifier ( multiplier ) to scale the HUD for different resolutions:
    https://dl.dropboxusercontent.com/u/...sizes.lua.html

    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.

    ok, this is helping but how can i do the same with texts?

  16. Post #1536
    Acecool discovered a way to get classes working in Lua; MetaTable users hate him, ArmA devs love him

    February 2012
    5,839 Posts
    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.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  17. Post #1537

    September 2014
    4 Posts
    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.
    nvm i found it out already :D

    thanks!

  18. Post #1538
    TrippleT's Avatar
    December 2013
    137 Posts
    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 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)
    tryed doing this in the server side after i click the button. yes i know i'm a noob..

  19. Post #1539
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    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
    What's up with this error, and how can i solve it? I don't think it's causing any problems.

  20. Post #1540

    October 2014
    1 Posts
    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:

  21. Post #1541
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    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
    What's up with this error, and how can i solve it? I don't think it's causing any problems.
    https://github.com/FPtje/DarkRP/blob...h_cppi.lua#L35

    Unless ents.GetAll returns things that aren't entities, CPPIGetOwner should be defined.

  22. Post #1542
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    https://github.com/FPtje/DarkRP/blob...h_cppi.lua#L35

    Unless ents.GetAll returns things that aren't entities, CPPIGetOwner should be defined.
    I never use that function though, that's what's odd.
    Same with IsConstraint, throws some error too.

  23. Post #1543
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    I never use that function though, that's what's odd.
    Same with IsConstraint, throws some error too.
    FPP uses it in ownability, see error.
    Looks like Ents.GetAll returns things that aren't entities.

  24. Post #1544
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    FPP uses it in ownability, see error.
    Looks like Ents.GetAll returns things that aren't entities.
    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

  25. Post #1545
    Gold Member
    smithy285's Avatar
    August 2012
    1,642 Posts
    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.

    Edited:

    Nevermind, I made a pull request to add onPaidTax hook to DarkRP

  26. Post #1546
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts


    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

  27. Post #1547
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts


    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
    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.

  28. Post #1548
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    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.
    but what if there's a fatal error before commit has been run? that's what can happen

  29. Post #1549
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    but what if there's a fatal error before commit has been run? that's what can happen
    What, Lua errors?
    If I recall correctly an SQL error should cancel the transactions.

  30. Post #1550
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    What, Lua errors?
    If I recall correctly an SQL error should cancel the transactions.
    lua errors, yes
    can't check if the query is populated either, since it's a local variable

  31. Post #1551
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    lua errors, yes
    can't check if the query is populated either, since it's a local variable
    The queued queries system doesn't account for errors. It might break.
    Always fix Lua errors.

  32. Post #1552

    June 2013
    41 Posts
    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: http://facepunch.com/showthread.php?t=1432409 I don't want to come off as rude to anyone, so sorry if I offend you :(

  33. Post #1553
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    The queued queries system doesn't account for errors. It might break.
    Always fix Lua errors.
    unforeseen lua errors can always happen
    Reply With Quote Edit / Delete Reply Show Events Disagree Disagree x 1 (list)

  34. Post #1554
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    unforeseen lua errors can always happen
    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.

  35. Post #1555
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    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.
    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.

  36. Post #1556
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    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.
    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?

  37. Post #1557

    July 2013
    43 Posts
    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

  38. Post #1558
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    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?
    maybe have something to check whether .begin has been run already?

  39. Post #1559
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    7,489 Posts
    maybe have something to check whether .begin has been run already?
    https://github.com/FPtje/MySQLite/bl...sqlite.lua#L60
    Already there

  40. Post #1560
    ( ͡° ͜ʖ ͡°)
    Giraffen93's Avatar
    December 2006
    20,944 Posts
    But I can't really do a bool comparison with that, right?