I have this:
[CODE]
TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, false,nil, function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
[/CODE]
It is for DarkRP, but it doesnt work. They can still change jobs.
TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, [B]false,nil,[/B] function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
Try adding a space between false,nil,
[QUOTE=munch;38331252]TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, [B]false,nil,[/B] function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
Try adding a space between false,nil,[/QUOTE]
I did that. Still no good.
You're not going to get much help from the average person here since nobody knows what the args for AddExtraTeam is. It's an incredibly stupid way to be setting up player classes.
[QUOTE=twoski;38331385]You're not going to get much help from the average person here since nobody knows what the args for AddExtraTeam is. It's an incredibly stupid way to be setting up player classes.[/QUOTE]
I used this page: [url]http://code.google.com/p/darkrp/wiki/DonatorJobs[/url]
And it almost worked, but the format they had wouldn't work. Now I realize that only SWAT Leader works. Here's the whole file:
[CODE]
TEAM_HOBO = AddExtraTeam("Hobo", Color(80, 45, 0, 255), "models/player/corpse1.mdl", [[The lowest member of society. All people see you laugh.
You have no home.
Beg for your food and money
Sing for everyone who passes to get money
Make your own wooden home somewhere in a corner or
outside someone else's door]], {"weapon_bugbait"}, "hobo", 5, 0, 0, false)
//No extra weapons say /hobo to become hobo Maximum hobo's = 5 his salary = 0 because hobo's don't earn money. 0 = everyone can become hobo , false = you don't have to vote to become hobo
// MAKE SURE THAT THERE IS NO / IN THE TEAM NAME OR IN THE TEAM COMMAND:
// TEAM_/DUDE IS WROOOOOONG !!!!!!
// HAVING "/dude" IN THE COMMAND FIELD IS WROOOOOOOONG!!!!
//ADD TEAMS UNDER THIS LINE:
TEAM_SWAT = AddExtraTeam("SWAT", Color(51,0,255,255), "models/player/combine_soldier.mdl", [[As S.W.A.T it is your job to bust the drug dealers and make sure nothing seriously illegal is going on.
]], {"door_ram", "weapon_mad_mp5"}, "swat", 5, 80, 1, true)
TEAM_SWATSNIPE = AddExtraTeam("SWAT Sniper", Color(51,0,255,255),
"models/player/combine_soldier.mdl", [[It is your job to cover the SWAT men. Only use your sniper rifles in defense.]], {"weapon_mad_scout", "weapon_glock2"}, "sniper",1, 150, 1, true, nil, function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
TEAM_THIEF = AddExtraTeam("Thief", Color(153,153,51,255), "models/player/breen.mdl", [[
You are the crook of the town , you can be hired or just steal for fun you choose.
]], {"lockpick"}, "thief", 3, 30, 0, false)
TEAM_HOTEL = AddExtraTeam("Hotel Manager", Color(255,0,0,0), "models/player/group03/male_02.mdl", [[
You are the crook of the town , you can be hired or just steal for fun you choose.
]], {}, "hotelmanager", 1, 75, 0, false)
TEAM_SUPERTHIEF = AddExtraTeam("Super Thief", Color(153,153,51,255), "models/player/group03/male_03.mdl",
[[You are the crook of the town , you can be hired or just steal for fun you choose.]], {"lockpick", "keypad_cracker"}, "superthief", 2, 20, 0, false, nil, function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
TEAM_HACKER = AddExtraTeam("Hacker", Color(153,153,51,255), "models/player/kleiner.mdl", [[
You are the crook of the town , you can be hired or just steal for fun you choose.
]], {"keypad_cracker"}, "hacker", 3, 30, 0, false)
TEAM_ANARCHIST = AddExtraTeam("Anarchist", Color(120,100,120,255), "models/player/group03/male_09.mdl", [[As an anarchist you despise the government. However, you are not allowed to kill them randomly.]], {"weapon_p2282"}, "rebel", 2, 60, 0, false)
TEAM_SWATLDR = AddExtraTeam("SWAT Leader", Color(51,0,255,255), "models/player/combine_soldier.mdl", [[As SWAT LEADER it is to order your men around and make the city a safe place.]], {"weapon_mad_spas", "weapon_deagle"}, "SWATLDR", 1, 100, 1, true, nil, function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
TEAM_GUARD = AddExtraTeam("Bodyguard", Color(0,0,51,255), "models/player/phoenix.mdl", [[
You protect people for money.
]], {"weapon_mad_fists"}, "GUARD", 3, 60, 0, false)
TEAM_HIT = AddExtraTeam("Hitman", Color(153,153,153,255), "models/player/barney.mdl", [[You "whack off" those un wanted guests...for a price.]], {"weapon_mad_tmp"}, "HIT", 2, 40, 0, true, nil, function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, false, nil, function(ply) return ply:GetUserGroup() == "VIP" or ply:IsAdmin() end)
/*
[/CODE]
I don't think you understood what i was saying. I don't know what all these arguments for AddExtraTeam are. There's a bunch of nondescript integers and shit. Instead of:
[lua]AddExtraTeam( TEAM_SHIT, "Shit Man", { "weapon_rpg", "weapon_crowbar" }, false, 23, 20194, true, false, 253, 2, TEAM_SHIT, 1000, TEAM_SHIT, "You are a shit man", 345, false, true, nil, false, function( ply ) return ply:IsAdmin() end, false, true, 9, nil, 2, true, nil )[/lua]
It should be something like
[lua]
GM:AddExtraTeam{ Name = "Shit Man",
Team = TEAM_SHIT,
Weapons = { "weapon_rpg" },
CanJoin = function( ply ) return ply:IsAdmin() end }[/lua]
At least that's semi-readable. It's still not optimal since a team/class module would probably make things a lot more manageable. But this is DarkRP, the gamemode equivalent of testicular cancer.
The problem is with your usergroups i'm guessing, you should be posting this in the DarkRP thread because, like i said, the average person here doesn't know how the poorly written crap in DarkRP works.
[QUOTE=twoski;38331544]you should be posting this in the DarkRP thread because, like i said, the average person here doesn't know how the poorly written crap in DarkRP works.[/QUOTE]
I know I am going to sound like a noob, but DarkRP thread...?
If you're using ULX it's:
[CODE]TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, false,nil, function(ply) return ply:IsUserGroup("vip") or ply:IsAdmin() or ply:IsSuperAdmin() end)[/CODE]
[QUOTE=brandonj4;38331653]If you're using ULX it's:
[CODE]TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, false,nil, function(ply) return ply:IsUserGroup("vip") or ply:IsAdmin() or ply:IsSuperAdmin() end)[/CODE][/QUOTE]
You don't need the superadmin check.
ULX has some system, IsUserGroup means really is in the usergroup.
IsAdmin and IsSuperAdmin return true whenever the player has a rank above it.
Basically rank penis, above admin under superadmin returns true at IsAdmin.
Rank vagina, above superadmins returns true at IsSuperAdmin.
So yeah, just do if ( ply:IsUserGroup("vip") or ply:IsAdmin() ) then ...
Edit:
Because I'm such a bad guy:
[code]
TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, false, nil, function(ply) return ply:IsUserGroup("vip") or ply:IsAdmin() end)
[/code]
[QUOTE=brandonj4;38331653]If you're using ULX it's:
[CODE]TEAM_DETECTIVE = AddExtraTeam("Detective", Color(0,0,0,255), "models/player/gman_high.mdl", [[You spy on people for money, you know just about everything in the city.]], {"weapon_mad_knife"}, "detective", 2, 60, 0, false,nil, function(ply) return ply:IsUserGroup("vip") or ply:IsAdmin() or ply:IsSuperAdmin() end)[/CODE][/QUOTE]
Oh wow thanks!
But, now I added this to my addentities and now I can't see any entities. Here is the code:
[CODE]
AddEntity("Drug lab", "drug_lab", "models/props_lab/crematorcase.mdl", 400, 3, "/buydruglab", {TEAM_GANG, TEAM_MOB})
AddEntity("Basic Printer", "money_printer", "models/props_c17/consolebox01a.mdl", 1000, 2, "/buymoneyprinter")
AddEntity("Bronze Printer", "bronze_printer", "models/props_c17/consolebox01a.mdl", 1500, 2, "/buybronzeprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Silver Printer", "silver_printer", "models/props_c17/consolebox01a.mdl", 2500, 2, "/buysilverprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Gold Printer", "gold_printer", "models/props_c17/consolebox01a.mdl", 5000, 1, "/buygoldprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Diamond Printer", "diamond_printer", "models/props_c17/consolebox01a.mdl", 10000, 1, "/buydiamondprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Platinum Printer", "platinum_printer", "models/props_c17/consolebox01a.mdl", 25000, 1, "/buyplatinumprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Microwave", "microwave", "models/props/cs_office/microwave.mdl", 400, 1, "/buymicrowave", TEAM_COOK)
AddEntity("Gun lab", "gunlab", "models/props_c17/TrapPropeller_Engine.mdl", 500, 1, "/buygunlab", TEAM_GUN)
[/CODE]
[QUOTE=Pon-3;38331736]Oh wow thanks!
But, now I added this to my addentities and now I can't see any entities. Here is the code:
[CODE]
AddEntity("Drug lab", "drug_lab", "models/props_lab/crematorcase.mdl", 400, 3, "/buydruglab", {TEAM_GANG, TEAM_MOB})
AddEntity("Basic Printer", "money_printer", "models/props_c17/consolebox01a.mdl", 1000, 2, "/buymoneyprinter")
AddEntity("Bronze Printer", "bronze_printer", "models/props_c17/consolebox01a.mdl", 1500, 2, "/buybronzeprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Silver Printer", "silver_printer", "models/props_c17/consolebox01a.mdl", 2500, 2, "/buysilverprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Gold Printer", "gold_printer", "models/props_c17/consolebox01a.mdl", 5000, 1, "/buygoldprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Diamond Printer", "diamond_printer", "models/props_c17/consolebox01a.mdl", 10000, 1, "/buydiamondprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Platinum Printer", "platinum_printer", "models/props_c17/consolebox01a.mdl", 25000, 1, "/buyplatinumprinter", nil, function(ply) return ply:IsUserGroup("VIP") or ply:IsSuperAdmin() end))
AddEntity("Microwave", "microwave", "models/props/cs_office/microwave.mdl", 400, 1, "/buymicrowave", TEAM_COOK)
AddEntity("Gun lab", "gunlab", "models/props_c17/TrapPropeller_Engine.mdl", 500, 1, "/buygunlab", TEAM_GUN)
[/CODE][/QUOTE]
Instead of "or" shouldn't it say, "elseif"?
[QUOTE=All0utWar;38331849]Instead of "or" shouldn't it say, "elseif"?[/QUOTE]
"Elseif" is placed after "if". In that case "or" means "if the first one is nil, take the second".
Also you should use the new function of the AddExtraTeam and AddEntity included in the new version of DarkRP (Found on [url]http://github.com/FPtje/DarkRP[/url])
[QUOTE=ms333;38331962]Also you should use the new function of the AddExtraTeam and AddEntity included in the new version of DarkRP (Found on [url]http://github.com/FPtje/DarkRP[/url])[/QUOTE]
I don't have the latest darkrp and i dont want it.
Edit:
PS: Players still cannot buy shipments and money printers.
[QUOTE=Pon-3;38332062]I don't have the latest darkrp and i dont want it.
Edit:
PS: Players still cannot buy shipments and money printers.[/QUOTE]
If you're unwilling to update your DarkRP then don't expect any help with your old code. For all we know, the bugs you're talking about are fixed in a newer version.
A lot has been broken by the recent gmod updates so you should be using whatever updates are made available to you.
AND, players still can become hitman and other jobs.
[url]http://facepunch.com/showthread.php?t=1176387&page=11[/url]
use this thread for DarkRP questions, i'm sure you'll get more help there.
[QUOTE=twoski;38332132]If you're unwilling to update your DarkRP then don't expect any help with your old code. For all we know, the bugs you're talking about are fixed in a newer version.
A lot has been broken by the recent gmod updates so you should be using whatever updates are made available to you.[/QUOTE]
The problem with updating means I have to reformat all of my code. Which I am not doing. I still have no idea whats wrong and that thread you linked me has gotten me nowhere.
If you are unwilling to update, there is no tell of what could be wrong. Good day sir!
[QUOTE=MadkillerMax;38345217]If you are unwilling to update, there is no tell of what could be wrong. Good day sir![/QUOTE]
There is because the updates didn't fix anything relating to my issue.
its ply:GetUserGroup() == "vip" or you can do ply:IsUserGroup() == "vip" and the groups are never capitalized.
[QUOTE=Pon-3;38345779]There is because the updates didn't fix anything relating to my issue.[/QUOTE]
Do you not know grammar? Anyway, here is a simple version from one of my old, very old DarkRP servers:
[LUA]
TEAM_RIOT = AddExtraTeam("RIOT CONTROL", Color(50, 255, 0, 150), "models/player/riot.mdl", [[Riot control
Clean the streets
Pay: $70]], {"weapon_mad_mp7", "riotshield", "weapon_handcuffs", "weapon_real_cs_knife", "arrest_stick", "unarrest_stick", "door_ram", "stunstick", "weapon_mad_deagle", "weaponchecker"}, "riotcontrol", 2, 70, 0, true, true, {TEAM_CHIEF, TEAM_POLICE, TEAM_SNIPER, TEAM_SWAT}, function(ply) if (ply:GetUserGroup() == "donator" or ply:IsAdmin()) then return true end end)
[/LUA]
Sorry, you need to Log In to post a reply to this thread.