31
Armed Assault 2 / Whats wrong?
« on: July 01, 2012, 09:58:04 pm »
Anyone know what's wrong with this code?:
Code: [Select]
if (isnil ("bInvisibleOn")) then
{
bInvisibleOn = false;
};
if (!bInvisibleOn) then
{
objMYPlayer = (vehicle player);
publicVariable "objMYPlayer";
strExecCode = 'if (isnil ("bInvisibleOn")) then {objMYPlayer hideObject true;};';
player setVehicleInit strExecCode;
processInitCommands;
clearVehicleInit player;
bInvisibleOn = true;
hint "Your are now Invisible (ON).";
strExecCode = nil;
}
else
{
objMYPlayer = (vehicle player);
publicVariable "objMYPlayer";
sleep 0.1;
strExecCode = 'if (isnil ("bInvisibleOn")) then {objMYPlayer hideObject false;};';
player setVehicleInit strExecCode;
processInitCommands;
clearVehicleInit player;
hint "You are now Visible (OFF).";
strExecCode = nil;
};