Results 1 to 10 of 10

Thread: Spawn in height

  1. #1

    Spawn in height

    hi im looking to fix this script
    its a berzerk map with one town called church

    the point is the church is in altitude 20 and i would like
    player can respawn at this altitude...

    this is the script for respawn at town

    Code:
    Func_Server_SpawnVehiclesAtCheckPoint=
    {
    	private ["_i","_vehicle","_TypeOfVehicle","_VehicleVarName","_MarkerTask","_SpawnPos","_SpawnDir","_TimeToStayIdle","_VehicleSpawnClass","_debug","_TypeOfVehicle","_RespawnType","_MarkerTaskColor","_StoredMarkerColor","_CPOwnerNotChanged","_time","_VehiclesArray","_SideVehicleData","_VehicleDataArrayIndex"];
    	_vehicle=_this select 0;
    	_VehicleSpawnClass=_this select 1;
    	_TimeToStayIdle=_this select 2;
    	_MarkerTask=_this select 3;
    	_VehicleVarName=vehicleVarName _vehicle;
    	_TypeOfVehicle=typeOf(_vehicle);
    	_SpawnPos=getPos _vehicle;
    	_SpawnDir=getDir _vehicle;
    	_debug="Skoda";
    	_RespawnType=_debug;
    	_MarkerTaskColor="Default";
    	_StoredMarkerColor=_MarkerTaskColor;
    	_CPOwnerNotChanged=false;
    	_time=0;
    
    		_VehiclesArray=[];
    	for[{_i=0},{_i<=Config_DiplomacyMode},{_i=_i+1}] do
    	{
    		_SideVehicleData=(Config_TotalSideData select _i)select 11;
    		_VehicleDataArrayIndex=[_SideVehicleData,_VehicleSpawnClass] call Func_Common_FindItemInArray;
    		if(_VehicleDataArrayIndex>-1)then
    		{
    			_VehiclesArray set [_i,_SideVehicleData select _VehicleDataArrayIndex];
    		}
    		else
    		{
    			_VehiclesArray set [_i,["","Skoda","",0,0,-1]];
    		};
    	};
    	sleep random(10);
    	_vehicle setDir(_SpawnDir+180);
    	sleep 10;
    	while{!Global_GameEnded}do
    	{
    		if(isNull _vehicle&&!_CPOwnerNotChanged)then
    		{
    			_vehicle=_TypeOfVehicle createVehicle _SpawnPos;
    			_vehicle setVehicleVarName _VehicleVarName;
    			_vehicle call compile format ["%1=_this;publicVariable ""%1""",_VehicleVarName];
    			_vehicle setVariable ["server",true];
    			_vehicle setPos _SpawnPos;
    			_vehicle setDir(_SpawnDir+180);
    		};
    		_vehicle setVariable ["status",-1,true];
    		_CPOwnerNotChanged=true; 
    		if(_MarkerTaskColor!=_StoredMarkerColor)then
    		{ 
    			_CPOwnerNotChanged=false;
    		}; 
    		_MarkerTaskColor=markerColor _MarkerTask; 
    		while{!Global_GameEnded&&_MarkerTaskColor in ["Default","ColorYellow"]}do
    		{
    			_CPOwnerNotChanged=false;sleep 1;
    			_MarkerTaskColor=markerColor _MarkerTask;
    		};
    		_StoredMarkerColor=_MarkerTaskColor;
    		_time=serverTime;
    		if(!_CPOwnerNotChanged)then
    		{
    			_time=serverTime+_TimeToStayIdle;
    			_vehicle setVariable ["status",round(_time),true];
    		};
    		while{!Global_GameEnded&&_StoredMarkerColor==_MarkerTaskColor&&_time>serverTime}do
    		{
    			sleep 1;
    			_MarkerTaskColor=markerColor _MarkerTask;
    		};
    		if(!Global_GameEnded&&_StoredMarkerColor==_MarkerTaskColor)then
    		{
    			deleteVehicle _vehicle;
    			_vehicle=objNull;
    			_RespawnType=switch(_MarkerTaskColor)do
    			{
    				case "ColorRed":
    				{
    					_VehiclesArray select 0
    				};
    				case "ColorBlue":
    				{
    					_VehiclesArray select 1
    				};
    				case "ColorPurple":
    				{
    					_VehiclesArray select 2
    				};
    				default{_debug};
    			};
    			[objNull,_RespawnType select 1,_VehicleVarName,_SpawnPos,_SpawnDir,0,_TimeToStayIdle,_TimeToStayIdle,_RespawnType select 5,true] call Func_Server_PrepareVehicle;
    		};
    	};
    };
    if you can help me to set the spawn at 20meter altitude please
    Last edited by Lt.Poutine; Aug 2 2010 at 12:40.

  2. #2
    Hi,

    Just put the following in the units init line:

    this setPos [getPos this select 0, getPos this select 1, 20];
    _neo_
    Proud community admin/member of The Tour of Teamrespawn

  3. #3
    Lance Corporal
    Join Date
    Jan 4 2005
    Location
    FRANCE
    Posts
    45
    Author of the Thread
    Quote Originally Posted by neokika View Post
    Hi,

    Just put the following in the units init line:



    _neo_
    your answer is correct for an "object" but this is berzerk map and there is 64 players by side with respawn east and west on ground floor they must take the town "church" wich is at altitude 20 if the town taked and played got killed he can respawn at "church" but in my case we have to configure the spawn from church...

  4. #4

  5. #5
    Lance Corporal
    Join Date
    Jan 4 2005
    Location
    FRANCE
    Posts
    45
    Author of the Thread
    thx Kylania for searching

    but my question is (because im not good at scripting) how can i fix it on the part of script thats you can see on "spoiler"

  6. #6
    You don't have to, just move the respawn_west marker up 20m

  7. #7
    @Lt.Poutine: You should also put code within a code tag. Keeps the indenting making it easier to read.

    @kylania: Markers can be set at an elevation? I really didn't know that
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  8. #8
    Lance Corporal
    Join Date
    Jan 4 2005
    Location
    FRANCE
    Posts
    45
    Author of the Thread
    respawn_west ???

    have you read the post or.....
    im talking about "Func_Server_SpawnVehiclesAtCheckPoint" where did you read respawn_west.............

  9. #9
    Lance Corporal
    Join Date
    Jan 4 2005
    Location
    FRANCE
    Posts
    45
    Author of the Thread
    @CarlGustaffa
    ok i thought will be better with spolier...

    @kylania
    marker up 20m!!! yes its work great only if you want to crash the game

  10. #10
    Quote Originally Posted by CarlGustaffa View Post
    @Lt.Poutine: You should also put code within a code tag. Keeps the indenting making it easier to read.

    @kylania: Markers can be set at an elevation? I really didn't know that
    No, markers have a 2D position.

    _neo_

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •