what would i change.

osmox

Member
how would i change the GetIn to a list of vehicles
example M1A1,M1A2_TUSK_MG,AAV

//If saving vehicles to the database is disabled, lets warn players it will disappear
if (!(DZMSSaveVehicles)) then {
_object addEventHandler ["GetIn",{
_nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: Mission Vehicle can be sold only at the USMC Depot and will despawn on server restart!","PLAIN DOWN",5] call RE;
}];
};
 
_object addEventHandler ["M1A1,M1A2_TUSK_MG,AAV",{
_nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: Mission Vehicle can be sold only at the USMC Depot and will despawn on server restart!","PLAIN DOWN",5] call RE;
}];
};

like this
 
he ment something like this:

if (!(DZMSSaveVehicles)) then {
if (typeof _object in ["M1A1,M1A2_TUSK_MG,AAV"]) then {
_object addEventHandler ["GetIn",{
_nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: Mission Vehicle can be sold only at the USMC Depot and will despawn on server restart!","PLAIN DOWN",5] call RE;}];
};
};

not 100pro sure its correct this way though.
 
yep, thats the idea of what i meant, although i would have forgotten to use. typeof _object:oops:

looking at it tho, it should be a single if block with the new code added as a boolean &&

Code:
if (!(DZMSSaveVehicles) & (typeof _object in ["M1A1,M1A2_TUSK_MG,AAV"]))
 then {
 
Code:
    //If saving vehicles to the database is disabled, lets warn players it will disappear
    if (!(DZMSSaveVehicles)) then {
        _object addEventHandler ["GetIn",{
            _nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5] call RE;
        }];
    };



New Code

if (!(DZMSSaveVehicles) & (typeof _object in ["M1A1,M1A2_TUSK_MG,AAV"])) then {
        _object addEventHandler ["GetIn",{
            _nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: Mission Vehicle can be sold only at the USMC Depot and will despawn on server restart!","PLAIN DOWN",5] call RE;
        }];
    };


RPT error

if (!(DZMSSaveVehicles) & (typeof _object in ["MLRS,M1A1,M1A2_TU>
8:31:54   Error position: <& (typeof _object in ["MLRS,M1A1,M1A2_TU>
8:31:54   Error Missing )
 
if (!(DZMSSaveVehicles) && (typeof _object in <-------- like this


Like this was trying to read up on statements and stuff and saw && wasnt sure if thats how i goes
 
Back
Top