creartan 10 Posted December 15, 2014 player setVehicleVarName "newvariablez"; newvariablez = player; //its working, but is it global?; is this Global?? if not how to make it global? maybe some xample of the init function? and why its not working when i use: _varname = vehiclevarname player; _varname setVehicleVarName "newvariablez"; newvariablez = _varname; //its not working; Share this post Link to post Share on other sites
Tankbuster 1747 Posted December 15, 2014 The biki says that you have to execute it on every client, so it's local. You probably have to execute it on the server too. Share this post Link to post Share on other sites
killzone_kid 1332 Posted December 15, 2014 I'm going to post this link again https://community.bistudio.com/wiki/setVehicleVarName Share this post Link to post Share on other sites
creartan 10 Posted December 15, 2014 i already create two function inside INIT, but it still not working. init MP_fnc_changevar = { private["_oldvar","_newvar"]; _oldvar = _this select 0; _newvar = _this select 1; _oldvar setVehicleVarName _newvar; }; //this is the change variable; MP_fnc_changeref = { private["_varold","_varnew"]; _varold = _this select 0; _varnew = _this select 1; _varnew = _varold; }; // this is the reference; inside Script.sqf [[Player,"coolguy"],"MP_fnc_changevar",nil,true] call BIS_fnc_MP; [[Player,coolguy],"MP_fnc_changeref",nil,true] call BIS_fnc_MP; please help, the simple one please. where i did wrong there?? Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted December 15, 2014 Can't you just go: vehicle setVehicleVarName "myVehicle"; publicVariable "myVehicle"; or mycar = createVehicle [cartype,carpos,[],0,"NONE"]; mycar setVehicleVarName "myCarName"; publicVariable "mycar"; ? Share this post Link to post Share on other sites
jshock 513 Posted December 15, 2014 In your BIS_fnc_MP lines, you have the broadcasting parameter set to nil, and your persistence parameter set to true, try setting the broadcast to true and persistence to false. Share this post Link to post Share on other sites
creartan 10 Posted December 15, 2014 still cannot work, have any other alternative? Share this post Link to post Share on other sites
Tajin 349 Posted December 15, 2014 Why don't you simply use myVehicle = vehicle; publicVariable "myVehicle"; ? Share this post Link to post Share on other sites
jshock 513 Posted December 15, 2014 I'm wondering why worry about setting the player's var name, just use player. Share this post Link to post Share on other sites
dreadedentity 278 Posted December 15, 2014 (edited) I don't know why you want to use this command so badly. It doesn't do anything useful EDIT: http://forums.bistudio.com/showthread.php?186608-change-variable-name-Global-how Edited December 15, 2014 by DreadedEntity Share this post Link to post Share on other sites
airfell 12 Posted December 15, 2014 Why don't you simply use myVehicle = vehicle; publicVariable "myVehicle"; ? As Tajin put it, this works. A working example from one of my scripts: west_base = createVehicle [_vehtype, _posMrk, [], 0, "CAN_COLLIDE"]; west_base setPos [_posMrk select 0, _posMrk select 1,0]; west_base setVehicleVarName "west_base"; publicVariable "west_base"; My concern is that you're trying to make it hold a players name, then make that public on your mission's network. Could we get any more info on what you're trying to do? (Perhaps make an addaction available to all players?) Share this post Link to post Share on other sites
creartan 10 Posted December 15, 2014 http://forums.bistudio.com/showthread.php?142594-publicVariable-JIP "Also remember that it doesn't register on the client that publics it." i found it on the thread. is that right? creating some mission, :) Share this post Link to post Share on other sites
jshock 513 Posted December 15, 2014 http://forums.bistudio.com/showthread.php?142594-publicVariable-JIP"Also remember that it doesn't register on the client that publics it." i found it on the thread. is that right? How about the wiki page on publicVariable, instead of a thread almost 800 days old (and from A2 for that matter). creating some mission Really? This doesn't help us, which in turn doesn't allow you to get the information needed to make whatever it is work properly. Share this post Link to post Share on other sites
dreadedentity 278 Posted December 15, 2014 "Also remember that it doesn't register on the client that publics it." Well it doesn't...but you need to store that information in the variable anyway to publicVariable it... Share this post Link to post Share on other sites