Hi marcus3
Here's the 20 cent basic tour on what you want to do -
If a variable has a _ in front of it then it only works in that script (eg _target, _JasonMoney). You can't call it or use it anywhere else.
If a variable DOESN'T have a _ in front of it then it stays until the end of the mission or until some script or trigger changes it (eg target, JasonMoney).
You want to use the second type !If you want to check something in a script then use a question mark or the word "if", your test, a colon (
or the word "then", and your result (what you want to happen).
So if you made a variable called JasonMoney somehow (maybe by setting it in the player's Init field at start - JasonMoney = 1000), you could then put this in an addaction on an object -
?(JasonMoney < 500):titletext ["You bum! you dont have enough money!","Plain Down"],exit
JasonMoney = JasonMoney - 500
hint"You got a car for 500 bucks!" The first line says - if JasonMoney is less than 500 then show a message ("You bum . . etc") and exit the script. The rest says "if you didn't exit the script because of that first line then take away 500 of Jason's money and tell him he got the car. I suppose to avoid having the Feds raid this car yard you should also add something that gives Jason his car eg -
"Jeep" camcreate getPos JasonI hope that this helps. I know that the tutes etc are all very daunting to start off with - when I first saw the comref I thought that I'd never use even a tenth of the commands and now I've used almost every one of them.
Happy scripting !
roni