Hello!
My names Devin and this is my first post to FP. Ive been a long time lurker and Ive just started programming a simple game mode in LUA. In my game mode im having two issues. First, I have a classes.lua file that contains data and info for every class in my game mode so far it looks like this.
//classes.lua
//contains tables for all the classes and privilages.
// The first number is the team number the second is the team name as it appears ingame the third is the color of the name in RBG and Alpha Values. The fourth is a CSV of all the weapons the player should get.
local class_citizen={"1, "Citizen", Color( 17, 2, 156, 255 )" }
local class_admin={"2, "Admin", Color( 17, 2, 156, 255 )" }
local class_combine={"3, "Combine", Color( 17, 2, 156, 255 )" }
local class_combine_chief={"4, "Combine Chief", Color( 17, 2, 156, 255 )" }
Now my shared.lua where all the teams get defined for real looks like this.
//shared.lua
include( 'classes.lua' )
GM.Name = "Test Mod"
GM.Author = "Devin"
GM.Email = "N/A"
GM.Website = "N/A"
team.SetUp(class_citizen[1])
team.SetUp(class_admin[1])
team.SetUp(class_combine[1])
team.SetUp(class_combine_chief[1])
Will this work or is there a more efficient way of doing this?
Secondly, I was hoping to also define my player load outs in the same file for example the citizens table would look something like this.
//classes.lua
local class_citizen={"1, "Citizen", Color( 17, 2, 156, 255 )", "weapon_fiveseven, weapon_crowbar"}
And then my loadout would be like normal but i want it to use those values in the table.
ply:Give( class_citizen[2] )
the only problem is that ply:Give only supports one weapon as far as i know. So would i have to use some sort of for loop or something?
Thanks for any help you can give,
Devin
[editline]04:28PM[/editline]
OK whoever marked this as dumb can you explain why? Because this is a simple modular way for me to modify teams and load outs in one file.
Thanks,
Devin
And also sorry for the title its not really descriptive is it?