MulleDK13 0 Posted August 16, 2006 Hi. I'm working on my "2 Player Tournament" map, and it's going great. I'm working on the tournament settings, and buy-scripts... I have a dialog with some buttons. "Buy LAW Launcher" and "Buy LAW" The first is the weapon, and the last is magazines. The LAW Launcher is inserted correctly when pushing the button, but the magazines won't appear when clicking "Buy LAW". This is the Buy Mag script which is called when someone clicks the "Buy LAW" button. Executed with: ["law" exec "buy_magazine.sqs"] All the lines get executed buy not the law is empty! <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;Script for Mortens Tournament 2006 (Written by MulleDK13) _magazine = _this select 0; ? (_magazine == "law") : goto "buy_law" ? (_magazine == "") : goto "buy_nothing" exit; #buy_law player addMagazine "LAWLauncher" Player1Saldo = Player1Saldo - MPriceLAW; _temp = "You bought a magazine!\n\nType: " _temp = _temp + "LAW" hint _temp exit; #buy_nothing hint "ERROR! An error occurred! You tried to buy nothing!"; exit; #ended exit; What is wrong? Share this post Link to post Share on other sites
nindall 0 Posted August 16, 2006 You're passing a string to the script - <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"law" exec "buy_magazine.sqs" then trying to access it as an array - <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_magazine = _this select 0; You can either change the first line of your script to - <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_magazine = _this or probably a better option (To make it easier for others to understand/use.) pass the arguments to the script in an array - <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">["law"] exec "buy_magazine.sqs" Share this post Link to post Share on other sites
MulleDK13 0 Posted August 16, 2006 Oops. I didn't mean... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">["law" exec "buy_weapon.sqs"] But... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">["law"] exec "buy_weapon.sqs" But the problem isn't there... Cause the line where the mag is inserted is being executed! 'cause those hints are coming! but no LAW! Share this post Link to post Share on other sites
nindall 0 Posted August 16, 2006 hmmm, i can't see any errors in your script then! but no LAW! After the script has executed does the ammo show up in the 'gear' section of the notepad? Share this post Link to post Share on other sites
MulleDK13 0 Posted August 16, 2006 Aaaah... lol! thank you! The GEAR was full, so it could not be added... But no message was shown... Is it possible to determine if the ammo were added successfully with the addMagazine command? Share this post Link to post Share on other sites
AgentJonathan 0 Posted August 28, 2006 I am not wanting to bring this post back up, but once you look at the string again... ... I suggest that you take a look at the forum rules. It specifically pointed out "No Swearing". Just to let you know, I am not mad dude. Can't you feel the love? Hahahaaaa! PS.: I am not trying to be mister boss, or Good guy. Share this post Link to post Share on other sites
MulleDK13 0 Posted September 1, 2006 ... I suggest that you take a look at the forum rules. It specifically pointed out "No Swearing". What do you mean??? Where did I swear? Share this post Link to post Share on other sites
AgentJonathan 0 Posted September 2, 2006 Under the link to this thread. Share this post Link to post Share on other sites
AgentJonathan 0 Posted September 2, 2006 Dude I'm not mad. Share this post Link to post Share on other sites
Chris Death 0 Posted September 2, 2006 Dude I'm not mad. Â Who knows? What do you really mean AgentJonathan? Stop drink before posting man, it'll make others help understanding what you want say. ~S~ CD Share this post Link to post Share on other sites
AgentJonathan 0 Posted September 2, 2006 Here is a clear version: Mulle, It is rude to cuss, and it offends people. Quote[/b] ] Why the @#!* is there no magz. Ps: not mad Share this post Link to post Share on other sites
AgentJonathan 0 Posted September 2, 2006 No hard feelings. I just didn't want the mods/admin to get onto you. Pleased to serve you (as long as you aint no tight-wad! ) Share this post Link to post Share on other sites