• DarkRP Multiple spawn models
    4 replies, posted
Hi everyone. I'll cut to the chase. I'm having problems with players spawning with multiple models (like it chooses a model randomly instead of just one). Can anyone help me out? Here's the police team: [code] TEAM_POLICE = AddExtraTeam("Police Officer", Color(25, 25, 170, 255), { "models/player/NYPD/male_07_player.mdl", "models/player/NYPD/male_01_player.mdl", "models/player/NYPD/male_02_player.mdl", "models/player/NYPD/male_04_player.mdl", "models/player/NYPD/male_05_player.mdl", "models/player/NYPD/male_06_player.mdl", "models/player/NYPD/male_08_player.mdl"}, [[The protector of every citizen that lives in the city . You have the power to arrest criminals and protect innocents. Hit them with your arrest baton to put them in jail. You have a Taser to take them down briefly. The Battering Ram can break down the door of a criminal with a warrant for his/her arrest. Type /wanted <name> to alert the public to this criminal OR go to tab and warrant someone by clicking the warrant button]], {"arrest_stick", "unarrest_stick", "weapon_mad_glock", "Taser", "door_ram", "weaponchecker", "weapon_mad_m3", "item_battery", "item_battery"}, "police", 10, 65, 0, true, true, TEAM_POLICE) [/code] Now I have a feeling that this method will only work with the citizen team, but I'm not sure. I looked at another thread but couldn't make sense of it. Don't worry about the MDL locations they're in the right place. Thanks for the help.
It should work, whats your problem with it ? try to change the models, I think there is a problem with it .
It comes up with this console error. Something about the VGUI. Can you give me an example of what you would put in? Here's my shared.lua: [code] RPExtraTeams = {} function AddExtraTeam( Name, color, model, Description, Weapons, command, maximum_amount_of_this_class, Salary, admin, Vote, Haslicense, NeedToChangeFrom) if not Name or not color or not model or not Description or not Weapons or not command or not maximum_amount_of_this_class or not Salary or not admin or Vote == nil then local text = "One of the custom teams is wrongly made! Attempt to give name of the wrongly made team!(if it's nil then I failed):\n" .. tostring(Name) print(text) hook.Add("PlayerSpawn", "TeamError", function(ply) if ply:IsAdmin() then ply:ChatPrint("WARNING: "..text) end end) end local CustomTeam = {name = Name, model = model, Des = Description, Weapons = Weapons, command = command, max = maximum_amount_of_this_class, salary = Salary, admin = admin or 0, Vote = tobool(Vote), NeedToChangeFrom = NeedToChangeFrom, Haslicense = Haslicense} table.insert(RPExtraTeams, CustomTeam) team.SetUp(#RPExtraTeams, Name, color) local Team = #RPExtraTeams if SERVER then timer.Simple(0.1, function(CustomTeam) AddTeamCommands(CustomTeam) end, CustomTeam) end return Team end hook.Add("InitPostEntity", "AddTeams", function() if file.Exists("CustomTeams.txt") then RunString(file.Read("CustomTeams.txt")) if SERVER then resource.AddFile("data/CustomTeams.txt") end if CLIENT and not LocalPlayer():IsSuperAdmin() then file.Delete("CustomTeams.txt") end end end) /*-------------------------------------------------------- Default teams. If you make a team above the citizen team, people will spawn with that team! --------------------------------------------------------*/ TEAM_CITIZEN = AddExtraTeam("Citizen", Color(20, 150, 20, 255), { "models/player/group02/male_01.mdl", "models/player/group02/male_02.mdl", "models/player/group02/male_03.mdl", "models/player/group02/male_04.mdl"}, [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]], {}, "citizen", 0, 45, 0, false, false) TEAM_POLICE = AddExtraTeam("Police Officer", Color(25, 25, 170, 255), "models/player/NYPD/male_07_player.mdl", [[The protector of every citizen that lives in the city . You have the power to arrest criminals and protect innocents. Hit them with your arrest baton to put them in jail. You have a Taser to take them down briefly. The Battering Ram can break down the door of a criminal with a warrant for his/her arrest. Type /wanted <name> to alert the public to this criminal OR go to tab and warrant someone by clicking the warrant button]], {"arrest_stick", "unarrest_stick", "weapon_mad_glock", "Taser", "door_ram", "weaponchecker", "weapon_mad_m3", "item_battery", "item_battery"}, "police", 10, 65, 0, true, true, TEAM_POLICE) TEAM_SWAT = AddExtraTeam("S.W.A.T", Color(25, 25, 200, 255), "models/player/swat.mdl", [[The more higher trained Police. The Special Weapons And Tactics Team must eliminate large groups of criminals. They are specially trained for all types of situations.]], {"weapon_mad_m4", "weapon_mad_charge", "weapon_mad_flash", "weapon_mad_smoke", "weapon_mad_p228", "item_battery", "item_battery", "item_battery", "item_battery"}, "swat", 4, 85, 0, true, true, TEAM_POLICE) TEAM_POLICESNIPER = AddExtraTeam("S.W.A.T Sniper", Color(25, 25, 200, 255), "models/player/swat.mdl", [[The S.W.A.T sniper. With your skills you can take out enemys from long range without being hurt.]], {"weapon_mad_scout"}, "policesniper", 3, 60, 0, true, true, {TEAM_SWAT, TEAM_POLICE}) TEAM_CPPILOT = AddExtraTeam("Police Pilot", Color(25, 25, 150, 255), "models/player/NYPD/male_05_player.mdl", [[The Police Pilot flys the Police around and let's S.W.A.T off at drop off points. You must be able to use a helicopter well.]], {"weapon_mad_p228", "item_battery"}, "policepilot", 2, 70, 0, true, true, {TEAM_SWAT, TEAM_POLICE, TEAM_POLICESNIPER}) TEAM_RGANG = AddExtraTeam("Warriors Gangster", Color(255, 0, 0, 255), "models/player/phoenix.mdl", [[The lowest person of crime. A gangster generally works for the Leader who runs the crime family. The Leader sets your agenda and you follow it or you might be punished.]], {}, "russiangangster", 5, 45, 0, false, false) TEAM_RGANGLEADER = AddExtraTeam("Warriors Leader", Color(255, 0, 0, 255), "models/player/guerilla.mdl", [[The Warriors Leader is a crimboss in the city. With his power he coordinates the gangsters and forms an efficent crime organization.]], {}, "russiangangsterleader", 1, 60, 0, false, false, TEAM_RGANG) TEAM_KINGSGANG = AddExtraTeam("Kings Mobster", Color(243, 227, 13, 255), "models/player/suits/male_07.mdl", [[The lowest person of crime. A mobster generally works for the Leader who runs the crime family. The Leader sets your agenda and you follow it or you might be punished.]], {}, "kingsmobster", 5, 45, 0, false, false) TEAM_KINGSLEADER = AddExtraTeam("Kings Leader", Color(43, 227, 13, 255), "models/player/gman_high.mdl", [[The Kings Leader is a crimboss in the city. With his power he coordinates the mobsters and forms an efficent crime organization.]], {}, "kingsleader", 1, 60, 0, false, false, TEAM_KINGSGANG) TEAM_LONESSGANG = AddExtraTeam("Lone Sharks Mobster", Color(1, 213, 255, 255), "models/player/group03/male_07.mdl", [[The lowest person of crime. A mobster generally works for the Leader who runs the crime family. The Leader sets your agenda and you follow it or you might be punished.]], {}, "lonesharksmobster", 5, 45, 0, false, false) TEAM_LONESLEADER = AddExtraTeam("Lone Sharks Leader", Color(43, 227, 13, 255), "models/player/group03/male_04.mdl", [[The Lone Sharks Leader is a crimboss in the city. With his power he coordinates the mobsters and forms an efficent crime organization.]], {}, "lonesharksleader", 1, 60, 0, false, false, TEAM_LONESSGANG) TEAM_GUN = AddExtraTeam("Gun Dealer", Color(255, 140, 0, 255), "models/player/leet.mdl", [[A gun dealer is the only person who can sell guns to other people. However, make sure you aren't caught selling guns that are illegal to the public. /Buyshipment <name> to Buy a weapon shipment /Buygunlab to Buy a gunlab that spawns P228 pistols]], {}, "gundealer", 2, 45, 0, false, false) TEAM_MEDIC = AddExtraTeam("Pharmisist", Color(47, 79, 79, 255), "models/player/kleiner.mdl", [[With your medical knowledge, you heal players to proper health. Without a Pharmisist, people can not be healed. Left click with the Medical Kit to heal other players. Right click with the Medical Kit to heal yourself.]], {"med_kit"}, "pharmisist", 3, 45, 0, false, false) TEAM_COOK = AddExtraTeam("Chef", Color(238, 99, 99, 255), "models/player/mossman.mdl", [[As a cook, it is your responsibility to feed the other members of your city. You can spawn a microwave and sell the food you make: /Buymicrowave]], {}, "chef", 2, 45, 0, 0, false) TEAM_CARDEALER = AddExtraTeam("Car Dealer", Color(229, 199, 89, 255), "models/player/group01/male_04.mdl", [[The car dealer sells cars to the other citizens. He doesn't sell them to cops.]], {}, "cardealer", 2, 100, 0, false, false) TEAM_CPGUNDEALER = AddExtraTeam("Police Gun Dealer", Color(20, 20, 225, 255), "models/player/NYPD/male_04_player.mdl", [[The Police Gun Dealer supplys Guns to all the Police Officers (but mainly S.W.A.T).]], {"weapon_mad_p228", "item_battery"}, "policegundealer", 1, 80, 0, true, true, {TEAM_POLICE, TEAM_SWAT}) TEAM_CHIEF = AddExtraTeam("Police Chief", Color(20, 20, 255, 255), "models/player/NYPD/male_02_player.mdl", [[The Chief is the leader of the PD. Coordinate the police forces to bring law to the city Hit them with arrest baton to put them in jail Bash them with a stunstick and they might learn better than to disobey the law. The Battering Ram can break down the door of a criminal with a warrant for his/her arrest. Type /wanted <name> to alert the public to this criminal Type /jailpos to set the Jail Position]], {"arrest_stick", "unarrest_s
your code is good, but the models are wrong try to add this to your police team: [lua]TEAM_POLICE = AddExtraTeam("Civil Protection", Color(25, 25, 170, 255), { "models/player/Group01/Female_01.mdl", "models/player/Group01/Female_02.mdl", "models/player/Group01/Female_03.mdl", "models/player/Group01/Female_04.mdl", "models/player/Group01/Female_06.mdl", "models/player/Group01/Female_07.mdl", "models/player/group01/male_01.mdl", "models/player/Group01/Male_02.mdl", "models/player/Group01/male_03.mdl", "models/player/Group01/Male_04.mdl", "models/player/Group01/Male_05.mdl", "models/player/Group01/Male_06.mdl", "models/player/Group01/Male_07.mdl", "models/player/Group01/Male_08.mdl", "models/player/Group01/Male_09.mdl"}, [[The protector of every citizen that lives in the city . You have the power to arrest criminals and protect innocents. Hit them with your arrest baton to put them in jail Bash them with a stunstick and they might learn better than to disobey the law. The Battering Ram can break down the door of a criminal with a warrant for his/her arrest. The Battering Ram can also unfreeze frozen props(if enabled). Type /wanted <name> to alert the public to this criminal OR go to tab and warrant someone by clicking the warrant button]], {"arrest_stick", "unarrest_stick", "weapon_mad_glock", "Taser", "door_ram", "weaponchecker", "weapon_mad_m3", "item_battery", "item_battery"}, "police", 10, 65, 0, true, true, TEAM_POLICE)[/lua]the models aren't cops model but the model selector menu work.
Sorry, you need to Log In to post a reply to this thread.