Jump to content
Sign in to follow this  
aozyaman

Help with onMapSingleClick please?

Recommended Posts

Hello,

I'm doing a small UH60 limo service script utilizing onMapSingleClick for setting the destination.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if!(local server) exitWith {};

_chopper=_this select 0;

if (!(alive _chopper)) exitWith

{

playSound "beep"; playSound "statik";

[WEST, "AirBase"] sideChat "Helikopter gonderemiyoruz. Basinizin caresine bakin.";

playSound "statik";

};

playSound "beep"; playSound "statik";

_chopper sideChat "Alindi. Havalaniyoruz.";

sleep 1;

_chopper setFuel 1;

_base=position _chopper;

_helipad="HeliHEmpty" CreateVehicle(position player);

[grp_UH60,2] setWaypointPosition [position _helipad,0];

[grp_UH60,2] setWaypointStatements ["true", "chopper1 land ""GET IN"""];

grp_UH60 setCurrentWaypoint [grp_UH60,2];

waitUntil {player in _chopper};

playSound "beep"; playSound "statik";

_chopper sideChat "Nereye gidiyoruz?";

sleep 1;

onMapSingleClick '

_marker1 = createMarker ["Inis_Yeri",_pos];

_marker1 setMarkerType "Marker";

_marker1 setMarkerColor "ColorRed";

_chopper sideChat "Anlasildi.";

_helipad="HeliHEmpty" CreateVehicle(_pos);

[grp_UH60,2] setWaypointPosition [position _helipad,0];

grp_UH60 setCurrentWaypoint [grp_UH60,2];

waitUntil {not (player in _chopper)};

[grp_UH60,2] setWaypointPosition [_base,0];

[grp_UH60,2] setWaypointType "MOVE";

[grp_UH60,2] setWaypointStatements ["true", "chopper1 land ""LAND"""];

grp_UH60 setCurrentWaypoint [grp_UH60,2];

deleteMarker _marker1;

playSound "beep"; playSound "statik";

_chopper sideChat "Bol sans.";

onMapSingleClick "";

';

I opted to use ' for the OMSC string so as not to hassle with double "" s.

The code seems to run fine until it comes to ---  waitUntil {not (player in _chopper)};  --- within the onMapSingleClick block, where it generates a "Generic error in expression" sad_o.gif

Can someone be so kind as to tell me what is wrong with the onMapSingleClick section of the above code?

Any help is greatly appreciated.

Share this post


Link to post
Share on other sites

Thanks for responses. I moved waitUntil out of the onMapSingleClick block and now it works, as in:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick '

marker1 = createMarker ["Inis_Yeri",_pos];

marker1 setMarkerType "Marker";

marker1 setMarkerColor "ColorRed";

chopper sideChat "Anlasildi.";

helipad="HeliHEmpty" CreateVehicle(_pos);

[grp_UH60,2] setWaypointPosition [position helipad,0];

grp_UH60 setCurrentWaypoint [grp_UH60,2];

onMapSingleClick "";

';

waitUntil {not (player in chopper)};

[grp_UH60,2] setWaypointPosition [base,0];

[grp_UH60,2] setWaypointType "MOVE";

[grp_UH60,2] setWaypointStatements ["true", "chopper1 land ""LAND"""];

grp_UH60 setCurrentWaypoint [grp_UH60,2];

deleteMarker marker1;

playSound "beep"; playSound "statik";

chopper sideChat "Bol sans.";

Perhaps waitUntil just doesn't like to be used within an OMSC string  huh.gif

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  

×