Home   Help Search Login Register  

Author Topic: Simple Action menu dialoge / Biggest problem in the world  (Read 1912 times)

0 Members and 1 Guest are viewing this topic.

Offline bourbon

  • Members
  • *
Hi

Im making a sort of rpg-mission for arma, i played something in Ofp back in the days, i think its called "dogville" or something like that.

Anyways, the dialoge tools that are out or just released are a bit to complex for me, all i need is a simple action menu text that says "buy gun" or "buy car". when the player is in the right shop. And when the player is buying a gun he gets one.

Isnt there any easier way to just create such a new action without these extremely complicated tools?

The mission will hold aprox 3 players for now, how do i in the easiest way make a buy system for 3 people?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Simple Action menu dialoge / Biggest problem in the world
« Reply #1 on: 20 May 2007, 15:14:43 »
Code: [Select]
;Enablebuygun.sqs
~4
_rightspotposition = _this select 0
@!isNull player
#check
@vehicle player distance _rightspotposition < 3
_ah = vehicle player addAction ["Buy gun", "buygun.sqs"]

@vehicle player distance _rightspotposition >= 3
vehicle player removeAction _ah

goto "check"

execute Enablebuygun.sqs in the init.sqs file of your mission so it is running for each player.

Then create buygun.sqs and add there the code to give a gun to the player.

Offline bourbon

  • Members
  • *
Re: Simple Action menu dialoge / Biggest problem in the world
« Reply #2 on: 20 May 2007, 15:48:19 »
Soo I put the code in a notepad document, save it as buygun.sqs. Then put a trigger with: player addAction ["Buy gun", "buygun.sqs"] ? :scratch: :dunno:

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Simple Action menu dialoge / Biggest problem in the world
« Reply #3 on: 20 May 2007, 15:57:13 »
You put this code in Enablebuygun.sqs, yes, but then you execute it from init.sqs (another file you may create in your mission's folder).
init.sqs, if exists in your mission folder, is the very first script to be automatically executed.

For example.
Code: [Select]
[getPos weaponshop]exec"Enablebuygun.sqs"

If you are not familar with scripting, before you get into any of these, you better check some scripting tuts first.