Jump to content
Sign in to follow this  
cool=azroul13

Server,jip + addaction et marker = :(

Recommended Posts

Hi all,

Two new problem :p

1st: Marker and Jip player

I try public variable but it doesn't seem to works or maybe Idon't have the right syntax.

Here my script:

_id = _this select 2;
player removeAction _id;
rallytype = "Misc_Backpackheap";

rallypoint = rallytype createVehicle (player modelToWorld [0,2,0]);
rallypoint addAction ["Enlever le rally","mobile\removerally.sqf",[],-1,false,true,"",""];


if(player distance getMarkerPos "area1" > 100)
then
{ rallyposeni = true;};


switch (true) do {
     case (player == s1) : {
if (rallyposeni) then {
rallymarker1 = createMarker ["repawn_west_3",position rallypoint];
rallymarker1 setMarkerShape "ICON";
rallymarker1 setMarkerType "hd_flag";
rallymarker1 setMarkerSize [0.75,0.75];
rallymarker1 setMarkerColor "ColorRed";
rallymarker1 setMarkerText "A";

} 
else { hint "Des ennemis sont trop proche de vous. Veuillez déplacer le rally."};
};

     case (player == s5) : {
if (rallyposeni) then {
rallymarker2 = createMarker ["repawn_west_4",position rallypoint];
rallymarker2 setMarkerShape "ICON";
rallymarker2 setMarkerType "hd_flag";
rallymarker2 setMarkerSize [0.75,0.75];
rallymarker2 setMarkerColor "ColorBlue";
rallymarker2 setMarkerText "B";
rallypos2 = 2;
} 
else { hint "Des ennemis sont trop proche de vous. Veuillez déplacer le rally.."};
};

     case (player == s9) : {
if (rallyposeni) then {
rallymarker3 = createMarker ["repawn_west_5",position rallypoint];
rallymarker3 setMarkerShape "ICON";
rallymarker3 setMarkerType "hd_flag";
rallymarker3 setMarkerSize [0.75,0.75];
rallymarker3 setMarkerColor "ColorGreen";
rallymarker3 setMarkerText "C";
rallypos2 = 2;
} 
else { hint "Des ennemis sont trop proche de vous. Veuillez déplacer le rally."};
};
};

2nd: One problem when I want to spawn a composition via addaction.

it seems that only the actor of the action can see is work.

my code (all work except the compo, even the "mallette" is created")

_conteneur 				= _this select 0;
_pos_conteneur 			= getPos _conteneur;
_dir_conteneur 			= getDir _conteneur;


pre_comp = nearestObjects [_pos_conteneur,["All"], 20];
publicvariable "pre_comp";


_hinv = "HeliHEmpty" createVehicle _pos_conteneur;
_hinv setDir _dir_conteneur;
_hinv setPos _pos_conteneur;

deletevehicle _conteneur;

[nil,nil,rHINT,"FOB en construction"] call RE;
Sleep 10;

_mallette = "SatPhone" createVehicle _pos_conteneur;
_mallette setVehicleInit "
this addAction ['Deploiement...','Dialogs\Respawn_Dialog.sqf']; this addAction ['Demonter la base','mobile\RemoveFOB.sqf'];"; processInitCommands;


nul = ["FOB", _dir_conteneur, _pos_conteneur] execVM "Createcomposition.sqf";


markerfob = createmarker ["respawn_west_2",getpos _hinv];
markerfob setMarkerShape "ICON";
markerfob setMarkerType "hd_flag";
markerfob setMarkerSize [0.75,0.75];
markerfob setMarkerColor "ColorBlue";
markerfob setMarkerText "FOB";


[nil,nil,rHINT,"FOB construite"] call RE;

if (true) exitWith {}; 

Share this post


Link to post
Share on other sites

Hi,

cant help on the marker / jip but regarding the comosition:

i bet you will find the createVehicleLocal

command in your "Createcomposition.sqf"

your "mallette" is created via createVehicle wich is global

If you change the "Createcomposition.sqf" from createVehicleLocal to createVehicle you´ll have to make sure that only one machine runs the script otherwise you will get multiple compositions.

Share this post


Link to post
Share on other sites

Doh

I forget to check the script !! :rolleyes:

Thanks

Anyone has some info about the marker and the locality.

i try:

If (isServer) then {
switch (true) do { 
     case (player == s1) : { 
if (rallyposeni) then { 
rallymarker1 = createMarker ["repawn_west_3",position rallypoint]; 
rallymarker1 setMarkerShape "ICON"; 
rallymarker1 setMarkerType "hd_flag"; 
rallymarker1 setMarkerSize [0.75,0.75]; 
rallymarker1 setMarkerColor "ColorRed"; 
rallymarker1 setMarkerText "A"; 

}  
else { hint "Des ennemis sont trop proche de vous. Veuillez déplacer le rally."}; 
};};

But Noone can see this marker!!

Share this post


Link to post
Share on other sites

you can use a local handle like this, with underscore in front:

[b]_rallymarker1[/b] = createMarker ["repawn_west_3",position rallypoint]; 
[b]_rallymarker1[/b] setMarkerShape "ICON";

otherwise you need to do as previous post says about strings:

_marker = createMarker ["repawn_west_3",position rallypoint]; 
[b]"repawn_west_3"[/b] setMarkerShape "ICON";

Share this post


Link to post
Share on other sites

I know this, I just try an other method :p it works same than the other but jip doesn't see my marker!

My goal is to create a rallypoint.

But I have multiple problem: :rolleyes:

I want that each team can create a distinct rallypoint (Alpha,bravo,Charlie)

but only one work.

When player die they have a rallypoint even if it was already placed.

And last thing Jip player can see the rally and can go on.

here my code: rallyinit launch via the init.sqf

if (!isServer && (player != player)) then
{
 waitUntil {player == player};
 waitUntil {time > 10};
};

sleep 0.1;

if (typeof player == "CDF_Soldier_GL") then { rallypointobject = player addAction ["<t color=""#dddd00"">Placer le rally</t>","mobile\deployrally.sqf",[],-1,false,true,"",""]};

player addEventHandler ["Killed",{
[] spawn {
	WaitUntil{alive player};

	player removeAction rallypointobject;
               if (typeof player == "CDF_Soldier_GL") then {

	rallypointobject = player addAction ["<t color=""#dddd00"">Placer le rally</t>","mobile\deployrally.sqf",[],-1,false,true,"",""];
	 };

};
}];

deployrally.sqf

_id = _this select 2;
player removeAction _id;
rallytype = "Misc_Backpackheap";

rallypoint = rallytype createVehicle (player modelToWorld [0,2,0]);
rallypoint addAction ["<t color=""#dddd00"">Enlever le rally</t>","mobile\removerally.sqf",[],-1,false,true,"",""];


if(player distance getMarkerPos "area1" > 100)
then
{ rallyposeni = true;};


switch (true) do {
     case (player == s1) : {
if (rallyposeni) then {
_rallymarker1 = createMarker ["repawn_west_3",position rallypoint];
_rallymarker1 setMarkerShape "ICON";
_rallymarker1 setMarkerType "hd_flag";
_rallymarker1 setMarkerSize [0.75,0.75];
_rallymarker1 setMarkerColor "ColorRed";
_rallymarker1 setMarkerText "A";
} 
else { hint "Des ennemis sont trop proche de vous. Veuillez déplacer le rally."};
};

     case (player == s5) : {
if (rallyposeni) then {
_rallymarker2 = createMarker ["repawn_west_4",position rallypoint];
_rallymarker2 setMarkerShape "ICON";
_rallymarker2 setMarkerType "hd_flag";
_rallymarker2 setMarkerSize [0.75,0.75];
_rallymarker2 setMarkerColor "ColorBlue";
_rallymarker2 setMarkerText "B";
} 
else { hint "Des ennemis sont trop proche de vous. Veuillez déplacer le rally.."};
};

     case (player == s9) : {
if (rallyposeni) then {
_rallymarker3 = createMarker ["repawn_west_5",position rallypoint];
_rallymarker3 setMarkerShape "ICON";
_rallymarker3 setMarkerType "hd_flag";
_rallymarker3 setMarkerSize [0.75,0.75];
_rallymarker3 setMarkerColor "ColorGreen";
_rallymarker3 setMarkerText "C";

} 
else { hint "Des ennemis sont trop proche de vous. Veuillez déplacer le rally."};
};

Removerally.sqf

_target = _this select 0;

deleteVehicle _target;
deleteMarkerLocal "respawn_west_3";



if (typeof player == "CDF_Soldier_GL") then {
rallypointobject = player addAction ["<t color=""#dddd00"">Placer le rally</t>","mobile\deployrally.sqf"];};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×