Somerville 0 Posted August 17, 2007 Hi, I need a variable (_pos) to get the position of onMapSingleClick. Kinda like _pos = getpos (onMapSingleClick) basically. I'm editing Mr-Murray's artillery script (I started a while ago, and abandoned it due to lack of time), and i'm just wondering if somebody could help? Thanks, Share this post Link to post Share on other sites
ZNorQ 0 Posted August 17, 2007 I'm not sure if I understand you correctly, but _pos is actually the variable that would contain the coordinates of your map click. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick "hint format[""%1"", _pos]; onMapSingleClick """""; This would display the position you clicked, which shows that onMapSingleClick passes the players map single click coordinates into _pos. If you want to keep that value, and wait for another map single click, just store it in another variable; _firstclick = _pos; Hope this helps.. ZNorQ. Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted August 17, 2007 If it *has* to be _pos in your script, try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> GlobalPos = "JUNK"; onMapSingleClick "GlobalPos = _pos; onMapSingleClick '';"; waitUntil{GlobalPos != "JUNK"}; _pos = GlobalPos; Share this post Link to post Share on other sites
Stonewall Jackson 0 Posted August 18, 2007 onMapSingleClick {"eart" setMarkerPos _pos; ewayposx = (_pos select 0); ewayposy=(_pos select 1)} _pos is the whole package x,y,z variables.... ewayposx = (_pos select 0) is the x variable. etc..... hope this helps stonewall Share this post Link to post Share on other sites
stegman 3 Posted September 4, 2007 onMapSingleClick {"eart" setMarkerPos _pos; ewayposx = (_pos select 0); ewayposy=(_pos select 1)}_pos is the whole package x,y,z variables.... ewayposx = (_pos select 0) is the x variable. etc..... hope this helps stonewall Nah mate. Not a good explanation at all. And i copied it into a new sqs file, and it gives a an error saying <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"Type code, expected string". I'm having the same issue here. It just wont work. i want to click on the map where i want team 'alpha' to go, and marker to show up on the map also. can some one please help, and explain clearly what it does plese? Share this post Link to post Share on other sites
dr_eyeball 16 Posted September 4, 2007 I think that example was OFP code. For SQS, try: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick ' "eart" setMarkerPos _pos; ewayposx = (_pos select 0); ewayposy=(_pos select 1) ' Note the single quotes allow embedding double quotes inside, or you could have used paired double quotes. Share this post Link to post Share on other sites
stegman 3 Posted September 4, 2007 I think that example was OFP code.For SQS, try: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick ' "eart" setMarkerPos _pos; ewayposx = (_pos select 0); ewayposy=(_pos select 1) ' Note the single quotes allow embedding double quotes inside, or you could have used paired double quotes. I'll try it right now... EDIT: Â it worked! Â I can move a marker around the map. I have one more question, whats the code to make a goup move to that marker? Â is it; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> alpha moveto markername becose this wont work Share this post Link to post Share on other sites