Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 16th, 2010 | Syntax: Lua | Size: 3.39 KB | Hits: 29 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. RPExtraTeams = {}
  2. function AddExtraTeam( Name, color, model, Description, Weapons, command, maximum_amount_of_this_class, Salary, admin, Vote, Haslicense, NeedToChangeFrom)
  3.         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
  4.                 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)
  5.                 print(text)
  6.                 hook.Add("PlayerSpawn", "TeamError", function(ply)
  7.                         if ply:IsAdmin() then ply:ChatPrint("WARNING: "..text) end
  8.                 end)   
  9.         end
  10.         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}
  11.         table.insert(RPExtraTeams, CustomTeam)
  12.         team.SetUp(#RPExtraTeams, Name, color)
  13.         local Team = #RPExtraTeams
  14.         if SERVER then
  15.                 timer.Simple(0.1, function(CustomTeam) AddTeamCommands(CustomTeam) end, CustomTeam)
  16.         end
  17.         return Team
  18. end
  19.  
  20. hook.Add("InitPostEntity", "AddTeams", function()
  21.         if file.Exists("CustomTeams.txt") then
  22.                 RunString(file.Read("CustomTeams.txt"))
  23.                 if SERVER then resource.AddFile("data/CustomTeams.txt") end
  24.                 if CLIENT and not LocalPlayer():IsSuperAdmin() then file.Delete("CustomTeams.txt") end
  25.         end
  26. end)
  27.  
  28. /*--------------------------------------------------------
  29. Default teams. If you make a team above the citizen team, people will spawn with that team!
  30. --------------------------------------------------------*/
  31. */
  32.  
  33. /*
  34. --------------------------------------------------------
  35. HOW TO MAKE AN EXTRA CLASS!!!!
  36. --------------------------------------------------------
  37.  
  38. You can make extra classes here. Set everything up here and the rest will be done for you! no more editing 100 files without knowing what you're doing!!!
  39. Ok here's how:
  40.  
  41. To make an extra class do this:
  42. AddExtraTeam( "<NAME OF THE CLASS>", Color(<red>, <Green>, <blue>, 255), "<Player model>" , [[<the description(it can have enters)>]], { "<first extra weapon>","<second extra weapon>", etc...}, "<chat command to become it(WITHOUT THE /!)>", <maximum amount of this team> <the salary he gets>, 0/1/2 = public /admin only / superadmin only, <1/0/true/false Do you have to vote to become it>,  true/false DOES THIS TEAM HAVE A GUN LICENSE?, TEAM: Which team you need to be to become this team)
  43.  
  44. The real example is here: it's the Hobo:                */
  45.  
  46. --VAR without /!!!                      The name    the color(what you see in tab)                   the player model                                   The description
  47. TEAM_HOBO = AddExtraTeam("Hobo", Color(80, 45, 0, 255), "models/player/corpse1.mdl", [[The lowest member of society. All people see you laugh.
  48. You have no home.
  49. Beg for your food and money
  50. Sing for everyone who passes to get money
  51. Make your own wooden home somewhere in a corner or
  52. outside someone else's door]], {"weapon_bugbait"}, "hobo", 5, 0, 0, false)
  53. //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
  54. // MAKE SURE THAT THERE IS NO / IN THE TEAM NAME OR IN THE TEAM COMMAND:
  55. // TEAM_/DUDE IS WROOOOOONG !!!!!!
  56. // HAVING "/dude" IN THE COMMAND FIELD IS WROOOOOOOONG!!!!
  57. //ADD TEAMS UNDER THIS LINE: