All pastes #756767 Raw Edit

Meins

public text v1 · immutable
#756767 ·published 2007-10-31 18:50 UTC
rendered paste body
var
	var1,var2,var3: single;
	object_spawn: boolean;
	weapons: Array [1..20] of String;

procedure OnPlayerSpeak(ID: Byte; Text: string);
begin
case LowerCase(GetPiece(Text,' ',0)) of
'!help': 
	begin
		SayToPlayer(ID, 'Available commands:');
		SayToPlayer(ID, '!clock');
		SayToPlayer(ID, '!date');
		SayToPlayer(ID, '!stats');
	end;


'!clock':
	begin
		WriteConsole(0,'Current Server time is '+FormatDate('hh:nn:ss am/pm') + ' (Time zone: Germany)', $00CCFF);
	end;


'!date':
	begin
		WriteConsole(0,'Current Server date is '+FormatDate('dd. mmmm yyyy') + ' (Time zone: Germany)', $00CCFF);
	end;


'!stats': 
	begin
		if(GetPlayerStat(ID,'Deaths') > 0) then 
			begin
				SayToPlayer(ID, 'Score  : '+inttostr(GetPlayerStat(ID,'Kills')));
				SayToPlayer(ID, 'Deaths : '+inttostr(GetPlayerStat(ID,'Deaths')));
				var1:=GetPlayerStat(ID,'Kills');
				var2:=GetPlayerStat(ID,'Deaths');
				var3:=var1/var2;
				SayToPlayer(ID, 'Skill  : '+floattostr(var3));
			end 
			else
			begin
				SayToPlayer(ID, 'Score  : '+inttostr(GetPlayerStat(ID,'Kills')));
				SayToPlayer(ID, 'Deaths : '+inttostr(GetPlayerStat(ID,'Deaths')));
				SayToPlayer(ID, 'Skill  : '+inttostr(GetPlayerStat(ID,'Kills')));
			end;
	end;
	

'/activate_object_spawn':
	begin
		object_spawn:= true;
		SayToPlayer(ID, 'Object spawn is ON.');
	end;
		

'/deactivate_object_spawn':	
	begin
		object_spawn:= false;
		SayToPlayer(ID, 'Object spawn is OFF.');
	end;

'/spawn_object':	
	begin
		if (object_spawn ) then
			begin
				SayToPlayer(ID, 'Please type the specific number of the object, you would like to spawn.');
				SayToPlayer(ID, 'Available objects:');
				SayToPlayer(ID, '');
				SayToPlayer(ID, (ReadFile('objects.txt')));
				case LowerCase(GetPiece(Text,' ',0)) of
				'/1':
					begin
							SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),1);
							SayToPlayer(ID, 'Object spawned :D');
					end;
				'/2':	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),2);
				'/3':	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),3);
				'/4': 	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),4);
				'/5': 	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),5);
				'/6': 	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),6);
				'/7': 	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),7);
				'/8': 	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),8);
				'/9': 	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),9);
				'/10': 	
					SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),10);
				end;
			end
			else 
			begin
				SayToPlayer(ID, 'Object spawn failed!');
			end;
	end;
else // Else-Anweisung vom ganzen Case
begin
	//ElseAnweisungen
end;   
end; //Ende vom Case

end;