Beerkan 71 Posted April 29, 2013 I'm not sure if this is a SP or MP issue. Basically I want each player in MP to be only to run this action once. in the init of the unit I have player addaction ["Spawn Quad Bike","scripts\spawn_quad.sqf"]; spawn_quad.sqf private ["_unit", "_quad"]; _unit = this select 0; _quad ="B_Quadbike_F" createVehicle (position _unit); _unit removeAction 0; The above doesn't work. I does if I substitute "_unit" with "player". But I need it to run separately for each player in MP. Do I need the variables to be private? If so, how do I ensure the script only runs for the player that called it? Share this post Link to post Share on other sites
Radioman 6 Posted April 29, 2013 I'm not sure if this is a SP or MP issue.Basically I want each player in MP to be only to run this action once. in the init of the unit I have player addaction ["Spawn Quad Bike","scripts\spawn_quad.sqf"]; spawn_quad.sqf private ["_unit", "_quad"]; _unit = this select 0; _quad ="B_Quadbike_F" createVehicle (position _unit); _unit removeAction 0; The above doesn't work. I does if I substitute "_unit" with "player". But I need it to run separately for each player in MP. Do I need the variables to be private? If so, how do I ensure the script only runs for the player that called it? _this Share this post Link to post Share on other sites
mikie boy 18 Posted April 29, 2013 unfortunately you need to use the new BIS_fnc_mp to execute the function on each client - by function you will have to make an addaction function. Share this post Link to post Share on other sites
Radioman 6 Posted April 30, 2013 unfortunately you need to use the new BIS_fnc_mp to execute the function on each client - by function you will have to make an addaction function. He doesn't need fnc_mp, he's not running it as an event, it's just a thing everyone has, so the init.sqf is fine. Share this post Link to post Share on other sites
zuff 10 Posted April 30, 2013 At the top of your spawn_squad.sqf: private ["_unit", "_id", "_quad"]; _unit = _this select 1; _id = _this select 2; _unit removeAction _id; _quad ="B_Quadbike_F" createVehicle (position _unit); Share this post Link to post Share on other sites
mikie boy 18 Posted April 30, 2013 My bad didnt read the player bit lol. Sorry thought u were attaching it to a game object Share this post Link to post Share on other sites