Home   Help Search Login Register  

Author Topic: need help from experienced people  (Read 657 times)

0 Members and 2 Guests are viewing this topic.

Deadman

  • Guest
need help from experienced people
« on: 19 Dec 2002, 14:52:01 »
im currently working on a map. Its gonna be like a rpg and i need to beable to createunits at certain spot around the map.

I`ve had no problems creating vehicles with the line
car1 = "Mondeo" createvehicle getpos a1.

Now when i tried  man1 = "SoldierW" createunit getpos a1
nothing happened.

I was told by someone that its best to use arrays
but im unsure how they work.

You can declare personal money in the init.sqs.
And  you add to it and remove from it as you need to.
Do arrays work like this  

Can anyone help me understand using arrays a bit better  

« Last Edit: 27 Dec 2002, 17:49:11 by Deadman »

Totibbs

  • Guest
KevinForstereditingguy can help you out.

I dont know how great your skills are, but you have to:

Init.sqs
init.sqs
Quote
yourcash = 100
priceredcar = 400
redcar lock true

buy the redcar
buyredcar.sqs
Quote
? (yourcash - priceredcar) >=0 : redcar lock false; yourcash = yourcash - priceredcar
[] exec "leavecarshop.sqs"
[] exec "carshop.sqs"

Entering the carshop
carshop.sqs
Quote
player sidechat format ["You have £%1", yourcash]
player sidechat format ["The Sport car costs £%1", pricesportcar]
player sidechat format ["The Red car costs £%1", priceredcar]

buyredcar = player addaction ["Buy red car", "buyredcar.sqs"]
If you leave the carshop
leavecarshop.sqs
Quote
player removeaction buyredcar

I hope this will be alright, but notice you have not enough money now to buy the car, you can set the 100 in the init field to 400 or more, then you can buy the car.

make sure you name the car, which you want to buy, "redcar"

I think this was it all, if you have Q, ask me or Kevin, because he made this script and I stole it  ;D