hey guys is there a possiable way to set accounts to only have one character for players
But have a toggel so gms can have more than one?
Anyhelp is greatly appreciated
Character Limits
Moderator: POL Developer
Re: Character Limits
i dont know actually but you can try this
servspecopt.cfg
[CharacterSlots=(int {default 5})]
servspecopt.cfg
[CharacterSlots=(int {default 5})]
Re: Character Limits
Hello xblade,
You could try this small function, call it from your logon.src as soon as client logs on, something like
CheckSlots(who);
I have not tested it, but is should work.
Regards,
Justae.
You could try this small function, call it from your logon.src as soon as client logs on, something like
CheckSlots(who);
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
Regards,
Justae.
Re: Character Limits
servspecopt.cfg CharacterSlots= supports values of 1,5,6,7
Re: Character Limits
Thanks Muchly Justae but i have encounted a few problems or iam doing it wrong.
I use the code you gave me and put it in the Logon.src
And the logon compiled fine , but it dosent limit the characters , ive try heaps of ways to figure this out but then again iam still a newbie when it comes to pol rather than Others including your self who have a better understanding than i do hehehe =P
If you could help me with this it would be Greatly appreciated!
I use the code you gave me and put it in the Logon.src
And the logon compiled fine , but it dosent limit the characters , ive try heaps of ways to figure this out but then again iam still a newbie when it comes to pol rather than Others including your self who have a better understanding than i do hehehe =P
If you could help me with this it would be Greatly appreciated!
Re: Character Limits
An Corp! ;)
Since I was looking for a way to limit characters and since CharacterSlots doesn't support custom values and doesn't even work with older POL releases (I'm working on 095 now :/) here's the code of a simple include file:
Add include "include/account.inc"; and CheckCharLimit(who) in /scripts/misc/logon.src and /scripts/misc/oncreate.src. Hope it comes in handy.
Since I was looking for a way to limit characters and since CharacterSlots doesn't support custom values and doesn't even work with older POL releases (I'm working on 095 now :/) here's the code of a simple include file:
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;
endfunction
Re: Character Limits
Oh man, this topic is 3 years old... >_<
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Character Limits
But still relevant apparently.RusseL wrote:Oh man, this topic is 3 years old... >_<