TActivePlayer.OnKitPickup

From Soldat Community Wiki
Jump to: navigation, search
property OnKitPickup
 Access mode: RW
 Event handler type: TOnKitPickupEvent
 Event handler declaration: procedure(Player: TActivePlayer; Kit: TActiveMapObject)

Description

Event property called whenever a player picks up a kit box. As the name suggests, it is triggered exclusively by picking up TActiveMapObject with Style property ranging from 16 to 22:

Style Description
16 Medical Kit
17 Grenade Kit
18 Flamer Kit
19 Predator Kit
20 Vest Kit
21 Berserker Kit
22 Cluster Kit

Example

Example shows kits Style whenever the event is being triggered.

procedure Info(Player: TActivePlayer; Kit: TActiveMapObject);
begin
	Player.Tell('You triggered an OnKitPickup event! Kit''s Style is '+inttostr(Kit.Style));
end;

var 
	i: integer;

begin
	for i:=1 to 32 do
		Players[i].OnKitPickup := @Info;
end.