But have a toggel so gms can have more than one?
Anyhelp is greatly appreciated
Code: Select all
use os;
use uo;
function CheckSlots(who);
var CHAR_SLOTS := 5; // Change to however many character slots your 'CharacterSlots=' is set to in servspecopt.cfg
var acct := FindAccount(who.acct);
if(!acct)
return;
endif
var i;
if(!who.cmdlevel)
for(i := 2 to CHAR_SLOTS; i:= i + 1)
if(acct.GetCharacter(i))
acct.DeleteCharacter(i);
endif
endfor
else
for(i := 3 to CHAR_SLOTS; i:= i + 1) // Allowing 2 character slots if character has cmdlevel > 0
if(acct.GetCharacter(i))
acct.DeleteCharacter(i);
endif
endfor
endif
endfunction
Code: Select all
use uo;
use os;
const MAX_CHAR_SLOTS := 2;
function CheckCharLimit(who)
var acct, charSlot, charRef;
var charCnt := 0;
acct := FindAccount(who.acctname);
if(!acct)
return 1;
endif
for( charSlot := 1; charSlot <= 7 ; charSlot:= charSlot + 1 )
charRef := acct.GetCharacter(charSlot);
if( charRef )
charCnt := charCnt + 1;
endif
SleepMs(2);
endfor
if( charCnt > MAX_CHAR_SLOTS )
SendSysMessage(who, "Maximum number of characters per account: "+ MAX_CHAR_SLOTS, 0, 38);
SendSysMessage(who, "Delete additional characters to log in!", 0, 38);
DisconnectClient(who);
endif
return 1;
endfunctionBut still relevant apparently.RusseL wrote:Oh man, this topic is 3 years old... >_<