Results 1 to 2 of 2

Thread: how to Name items eg: radios

  1. #1

    how to Name items eg: radios

    Hey all! I just recently mastered the if then else and it rejuvinated my interest in mission making. So I was hoping someone could either point me in the right direction or tell me how to name items such as radios. In order for say applying a script to an item. calling on the radio or NVGs etc in a script. In my mission I want the radio to actulley be vital. playsounds to come from the radio and no sidechat unless the player is within 5 meters of the radio things like that. Thank you in advance for your help.

  2. #2
    Master Sergeant sxp2high's Avatar
    Join Date
    Jul 16 2009
    Location
    nearestLocation [(getPos player), "nameCity"];
    Posts
    605
    Hi,

    I don't think it's possible to name weapons or items. You will have to work with the classname instead.


    I.e.


    Check if player has a radio:
    PHP Code:
    if (player hasWeapon "ItemRadio"then hint "I have a radio!"; }; 

    Check if there's a radio lying on the ground (within 50m):
    PHP Code:
    _holder = (nearestObject [player"WeaponHolder"]);

    if (!(
    isNull _holder)) then // Weapon holder found

        
    if ((player distance _holder) > 5exitWith hint "its more than 5m away!"; };

        
    _content getWeaponCargo _holder;
        if (
    "ItemRadio" in _contentthen hint "There is a radio close by, lying on the ground!"; };
    }; 
    Not 100% sure, if the second example will work like that (untested).


    I hope that helps a bit.

Similar Threads

  1. Add in Acre radios to Wafare ?
    By strike0277 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 0
    Last Post: Nov 14 2010, 23:53
  2. Vehicle Radios
    By Yokhanan in forum ARMA : CONFIGS AND SCRIPTING (addons)
    Replies: 3
    Last Post: Nov 18 2007, 18:30
  3. Looking for radios
    By General Barron in forum ADDONS & MODS: DISCUSSION
    Replies: 6
    Last Post: Aug 5 2005, 19:04
  4. Artillery and realistic radios
    By Harnu in forum ARMA 2 & OA - SUGGESTIONS
    Replies: 25
    Last Post: Nov 29 2003, 10:15
  5. Is anyone into radios?
    By Jester983 in forum OFFTOPIC
    Replies: 16
    Last Post: Jul 22 2002, 18:39

Posting Permissions

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