SWIFT88 0 Posted March 8, 2005 when i run an addon i get the error message pop up..... "_gun setpos [_posx,_posy,_posz]|#|" Error Type Any, expected number " Share this post Link to post Share on other sites
Footmunch 0 Posted March 9, 2005 Looks like a scripting error - is it occurring with a particular addon? Share this post Link to post Share on other sites
Scanger 0 Posted March 9, 2005 If it's a script you are working on then here's the correct ways to script it. There are a few options, depends on what u need to do. But here are a few scripting rules and methods. The getpos command returns an array [x,z,y] The setpos command sends and array [x,z,y] These commands can be run as a whole, or split into single co-ords: x coordinates is east-west getpos _object select 0 is always it's x co-ord z is south-north getpos _object select 1 is always it's z co-ord y is height above ground getpos _object select 2 is always it's y co-ord This will increase the guns height above ground level by 10 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _gun = _this select 0 _posx = getpos _gun Select 0 //returns number value for east-west _posz = getpos _gun Select 1 //returns number value for south-north _posy = getpos _gun Select 2 //returns number value for height above ground _gun setpos [_posx,_posz,(_posy)+10] This will also increase the guns height above ground level by 10 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _gun = _this select 0 _gun setpos [getpos _gun select 0, getpos _gun select 1, (getpos _gun select 2) +10] This will simply place the gun wherever u want it <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _gun = _this select 0 _gun setpos [2500, 2500, 100] That's the scripting for positioning of an object, but if it's just an error you're getting then it must be an addon or script you are using in your mission that has the script error...my hunch, it's something with a gun ;) Share this post Link to post Share on other sites
csj 0 Posted March 10, 2005 maybe if SWIFT88, you could post the script someone could pinpoint the problem. or if it is not your addon then maybe you are missing an addon that the script calls the position of. Share this post Link to post Share on other sites