Macrosoft
2007-10-14 11:53:02
Well, I have decided to post this procedure in this section as well as the SRL Members section because I want more people to use it!
This is the thread in the "SRL New Functions" section (SRL Members only):
Procedure SetUserNicks(Active: Boolean);
This procedure sets the user nicks for you! If "active" is false, the characters in which nicks can not be made from their usernames(ex: la la la), will become non-active (Players[].Active:=False). If "active" is true, they will remain active, even if a nick name can not be created.
I dont know if this has already been made, so let me no if it has.
Feel free to use this but remember to Credit Me!
Give Me Feedback!
This is the thread in the "SRL New Functions" section (SRL Members only):
Procedure SetUserNicks(Active: Boolean);
This procedure sets the user nicks for you! If "active" is false, the characters in which nicks can not be made from their usernames(ex: la la la), will become non-active (Players[].Active:=False). If "active" is true, they will remain active, even if a nick name can not be created.
I dont know if this has already been made, so let me no if it has.
{*******************************************************************************
Procedure SetUserNicks(Active: Boolean);
By: Macrosoft
Description: Will set the nickname for all the players in your script. If Active is set as false,
then if a player's username cannot be used to make a nickname, the player will become not active.
*******************************************************************************}
Procedure SetUserNicks(Active: Boolean);
var
counter: integer;
n, a, x, NameLength: integer;
cName: array of char;
nName: array[0..2] of char;
begin
a:=GetArrayLength(Players);
for n:= 0 to a-1 do
begin
Counter:=2;
x:=0
NameLength:=Length(Players[n].Name);
SetArrayLength(cName, NameLength + 1);
repeat
begin
cName[Counter-1]:=StrGet(Players[n].Name, Counter);
if(cName[Counter-1] = ' ')then
begin
x:=0;
Counter:=Counter+1;
end else
begin
nName[x]:=cName[Counter-1];
x:=x+1;
end;
Counter:=Counter+1;
end;
until(Counter=NameLength + 2) or (x=3);
if(Counter=NameLength + 2)then
begin
writeln('Nickname can not be made from the username: ' + Players[n].Name);
if(Active=False) then
begin
writeln(Players[n].Name + ' is no longer active');
Players[n].Active:=False;
end;
end else
begin
Players[n].Nick:= nName[0] + nName[1] + nName[2];
writeln(Players[n].Name +#39+ 's nickname has been set to: ' + Players[n].Nick);
end;
end;
end;
Feel free to use this but remember to Credit Me!
Give Me Feedback!