Results 1 to 4 of 4

Thread: Check if a vehicle or soldier

  1. #1

    Check if a vehicle or soldier

    Hello,

    I would create a small script to spawn soldier or vehicle with BIS_fnc_spawnGroup or bis_fnc_spawnvehicle.
    How can I check an item in my array is a vehicle or a soldier:
    For exemple :

    array_spawn = ["T90","RU_Soldier_HAT","RU_Soldier_AR"];

    I would to switch on bis_fnc_spawnvehicle if my first array is a vehicle and second array is a soldier to BIS_fnc_spawnGroup.

    Something like that:

    PHP Code:
    array_spawn = ["T90","RU_Soldier_HAT","RU_Soldier_AR"];
    {    
        switch (
    _x) do {
            case 
    isvehicle : {     [getpos player,_xcall BIS_fnc_spawnVehicle };
            case 
    issoldier : {     [getpos player,_xcall BIS_fnc_spawnGroup };
        };                
    } foreach 
    array_spawn
    Thank you very much

  2. #2
    Code:
    switch (isKindOf _x) do{
             case "Man" : {};
             case "Tank" : {};

  3. #3
    Yes, I'm stupid

    Thank you.

  4. #4
    First Sergeant Buliwyf's Avatar
    Join Date
    Jan 1 2004
    Location
    Hamburg / Germany
    Posts
    823
    Player is in vehicle:
    Code:
    vehicle player != player
    Player is not in vehicle:
    Code:
    vehicle player == player

Similar Threads

  1. Check if a vehicle is empty
    By Enricksolt in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 7
    Last Post: Jul 18 2011, 14:35
  2. Detecting if AI soldier is in vehicle...
    By Iceman77 in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 4
    Last Post: Nov 23 2007, 00:47
  3. In vehicle check
    By Op4 BuhBye in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 26
    Last Post: Jun 4 2007, 16:01
  4. Check vehicle vleocity
    By Trixta in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 3
    Last Post: Jul 13 2005, 20:08
  5. How to put a soldier in vehicle
    By schutz99 in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 5
    Last Post: Jan 31 2003, 17:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •