table.insert(settings.profile.friends, "Ogest");
I used to use this function a long time ago to add and remove names from the "mobs" options, I just adapted it to friends. Have a play with it if you want.
It's very basic but works =)
Code: Select all
function changeProfileNames(_type,_first,_second)
--examples changeOptionNames("mobs","Wolf Cub","Young Bear")
-- changeOptionNames("friends","Ogest","")
-- changeOptionNames("mobs","Wolf Cub")
-- changeOptionNames("friends") -- removes all names from friends
if _type == "mob" then _type = "mobs" end
if _type == "friend" then _type = "friends" end
if _type ~= "mobs" and _type ~= "friends" then
printf("Please specify either friend or mob in the first argument.\n")
end
if( _first ) then name = trim(_first);
end;
if( _second ) then name = trim(_second);
end;
if _type == "mobs" then
if _first ~= "" and _second ~= "" then
table.insert(settings.profile.mobs, _first);
table.insert(settings.profile.mobs, _second);
end
if _first ~= "" and _second == "" then table.insert(settings.profile.mobs, _first);
end
if _first == "" then table.insert(settings.profile.mobs, "");
end
end
if _type == "friends" then
if _first ~= "" and _second ~= "" then
table.insert(settings.profile.friends, _first);
table.insert(settings.profile.friends, _second);
end
if _first ~= "" and _second == "" then table.insert(settings.profile.friends, _first);
end
if _first == "" then table.insert(settings.profile.friends, "");
end
end
end