Michael Marsh 0 Posted September 30, 2019 Hello, I am making a sector control game from scratch, and it works very well. I decided to add respawn points to capped sectors, which works when sector capped initially, but there is a problem with the removal when another team caps it. if (respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition};respawnalpha = [west,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition}; if (respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition};respawnalpha = [east,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition}; The above code, checks to see if the spawn point exists, if not then it creates it (which works fine). If it is already created it then should remove it, this is the bit not working. I get the error expected number, string, array not a file and the original respawn point remains. If anyone could help I would be grateful. Share this post Link to post Share on other sites
cb65 86 Posted September 30, 2019 26 minutes ago, Michael Marsh said: if (respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition};respawnalpha = [west,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition}; if (respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition};respawnalpha = [east,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition}; Try. if (respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition;respawnalpha = [west,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition;}; if (respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition;respawnalpha = [east,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition;}; Share this post Link to post Share on other sites
Michael Marsh 0 Posted September 30, 2019 That cannot work, since a respawn point has not yet been created until addrespawnposition has been run, so respawnalpha will always be 0. Share this post Link to post Share on other sites
cb65 86 Posted September 30, 2019 27 minutes ago, Michael Marsh said: That cannot work, since a respawn point has not yet been created until addrespawnposition has been run, so respawnalpha will always be 0. Try this. if (!isNull respawnalpha && respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition;} else {respawnalpha = [west,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition;}; Or. if (!isNull respawnalpha && respawnalpha != 0) then {respawnalpha call BIS_fnc_removeRespawnPosition;respawnalpha = [west,alpha,"ALPHA"] call BIS_fnc_addRespawnPosition;}; Share this post Link to post Share on other sites
Michael Marsh 0 Posted September 30, 2019 Hi thanks for your help, I have been trying everything all day and finally managed to make it work with markers instead. deleteMarker "respawn_east1"; _marker2 = createMarker ["respawn_west1", flagalpha]; Share this post Link to post Share on other sites