FYI the problem was likely that the GUI was being drawn before the profiles were loaded. You can always do something like:
PHP Code:
while (! profilesLoaded) {
sleep(0.05);
}
in weapons that draw profiles at the start (this forces it to wait for the profiles to load). Then when making the profiles, add this to the end of the function:
PHP Code:
profilesLoaded = true;
Otherwise, another option to make sure that the profiles are always made first is to put the GuiControlProfile-creating weapon as the first weapon in 'weaponorder' in server options.