creartan 10 Posted December 14, 2014 MPeventhandler _this addMPEventHandler ["MPRespawn","(_this select 0) execVM 'respawnscript.sqf'"]; respawnscript.sqf <<- problem is here; it seems it cannot do the variable check? "if (_this == variablezz)" or what is the right way to do? if (_this == variablezz) then { _this execVM "gearscript.sqf"; }; error.. gearscript.sqf removeallweapons _this; etc.. ---------- Post added at 05:46 ---------- Previous post was at 05:35 ---------- oh my.. is our variable transfered to the new unit, or not? Share this post Link to post Share on other sites
jshock 513 Posted December 14, 2014 What is variablezz defined as? Share this post Link to post Share on other sites
iceman77 19 Posted December 14, 2014 I guess? If variablezz is the unit the Eh is assigned to.. Share this post Link to post Share on other sites
creartan 10 Posted December 14, 2014 variablezz is the variable name tobe checked to the unit, i want to check _this is, _this variable name is variablezz. if (_this == variablezz) then.. if (_this == variableaa) then.. Share this post Link to post Share on other sites
jshock 513 Posted December 14, 2014 I would think that it should work, but you may still need to wait until the var name isn't null before using it (but that shouldn't be the case). Another thing to try is the isEqualTo command in place of the "==", not sure if that would solve it, but it's more effecient anyhow :p. You could also try a standard Respawn EH as well (I've personally never used the MP respawn EH). Share this post Link to post Share on other sites
creartan 10 Posted December 14, 2014 ohya the basic knowledge, is the variablename of the OLD unit get transfered to the NEW unit? MPrespawn and respawn will it effect in multiplayer? because im creating this for multiplayer Share this post Link to post Share on other sites
jshock 513 Posted December 14, 2014 I do believe it does, but that variable name is null until that unit is respawned(after death of course), so I think it's just dependent on when the EH fires, before or after the new unit's variable name is intialized. Share this post Link to post Share on other sites
creartan 10 Posted December 14, 2014 i just make a trial error, and i think the variable is left to the old unit, but im not sure maybe until the old unit get deleted by deletevehicle this; and how to prevent the creation of the new unit? and the this setVariable ["BIS_enableRandomization", false];?? where to put it? Share this post Link to post Share on other sites
jshock 513 Posted December 14, 2014 and how to prevent the creation of the new unit? Turn off respawn?? Or what do you mean by that? Share this post Link to post Share on other sites
creartan 10 Posted December 14, 2014 (edited) repsawn is on. or maybe the problem is because of changing the var ingame Player setVehicleVarName "ranger"; ranger = Player; ingame, and didnt get registered to the old respawnEH?? ---------- Post added at 06:34 ---------- Previous post was at 06:27 ---------- because when i use Editor varname it respawned with the same variable, but when i use ingame by script Player setVehicleVarName "ranger"; ranger = Player; it will respawn with different variable; and cannot intterract with action assigned to him but when i try to change back to that variable "ranger", the variable "ranger" is unavailable i dont know.. confused, is im doin wrong when changing variable? Edited December 14, 2014 by creartan Share this post Link to post Share on other sites
jshock 513 Posted December 14, 2014 Well if you can use player to set as ranger, you can just use player in whatever script your running, it's the same difference, no need to assign the player a variable name, as the variable player is already native for our use... Share this post Link to post Share on other sites
dreadedentity 278 Posted December 14, 2014 Player setVehicleVarName "ranger"; This command does not do what you think it does Share this post Link to post Share on other sites
killzone_kid 1332 Posted December 14, 2014 https://community.bistudio.com/wiki/setVehicleVarName Share this post Link to post Share on other sites