0 Members and 1 Guest are viewing this topic.
Code: [Select]procedure OnJoinGame(ID,Team:byte);begin procedure WriteConsole(ID:Byte;Text:String;Colour:Longint); then begin WriteConsole(ID,'Hello, this server is scripted.'; $FFFFFFFF); WriteConsole(ID,'You can choose out of 4 classes.'; $FFFFFFFF); WriteConsole(ID,'For further information type !help.'; $FFFFFFFF); end; end;
procedure OnJoinGame(ID,Team:byte);begin procedure WriteConsole(ID:Byte;Text:String;Colour:Longint); then begin WriteConsole(ID,'Hello, this server is scripted.'; $FFFFFFFF); WriteConsole(ID,'You can choose out of 4 classes.'; $FFFFFFFF); WriteConsole(ID,'For further information type !help.'; $FFFFFFFF); end; end;
procedure OnJoinGame(ID,Team:byte);begin procedure WriteConsole(ID:Byte;Text:String;Colour:Longint); begin WriteConsole(ID,'Hello, this server is scripted.', $FFFFFFFF); WriteConsole(ID,'You can choose out of 4 classes.', $FFFFFFFF); WriteConsole(ID,'For further information type !help.', $FFFFFFFF); end; end;
procedure OnJoinGame(ID, Team: byte);begin WriteConsole(ID, 'Hello, this server is scripted.', $FFFFFFFF); WriteConsole(ID, 'You can choose out of 4 classes.', $FFFFFFFF); WriteConsole(ID, 'For further information type !help.', $FFFFFFFF);end;
// Declare the typetype TPlayer = Record Task: byte; // I used task instead of Class because Class is a reserved word :/ end;// Now create an array, one index slot for each playervar Player: Array [1..32] of TPlayer;// Looks like that when you use it:procedure SetTask(ID, Task: byte);begin Player[ID].Task := Task;end;
procedure OnJoinGame(ID,Team:byte);begin SayToPlayer(ID,' Text'); SayToPlayer(ID,'Text');end;
procedure OnPlayerSpeak(ID:Byte;Text:String);begin if(Text='!help') then begin WriteConsole('/say ', $FFFFFFF); WriteConsole('/say ', $FFFFFFF); end;
procedure OnJoinGame(ID,Team:byte);begin WriteConsole(ID,'Welcome to my server',$EE81FAA1); WriteConsole(ID,'Welcome text here !!!!!!,$EE81FAA1);end;
WriteConsole(ID: byte; Text: string; Color: longint);
Command('/say Hello World');
Code: [Select]procedure OnJoinGame(ID, Team: byte);begin WriteConsole(ID, 'Hello, this server is scripted.', $FFFFFFFF); WriteConsole(ID, 'You can choose out of 4 classes.', $FFFFFFFF); WriteConsole(ID, 'For further information type !help.', $FFFFFFFF);end;
procedure OnPlayerSpeak(ID:Byte;Text:String);begin if(Text='!help') then begin WriteConsole(ID,'Hmmm sorry but...',$EE81FAA1); WriteConsole(ID,'THERE IS NO HELP FOR THIS SERVER',$EE81FAA1); end;
10-04-05 21:09:48 [*] Compiling Knife Server -> KnifeServer.pas...10-04-05 21:09:48 [*] Knife Server -> [Error] (33:10): Identifier expected10-04-05 21:09:48 [*] Compilation Failed.10-04-05 21:09:48 Shutting down server...
procedure OnPlayerSpeak(ID:Byte;Text:String);begin if(Text='!help') then begin WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); end;
Command('/say TEXT HERE');
WriteConsole(ID,'TEXT HERE',$EE81FAA1);
Code: [Select]procedure OnPlayerSpeak(ID:Byte;Text:String);begin if(Text='!help') then begin WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); WriteConsole(0,'/say ', $FFFFFFF); end;
Am I really that dumb?
procedure OnPlayerSpeak(ID: Byte,Text: String);if(Text=' ') then WriteConsole(ID,' ', $FFFFFFFF); WriteConsole(ID,' ', $FFFFFFFF); [...]if(Text=' ') then WriteConsole(ID,' ', $FFFFFFFF); WriteConsole(ID,' ', $FFFFFFFF);[...]end;
(...)WriteConsole(0,'Hello Players1', $FFFFFFFF);if execute then WriteConsole(0,'Hello Players2', $FFFFFFFF);WriteConsole(0,'Hello Players3', $FFFFFFFF);WriteConsole(0,'Hello Players4', $FFFFFFFF);(...)
(...)WriteConsole(0,'Hello Players1', $FFFFFFFF);if execute then begin WriteConsole(0,'Hello Players2', $FFFFFFFF); WriteConsole(0,'Hello Players3', $FFFFFFFF);endWriteConsole(0,'Hello Players4', $FFFFFFFF);(...)
procedure OnPlayerSpeak(ID:Byte;Text:String); begin if(Text='!help') then WriteConsole(0,' ###################Commands#####################', $FFFFFFF); WriteConsole(0,'##!Classes: Will show you the different classes ##', $FFFFFFF); WriteConsole(0,'## that you are able to choose. ##', $FFFFFFF); WriteConsole(0,'##!Rules: Will show you the rules. ##', $FFFFFFF); WriteConsole(0,'##!Credits: Will show you the credits. ##', $FFFFFFF); WriteConsole(0,' ################################################', $FFFFFFF); end;
procedure OnPlayerSpeak(ID:Byte;Text:String);begin if Text = '!help' then begin // You need a begin here so it displays all that text when a player types !help WriteConsole(0,' ###################Commands#####################', $FFFFFFF); WriteConsole(0,'##!Classes: Will show you the different classes ##', $FFFFFFF); WriteConsole(0,'## that you are able to choose. ##', $FFFFFFF); WriteConsole(0,'##!Rules: Will show you the rules. ##', $FFFFFFF); WriteConsole(0,'##!Credits: Will show you the credits. ##', $FFFFFFF); WriteConsole(0,' ################################################', $FFFFFFF); end; // If you want to add more "! commands" add one more // if Text = '!cmd' then begin // ... things shall be executed when someone typed !cmd // end;end;
if Text='!Help' OR Text='!help' then begin[...]end;
10-04-09 21:37:51 [*] Compiling Knife Server -> KnifeServer.pas...10-04-09 21:37:51 [*] Knife Server -> [Error] (19:28): Type mismatch10-04-09 21:37:51 [*] Compilation Failed.10-04-09 21:37:51 Shutting down server...