Making concommand for Team addon

Hi there, I need help making a simple in-game concommand for the Sandbox Teams addon. I simply want to be able to assign a player (in my case one of my super admins) to a custom Team that already is premade in the LUA. The plugin:

I’ve created a new team called Cookies. And want to assign that to one of my Super admins.

well from what I see you could replace “steamid here” with the player’s steamID and it would work?

Yeah, or thats the problem I’m having. Replacing that with steamID would disable the entire script and make everyone be unassigned.

[lua]elseif ply:HasLevel( ASS_LVL_SUPER_ADMIN ) then
if ply:SteamID() == “SteamID” then
ply:SetTeam(3)
else
ply:SetTeam(5)
end[/lua]

?

[lua]local function FindPlayer(name)
for _,v in ipairs(player.GetAll()) do
if string.match(v:GetName(),name) then return v end
end
end

concommand.Add(“ass_setteam”,function(ply,cmd,args)
if ply:IsAdmin() then
FindPlayer(args[1]):SetTeam(args[2])
end
end)[/lua]

Usage: ass_setteam Entoros 3
Puts me on the cookie team.

thanks! Worked perfectly! :smiley:


EDIT:

Okay, so it worked, but when he dies, the team resets. Can I like create a file where it reads it from SteamID and place it in the data folder? How would I go about doing that? I would like the command to be permanent (i.e stand trough server resets, mapchanges etc.) until I use that command to change his team.

-bump-