Home   Help Search Login Register  

Author Topic: Chose which respawn to do  (Read 1675 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
Chose which respawn to do
« on: 19 May 2007, 11:11:52 »
Well for a mission I'm making I want to have the player be able to chose where he wants to respawn without using dialogs.

The way I have currently chosen is either...

1. Before the mission you set a parameter to either 'Base' or 'Body' and that is where you will re spawn in the mission. However I am still rather unsure on how to do this. So what I thought was re spawn the player at base but if he chose to re spawn at body it will just setpos him at his body. But I'm useless at MP Scripting, how would I keep track of his body? How would I know when he has respawned?

2nd choice. Once the player has re spawned at base he is given two actions... One to stay where he is and the other is to move to his body. However have the same problems as the first idea.


I'm not sure how to remember his body or find out when he has re spawned. I am pretty much useless at MP Scripting so as much help as possible would be appreciated.

Thanks.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Chose which respawn to do
« Reply #1 on: 19 May 2007, 11:45:52 »
You may try something like this, execute with []execVM"Trackpayerlastcoords.sqf" in your mission's init.sqs:
Code: [Select]
//Trackpayerlastcoords.sqf
sleep 5;
_playerpos = [0,0,0];
if (!isNull player) then
{
   titleText["Tracking player", "PLAIN DOWN"];
   while {true} do
   {
      waitUntil {!alive player};
      _payerpos = getPos vehicle player;
      titleText[format["Dead body position: %1", _playerpos], "PLAIN DOWN"];     
      waitUntil {alive player};
      titleText["Player is alive again", "PLAIN DOWN"];     
      // Add here code (dialog, for example) so select to keep where player currently is or to switch to _playerpos position
   };
};