Welcome, Guest Thursday 17th April 2014, 11:40:24
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: Simple Action menu dialoge / Biggest problem in the world  (Read 465 times)
0 Members and 1 Guest are viewing this topic.
bourbon
*
Offline Offline


« on: 20 May 2007, 13:54:03 »

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?  
Logged
Mandoble
Editors Depot
Administrator
*****
Offline Offline



WWW
« Reply #1 on: 20 May 2007, 14:14:43 »

Code:
;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.
Logged

bourbon
*
Offline Offline


« Reply #2 on: 20 May 2007, 14: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 Chin Don't Know
Logged
Mandoble
Editors Depot
Administrator
*****
Offline Offline



WWW
« Reply #3 on: 20 May 2007, 14: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:
[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.
Logged

Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: