Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started by: addict on October 14, 2007, 04:08:23 am
-
Hey, I want to make a nick register system +rank but i dont know how.
I dont know how because where the player will register is password? !reg/!login everyone can see that - if anyone know how I can make it please write here
-
Use OnPlayerCommand.
-
I don't think you know enough about programming to be able to do such a thing.
-
I realy dont, but I want to learn :S
Date Posted: October 14, 2007, 05:15:30 am
what command it can be?
-
Use OnPlayerCommand.
-
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/reg ?????' then begin
WriteLn('Thank You For Registering +IDToName('ID'))
WriteLnFile('regnicks.txt',+IDToName('ID'));
end;
--
its ok?
-
You need learn some basics.
-
Yeah, I would do something smaller than what ur trying right now if you don't know about either of these:
Copy(Text: string; Beg, End: byte): string; -- it gets part of text that starts at the Beg, and ending at End, and getting everything between those two (including those two)
GetPiece(Text, Space: string; In: byte): string; -- (the http://www.enesce.com/help/html/Functions/GetPiece.html is down.. but it might b up by the time u read this) -- Inside Text, it separates it into an array by splitting between each Space, and then resulting the In'th in the array.. if that makes sense.. horrible wording :P)
Examples:
Copy('blarg',2,4): 'lar';
GetPiece('this is test',' ',0): 'this';
GetPiece('this is test',' ',1): 'is';
GetPiece('this is test',' ',2): 'test';
-
function OnPlayerCommand(ID: Byte; Text: string):boolean;
var
Temp: array[1..5] of string; //I've arrayed 1 variable to make 5 new variables!
begin
Result:=false; //script needs this to recognise command (I think)
Temp[1]:=GetPiece(LowerCase(Text), ' ', 0); //used first Temp... this is the command part
Temp[2]:=GetPiece(LowerCase(Text), ' ', 1); //second Temp... this is a part after command part
if Temp[1] = '/reg' then begin
*do stuff (I don't know how to make register stuff)*
end;
end;
not much registering in mine :P I can't do that kinda stuff...