whistle 10 Posted January 5, 2014 (edited) Hi guys, I haven't found a good thread that helps me so i made this post... I want to put an addaction on a vehicle that i have created on the server. Here's the code: Whistle_fnc_addActionbomb = { _this addAction ["Defuse bomb", "Defuse.sqf"]; }; if (!isServer) exitwith {}; Whistle_bomb = "Land_Suitcase_F" createvehicle (getmarkerpos _bombspawn); [Whistle_bomb ,"Whistle_fnc_addActionbomb", true, true] spawn BIS_fnc_MP; When I host this mission on a dedicated server and I am playing, the addaction is availabe, but.... When other players join, the addaction isn't shown anymore. Do you guys (i don't mean JIP) have any idea's how i can solve this issue? Thanks in advance!! Edited January 5, 2014 by Whistle Share this post Link to post Share on other sites
tryteyker 28 Posted January 5, 2014 Is the function defined globally? It will not be transferred to clients by fnc_MP, keep that in mind. Refer to this page for more information. I'd try defining the function globally, in init.sqf, like this: BombDef_Action = compileFinal "(_this select 0) addAction ['Defuse bomb','defuse.sqf'];"; Then in your other script use this: if !(isServer) then { breakOut "ServerExecOnly"; //This is really just an alternative for exitWith, use whatever. Make sure there's no scopeName called ServerExecOnly, but that shouldn't be there. }; whistle_bomb = createVehicle ["Land_Suitcase_F",getmarkerpos _bombspawn,[],0,"NONE"]; [whistle_bomb,"BombDef_Action",true,true] call BIS_fnc_MP; As I mentioned before, refer to the wiki page for more info, especially the notes. I'm not great with fnc_MP so don't rely on the above code to work. Share this post Link to post Share on other sites
Johnson11B2P 3 Posted January 5, 2014 (edited) Hi guys,I haven't found a good thread that helps me so i made this post... I want to put an addaction on a vehicle that i have created on the server. Here's the code: Whistle_fnc_addActionbomb = { _this addAction ["Defuse bomb", "Defuse.sqf"]; }; if (!isServer) exitwith {}; Whistle_bomb = "Land_Suitcase_F" createvehicle (getmarkerpos _bombspawn); [Whistle_bomb ,"Whistle_fnc_addActionbomb", true, true] spawn BIS_fnc_MP; When I host this mission on a dedicated server and I am playing, the addaction is availabe, but.... When other players join, the addaction isn't shown anymore. Do you guys (i don't mean JIP) have any idea's how i can solve this issue? Thanks in advance!! Try this. Whistle_bomb = "Land_Suitcase_F" createvehicle (getmarkerpos _bombspawn); [[{Whistle_fnc_addActionbomb = Whistle_bomb addAction [""Defuse bomb", "Defuse.sqf"];}],"BIS_fnc_Spawn",true,true] call BIS_fnc_MP; Or create initPlayerLocal.sqf and put this inside Whistle_fnc_addActionbomb = Whistle_bomb addAction [""Defuse bomb", "Defuse.sqf"]; Edited January 5, 2014 by Johnson11B2P Share this post Link to post Share on other sites