1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

{SOLVED}Donation Custom Classes

Discussion in 'Player General Chat' started by TheJmasterJJ, Jul 3, 2017.

  1. TheJmasterJJ

    TheJmasterJJ New Member

    Hi, I use this lua code for the donation custom classes on my server. It does work but other people cannot preview the class, like if they are a user they can't see it on the pop up menu. How do I fix that? Also, how do I make it so that admins automatically have access to the class too? Thanks

    customCheck = function(ply) return ply:GetUserGroup(usergroup) == "VIP" end,
    CustomCheckFailMsg = "Donate on our website to unlock this class!"
     
  2. Sir Klutch

    Sir Klutch Active Member

    Code (Lua):

    customCheck = function(ply) return ply:IsUserGroup("VIP") or ply:IsAdmin() end,
    CustomCheckFailMsg = "Donate on our website to unlock this class!"
     
    As for the jobs not appearing, could you please post your jobs? I have never come across this issue myself, but maybe someone else who has could help you.
     
    Last edited: Jul 3, 2017
  3. TheJmasterJJ

    TheJmasterJJ New Member

    TEAM_MAUL = DarkRP.createJob("Darth Maul", {
    color = Color(0, 0, 0, 255),
    model = {"models/player/darth/maul.mdl"},
    description = [["Revenge... I must have revenge"]],
    weapons = {"weapon_lightsaber", "dmaul", "grapplehook"},
    command = "maul",
    max = 1,
    salary = 100,
    admin = 1,
    vote = false,
    hasLicense = false,
    candemote = false,
    category = "VIP",
    })
    TEAM_MAXPAYNE = DarkRP.createJob("Max Payne", {
    color = Color(0, 0, 0, 255),
    model = {"models/maxpayne/max_hoboken.mdl"},
    description = [["I don't know about angels, but it's fear that gives men wings." - Max Payne]],
    weapons = {"m9k_deagle", "weapon_vape_medicinal", "m9k_machete", "grapplehook"},
    command = "maxpayne",
    max = 1,
    salary = 100,
    admin = 1,
    vote = false,
    hasLicense = true,
    candemote = false,
    category = "VIP"
    })
    TEAM_DATBOI = DarkRP.createJob("dat boi", {
    color = Color(51, 201, 85, 255),
    model = {"models/datboi/datboi_reference.mdl"},
    description = [[Watch him rollin, watch him go, here come dat boi, o shit waddup.]],
    weapons = {"m9k_damascus", "m9k_ragingbull", "weapon_vape_american", "grapplehook", "weapon_gpee"},
    command = "datboi",
    max = 1,
    salary = 100,
    admin = 1,
    vote = false,
    hasLicense = false,
    candemote = false,
    category = "VIP"
    })
    TEAM_MICKEY = DarkRP.createJob("Mickey Mouse", {
    color = Color(107, 95, 95, 255),
    model = {"models/player/mystfro/mickey_mouse.mdl"},
    description = [[Mickey Mouse does some weird shit...]],
    weapons = {"weapon_rape", "grapplehook", "weapon_bugbait", "m9k_machete"},
    command = "mickey",
    max = 1,
    salary = 100,
    admin = 1,
    vote = false,
    hasLicense = false,
    candemote = true,
    -- CustomCheck
    medic = false,
    chief = false,
    mayor = false,
    hobo = false,
    cook = false,
    category = "VIP",
    })

    Those are the VIP classes without the donation lua code.
     
  4. Your admin line is 1.
    Now this profession can take / see those players who have the privilege of the administrator.
     
    Sir Klutch likes this.
  5. TheJmasterJJ

    TheJmasterJJ New Member

    Non-donators still cannot see the class. Only admins and the members that are in VIP can see it.
    TEAM_MAUL = DarkRP.createJob("Darth Maul", {
    color = Color(0, 0, 0, 255),
    model = {"models/player/darth/maul.mdl"},
    description = [["Revenge... I must have revenge"]],
    weapons = {"weapon_lightsaber", "dmaul", "grapplehook"},
    command = "maul",
    max = 1,
    salary = 100,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = false,
    category = "VIP",
    customCheck = function(ply) return ply:IsUserGroup("VIP") or ply:IsAdmin() end,
    CustomCheckFailMsg = "Donate on our website to unlock this class!"
    })
    TEAM_MAXPAYNE = DarkRP.createJob("Max Payne", {
    color = Color(0, 0, 0, 255),
    model = {"models/maxpayne/max_hoboken.mdl"},
    description = [["I don't know about angels, but it's fear that gives men wings." - Max Payne]],
    weapons = {"m9k_deagle", "weapon_vape_medicinal", "m9k_machete", "grapplehook"},
    command = "maxpayne",
    max = 1,
    salary = 100,
    admin = 0,
    vote = false,
    hasLicense = true,
    candemote = false,
    category = "VIP",
    customCheck = function(ply) return ply:IsUserGroup("VIP") or ply:IsAdmin() end,
    CustomCheckFailMsg = "Donate on our website to unlock this class!"
    })
    TEAM_DATBOI = DarkRP.createJob("dat boi", {
    color = Color(51, 201, 85, 255),
    model = {"models/datboi/datboi_reference.mdl"},
    description = [[Watch him rollin, watch him go, here come dat boi, o shit waddup.]],
    weapons = {"m9k_damascus", "m9k_ragingbull", "weapon_vape_american", "grapplehook", "weapon_gpee"},
    command = "datboi",
    max = 1,
    salary = 100,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = false,
    category = "VIP",
    customCheck = function(ply) return ply:IsUserGroup("VIP") or ply:IsAdmin() end,
    CustomCheckFailMsg = "Donate on our website to unlock this class!"
    })
    TEAM_MICKEY = DarkRP.createJob("Mickey Mouse", {
    color = Color(107, 95, 95, 255),
    model = {"models/player/mystfro/mickey_mouse.mdl"},
    description = [[Mickey Mouse does some weird shit...]],
    weapons = {"weapon_rape", "grapplehook", "weapon_bugbait", "m9k_machete"},
    command = "mickey",
    max = 1,
    salary = 100,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = true,
    -- CustomCheck
    medic = false,
    chief = false,
    mayor = false,
    hobo = false,
    cook = false,
    category = "VIP",
    customCheck = function(ply) return ply:IsUserGroup("VIP") or ply:IsAdmin() end,
    CustomCheckFailMsg = "Donate on our website to unlock this class!"
    })
    TEAM_PROFESSIONALTHIEF = DarkRP.createJob("Professional Thief", {
    color = Color(143, 132, 132, 255),
    model = {"models/player/group01/cookies114.mdl"},
    description = [[You are a thief, rob people, lockpick their house and steal their plants and legal printers. Can assist in a raid or start one themselves.]],
    weapons = {"climb_swep2", "lockpick", "keypad_cracker", "grapplehook"},
    command = "professionalthief",
    max = 2,
    salary = 45,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = false,
    category = "VIP",
    customCheck = function(ply) return ply:IsUserGroup("VIP") or ply:IsAdmin() end,
    CustomCheckFailMsg = "Donate on our website to unlock this class!"
    })
     
  6. Try using this code, I know it's not convenient. I need to make sure that it's not a customcheck.






    customCheck = function(ply) return CLIENT or ply:GetNWString("usergroup") == "VIP" or ply:GetNWString("usergroup") == "admin" or ply:GetNWString("usergroup") == "superadmin" end,
    CustomCheckFailMsg = "Donate Job"
     
  7. Sir Klutch

    Sir Klutch Active Member


    Do not use GetNWString(). It's a terrible habit...
     
  8. TheJmasterJJ

    TheJmasterJJ New Member

    Thank you so much! The code worked on the VIP classes
     
  9. You're welcome! :D
     

Share This Page