Jump to content
  • 0

How to show marker on map if Radio in magazines. Help


prosims

Question

Hello everyone,

 

i am a complete newby and I am trying to make a following script. if player finds a radio, certain markers will appear on the map.

 

Which command shows the markers on the map and how I implement it? 



if ("ItemRadio" in magazines player) then {

here should be a command to show following marker on map

_sectorFOB  = createMarker ["_sectorFOB ", [6611.9756, 14201.991]];
_sectorFOB  setMarkerText "FOB";
_sectorFOB  setMarkerType "mil_objective";
_sectorFOB  setMarkerColor "ColorRed";
_sectorFOB  = _sectorFOB ;

} else {
	
};

Thanks for advance for help.

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

I'm no coding guru, but something like this?

if ("ItemRadio" in _weapons) then {
        hasRadio = true;
    } else { 
    hasRadio = false;
};
if(hasRadio && _canDo) then {
      cutText [format["You've found a radio, check your map for new information!"], "PLAIN DOWN"];
     _survbase = createMarker ["survbase", [3907.27,7872.66]];
     _survbase setMarkerText "Survivor City";
     _survbase setMarkerShape "mil_dot";
     _survbase setMarkerColor "ColorRed";
}; 

The problem is, markers are global aren't they? 
So if 1 person finds the radio, everyone will see the marker?

Link to comment
Share on other sites

  • 0

Wow, thanks for the such a quick reply.

 

This is bad that markers are global and everyone will see it.

 

The solution might be to hide the marker after a minute?

 

But in this case we have to make a scroll menu for it or drop down menu, which sounds very complicated for me. But the idea of making custom map events using such script is nice. if anyone could know how to do it would be great. 

Link to comment
Share on other sites

  • 0

Wow, thanks for the such a quick reply.

 

This is bad that markers are global and everyone will see it.

 

The solution might be to hide the marker after a minute?

 

But in this case we have to make a scroll menu for it or drop down menu, which sounds very complicated for me. But the idea of making custom map events using such script is nice. if anyone can help with it would be great. 

 

You can make the markers go away very easily.

 

if ("ItemRadio" in _weapons) then {
        hasRadio = true;
    } else { 
    hasRadio = false;
};
if(hasRadio && _canDo) then {
      cutText [format["You've found a radio, check your map for new information!"], "PLAIN DOWN"];
     _survbase = createMarkerLocal ["survbase", [3907.27,7872.66]];
     _survbase setMarkerTextLocal "Survivor City";
     _survbase setMarkerShapeLocal "mil_dot";
     _survbase setMarkerColorLocal "ColorRed";

sleep 15; //15 secs?
    deleteMarker _survbase; //deletes the marker after 15 secs, there is no loop (afaik) so it won't reappear untill another radio has been found.
    player removeWeapon "ItemRadio"; //The "fix" to not make them get infinite markers, deletes the radio after 15 secs?
}; 
 

Don't know if the setMarkerLocal actually works as intended.

https://community.bistudio.com/wiki/createMarkerLocal 

https://community.bistudio.com/wiki/createMarker 

Just a slight idea I had though; people can just drop and pick up the radio again to get infinite ammount of missions. 

Link to comment
Share on other sites

  • 0

You are my hero! Thank you very much!!! 

 

I will check it tomorrow morning. We can use some other "useless" epoch item instead of radio, like newspaper or book. I am going to make custom traders with rare items and let people find out there they are by finding some item which will show the markers for them for 15 sec.

Link to comment
Share on other sites

  • 0

Yes, I'm finally done.
Basicly what this is, it's like the epoch missions but made usable through fn_selfaction and the usage of radios!

Ofcourse this script is not totally 100% done, there can still be some addition that you, yourself might want to add, but here's the basic concept.

 

What does it do?

When someone loots a Radio, they get an option in the scroll wheel menu to "Use Radio", once used the player will perform an animation and a message will appear, telling them to check the map. 
On the map there will be a marker, just like the EMS. At the centre of this marker there is a reward.
To stop constant abuse, the radio will be removed after usage.

 

How do I install?

 

Step 1: Open fn_selfactions.sqf  and add this:

(This requires that you already have the fn_selfaction being locally compiled on the server ofcourse.)

_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

Add this below that line:

////RADIO TRANS-MISSION get it? it's a pun.
// This part is inpsired by the selfbloodbag by Krixes @ Opendayz and Player 2 @ ZombZ.net
_mradio = (magazines player) + (weapons player); 
if ("ItemRadio" in _mradio) then {
        hasRadio = true;
    } 
	else 
	{ 
		hasRadio = false;
	};
    if((speed player <= 1) && hasRadio && _canDo) then {
        if (s_player_radiomission < 0) then {
            s_player_radiomission = player addaction[("<t color=""#f000ff"">" + ("Use Radio") +"</t>"),"radio\mission\mission.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_radiomission;
       s_player_radiomission = -1;
};
////I'll just show myself out.

Step 2.

Download these files and place them in your missions folder.

 

Create a folder called radio inside that, create another folder called mission

Save these codes as:

 

mission.sqf (fixed)

http://pastebin.com/hMcJerD3

 

addmarkerradio.sqf

http://pastebin.com/SHCKLWsN

 

remmarkersradio.sqf

http://pastebin.com/DLmrK1mr

 

In the end, it should look like this:

http://i.imgur.com/ls9jeEo.jpg

 

Why did I make an entire script?

Well, I want to use this aswell! - The radio can be something very rare, a special event type of thing.

Reminder: these vehicles don't save after restart!

Link to comment
Share on other sites

  • 0

Has anyone got this working on the latest updates? I am interested in making heli crashes in my server appear to players who have ItemRadio in their gear. 

 

If not possible then maybe create another mission to run along side the normal one i have on myserver and only show markers to players who have a radio. is this possible?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...