0 Members and 1 Guest are viewing this topic.
/maxnamelength X
var MaxLength: byte;procedure ActivateServer();begin MaxLength:=strtoint(ReadINI('NameRestriction.ini','Settings','Maximum_Name_Length','20'));end;function OnCommand(ID: Byte; Text: string): boolean;begin If copy(text,1,15) = '/maxnamelength ' then begin MaxLength:=strtoint(GetPiece(text,' ',1)); If ID = 255 then WriteLn('Maximum name length succesfully set to ' + inttostr(MaxLength)) else WriteConsole(ID,'Maximum name length succesfully set to ' + inttostr(MaxLength),$90C2A0); end; result:=false;end;procedure OnJoinTeam(ID, Team: byte);begin WriteConsole(ID,'This server runs the Namelength Restriction script by Avarax.',$90C2A0); WriteConsole(ID,'Maximum name length: ' + inttostr(MaxLength) + ' characters...',$90C2A0); If Length(GetPlayerStat(ID,'Name')) > MaxLength then begin WriteConsole(ID,'...your name is too long, please change it.',$90C2A0); DrawText(ID,'Your name is too long, please change it.',500,$90C2A0,0.075,20,320); KickPlayer(ID); end else WriteConsole(ID,'...name approved, have fun!',$90C2A0);end;