Difference between revisions of "TActivePlayer.OnBeforeRespawn"

From Soldat Community Wiki
Jump to: navigation, search
(new page)
 
 
Line 2: Line 2:
 
   Access mode: RW
 
   Access mode: RW
 
   Event handler type: [[TOnBeforeRespawnEvent]]
 
   Event handler type: [[TOnBeforeRespawnEvent]]
   Event handler declaration: function (Player: TActivePlayer): Byte;
+
   Event handler declaration: function (Player: TActivePlayer): TVector;
  
 
==Description==
 
==Description==
Line 8: Line 8:
 
In this event Player.Alive is FALSE (unless he's just joined the server)
 
In this event Player.Alive is FALSE (unless he's just joined the server)
  
 +
== Example ==
 +
<syntaxhighlight lang="pascal">
 +
// Result is the position you want from player to be spawned on, for default player spawns at spawnpoint
 +
function OnBeforeRespawn(Player: TActivePlayer): TVector;
 +
begin
 +
  Result.X := 500;
 +
  Result.Y := 30;
 +
end;
 +
</syntaxhighlight>
  
 
[[Category:TActivePlayer]][[Category:Events]]
 
[[Category:TActivePlayer]][[Category:Events]]

Latest revision as of 22:57, 6 May 2020

property OnBeforeRespawn
 Access mode: RW
 Event handler type: TOnBeforeRespawnEvent
 Event handler declaration: function (Player: TActivePlayer): TVector;

Description

Event property called right before a player has respawned.
In this event Player.Alive is FALSE (unless he's just joined the server)

Example

// Result is the position you want from player to be spawned on, for default player spawns at spawnpoint
function OnBeforeRespawn(Player: TActivePlayer): TVector;
begin
  Result.X := 500;
  Result.Y := 30;
end;