GhostJumperHD
Member-
Content Count
4 -
Joined
-
Last visited
-
Medals
Community Reputation
0 NeutralAbout GhostJumperHD
-
Rank
Rookie
-
Calling functions when Player respawns
GhostJumperHD replied to GhostJumperHD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thx. Got it working. :) player setVariable["spawnPos", getPos player]; player setVariable["telePos", getPos player]; player addAction["<t color='#59b300'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal;}]; player addAction["<t color='#d9006c'>Go to Spawn</t>", {player setPos ( player getVariable "spawnPos" );}]; player addAction["<t color='#bfff00'>Teleport</t>", {player setPos ( player getVariable "telePos" );}]; player addAction["<t color='#4cffff'>set Teleport</t>", {player setVariable["telePos", getPos player];}]; player addAction["<t color='#0080ff'>Teleport with Map</t>", "teleport.sqf"]; //Enable Bullet Trace player addAction["<t color='#0080ff'>Enable Bullet Trace</t>", {[player, 3] spawn BIS_fnc_traceBullets;}]; //Disable Bullet Trace (will reduce paths by 1 with every time used) player addAction["<t color='#0080ff'>Disable Bullet Trace</t>", {BIS_tracedShooter = nil;}]; The only thing not working correctly is the Bullet Traces. As i read "Can only be used on one shooter in a single instance.". So I added the function to disable them when you die. But each time you die and/or disable it, it decreases the Bullet Traces by 1. Do you have an idea on how to go about that problem? -
Calling functions when Player respawns
GhostJumperHD replied to GhostJumperHD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Got the fix for teleportation by making local vars. _spawnPos=getPos player; _telePos=getPos player; profileNamespace setVariable ["spawnPos",_spawnPos]; profileNamespace setVariable ["telePos",_telePos]; saveProfileNamespace; [player, 3] call BIS_fnc_traceBullets; player addAction["<t color='#59b300'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal;}]; player addAction["<t color='#d9006c'>Go to Spawn</t>", {_temp = profileNamespace getVariable "spawnPos"; player setPos _temp;}]; player addAction["<t color='#bfff00'>Teleport</t>", {_temp = profileNamespace getVariable "telePos"; player setPos _temp;}]; player addAction["<t color='#4cffff'>set Teleport</t>", {telePos=getPos player;}]; player addAction["<t color='#0080ff'>Teleport with Map</t>", "teleport.sqf"]; The execution at respawn was dealt with after making a "onPlayerRespawn.sqf" with: _nul = []execVM "myFunction.sqf"; The only thing not working is the bullet traces after respawn. -
Calling functions when Player respawns
GhostJumperHD replied to GhostJumperHD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This seems to make the script execute: _spawnPos=getPos player; _telePos=getPos player; [player, 3] call BIS_fnc_traceBullets; player addAction["<t color='#59b300'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal;}]; player addAction["<t color='#d9006c'>Go to Spawn</t>", {player setPos _spawnPos;}]; player addAction["<t color='#bfff00'>Teleport</t>", {player setPos _telePos;}]; player addAction["<t color='#4cffff'>set Teleport</t>", {telePos=getPos player;}]; player addAction["<t color='#0080ff'>Teleport with Map</t>", "teleport.sqf"]; But the teleportation position is not saved in a var. And the traceBullet function doesnt seem to work either. -
GhostJumperHD started following Calling functions when Player respawns
-
Calling functions when Player respawns
GhostJumperHD posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So I have made "script" for myself that I put in the Player Init. This only executes once. But I want it to execute every time I spawn/respawn (so everytime the player starts existing). The script works great if I put it in the Init of the Player. But i wanted to make a .sqf file I could call/execute so I wont have to put everything in every Player. But the scipt is not working/compiling. The code I put in to the Init: varPlayer=this; spawnPos=getPos varPlayer; telePos=getPos varPlayer; [varPlayer, 3] call BIS_fnc_traceBullets; varPlayer addAction["<t color='#59b300'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal;}]; varPlayer addAction["<t color='#d9006c'>Go to Spawn</t>", {varPlayer setPos spawnPos;}]; varPlayer addAction["<t color='#bfff00'>Teleport</t>", {varPlayer setPos telePos;}]; varPlayer addAction["<t color='#4cffff'>set Teleport</t>", {telePos=getPos varPlayer;}]; varPlayer addAction["<t color='#0080ff'>Teleport with Map</t>", "teleport.sqf"]; The code I put in to the .sqf: _spawnPos=getPos _this; _telePos=getPos _this; [_this, 3] call BIS_fnc_traceBullets; _this addAction["<t color='#59b300'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal;}]; _this addAction["<t color='#d9006c'>Go to Spawn</t>", {_this setPos _spawnPos;}]; _this addAction["<t color='#bfff00'>Teleport</t>", {_this setPos _telePos;}]; _this addAction["<t color='#4cffff'>set Teleport</t>", {telePos=getPos _this;}]; _this addAction["<t color='#0080ff'>Teleport with Map</t>", "teleport.sqf"]; How I called it in the Init: _nul = []execVM "myFunction.sqf"; It wont run, but why? So for short. What i need help with is: finding the problem with the sqf executing the sqf every time the player starts existing Thx for reading my crap and I hope you can help me. :)