Search the Community
Showing results for tags 'team leader'.
Found 1 result
-
Squad leader Respawn almost working !
doomnet posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, how to use these two code together ? i made respawnOnLeader.sqf: if(isDedicated) exitWith {}; _side = side player; waituntil { "respawn_guerrila" setMarkerPosLocal (getPos leader player); "respawn_west" setMarkerPosLocal (getPos leader player); sleep 0.5; 0 > 1 }; i call this file from init.sqf : execVM "respawnOnLeader.sqf"; Then i made groups for exemple Vip group with the leader being AI soldier in Vip base, so only vip players in the same group can respawn in Vip base, that works, also i have a respawn module in normal base so Vip's can choose which base to respawn. But one thing that is not working is for other groups, when they are killed, they respawn where they died. That's not what i want. Other players, non-vip players have to respawn on squad leader (which is human player not AI), that's what normally this code does, but its not working. So i have the other piece of code i found but don't know how to put it together with the other code here above, maybe someone can help me with this ? // Call from init.sqf with: // [] execVM "data\scripts\respawnOnLeader.sqf"; if (not isDedicated) then { [] spawn { waitUntil { alive player }; player addEventHandler ["KILLED", { [] spawn { private ["_leader", "_spawnPos"]; waitUntil { alive player }; _leader = leader player; if ((alive _leader) and (player != _leader)) then { // Move the player just behind the leader, but ensure they arrive on the ground. _spawnPos = (vehicle _leader) modelToWorld [0, -2, 0]; _spawnPos set [2, 0]; // Ensure respawn on the ground. player setPos _spawnPos; }; }; }]; }; }; This code doesn't work at all, but i need the player to respawn behind Team leader and not respawn where he died. Btw why in this code here above it begins with "if (not isDedicated) then {" ? how can i merge these two codes to work together ? so that a player in squad gets killed he will respawn 2 meters behind squad leader, and if Squad Leader is dead then player choose another respwan. ( i use base respawn + menuposition) That is what this code should do but it has no effects. Exemple: //working code ! if(isDedicated) exitWith {}; _side = side player; waituntil { "respawn_guerrila" setMarkerPosLocal (getPos leader player); "respawn_west" setMarkerPosLocal (getPos leader player); sleep 0.5; 0 > 1 }; //not working code but needed ! // Call from init.sqf with: // [] execVM "data\scripts\respawnOnLeader.sqf"; if (not isDedicated) then { [] spawn { waitUntil { alive player }; player addEventHandler ["KILLED", { [] spawn { private ["_leader", "_spawnPos"]; waitUntil { alive player }; _leader = leader player; if ((alive _leader) and (player != _leader)) then { // Move the player just behind the leader, but ensure they arrive on the ground. _spawnPos = (vehicle _leader) modelToWorld [0, -2, 0]; _spawnPos set [2, 0]; // Ensure respawn on the ground. player setPos _spawnPos; }; }; }]; }; }; Ho to merge these script code together ? Is this not working because i use squad leader in place of Team leader unit in my mission ?