Home   Help Search Login Register  

Author Topic: Money Question #2  (Read 1817 times)

0 Members and 1 Guest are viewing this topic.

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Money Question #2
« on: 23 Jun 2005, 05:57:08 »
New question, how do  i get it to desplay the amount of money to the player when the logic which plus 50's the total amount of money is activated, as in how do i get it to show the current amount of players money?
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

qqqqqq

  • Guest
Re:Money Question #2
« Reply #1 on: 23 Jun 2005, 11:17:35 »
Trigger

money1 > 50
hint format ["Player's money is %1", money1]

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Money Question #2
« Reply #2 on: 23 Jun 2005, 18:20:46 »
well i created a trigger

put money1 > 50 in the condition
and put
hint format ["Player's money is %1", money1]

in teh activation
then created another trigger saying money1 = 50

priviewd and nothing happened, what am i doing wrong?
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Money Question #2
« Reply #3 on: 23 Jun 2005, 20:20:28 »
Make it 51 then it should work.   ;D


Planck
I know a little about a lot, and a lot about a little.

Offline 456820

  • Contributing Member
  • **
Re:Money Question #2
« Reply #4 on: 23 Jun 2005, 20:31:33 »
i thought the = needs 2 of them like this
money == 50
also what did you do about the hint format ["Player's money is %1", money1]
it sounds like you put that in the condition field aswell as on the linne below you say
in the activation field
wich kind of implies that you havent done that part yet ?
also if you want the trigger to activate when the player has 50 or more money if so use
money >= 50

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Money Question #2
« Reply #5 on: 23 Jun 2005, 21:27:40 »
right got it to work
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Money Question #2
« Reply #6 on: 24 Jun 2005, 05:46:03 »
how do i set the money level so that it cannot go below 0?

i have a small weapons shop, when you buy a weapon but the money can go ito minuses which is annoying, i have already tried

money < 0
money = 0
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

qqqqqq

  • Guest
Re:Money Question #2
« Reply #7 on: 24 Jun 2005, 13:05:04 »
Read the command reference.    Particularly these bits

http://www.ofpec.com/editors/comref.php?letter=num

http://www.ofpec.com/editors/comref.php?letter=3#Script%20syntax

You're not going to get anywhere unless you understand the meaning of things like = and ==.  

? money1 <= 0 : hint "You're broke!"; money1 = 0

? price1 > money1 :  hint "You can't afford that."

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:Money Question #2
« Reply #8 on: 25 Jun 2005, 00:39:20 »
ah rofl.. its simple.

Quote
put money1 > 50 in the condition
and put
hint format ["Player's money is %1", money1]

Its right I think. Try to put that in an .sqs file instead of a trigger if you know what I mean.
Something like this:

Code: [Select]
player1money=50
hint format["You have %1 in your bank account",player1money]

EDIT: OOPS!!!! Forgot to read that question!
Here is how to distract money from buying stuff and all that sh!t :P!

example:

in a trigger's activation put: buyglock=player addaction["buy a glock as weapon with ammo","weapon.sqs"]

make a file called weapon.sqs
put in it:

Code: [Select]
playermoney=200
takeaway=30
if playermoney<30: goto notenough
playermoney=playermoney-takeaway
hint format["you've bought a glock with ammo! You've got %1 dollars left!",playermoney]
goto exit

#notenough
hint "you don't have enough money for a glock with ammo!"

#exit

Tell me if it works or if it doesn't ;)!
« Last Edit: 25 Jun 2005, 06:54:06 by OFPfreak »
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline ModestNovice

  • Members
  • *
Re: Money Question #2
« Reply #9 on: 18 May 2008, 07:02:08 »
well i know this is old topic   :P

but heck...

Code: [Select]
playermoney=200
takeaway=30
if playermoney<30: goto notenough
playermoney=playermoney-takeaway
hint format["you've bought a glock with ammo! You've got %1 dollars left!",playermoney]
goto exit

#notenough
hint "you don't have enough money for a glock with ammo!"

#exit

this is wrong.

I think this right...

Code: [Select]
playermoney=200
_takeaway=30
? (playermoney<_takeaway) : goto "notenough"
playermoney=playermoney-_takeaway
hint format["You've bought a glock with ammo! You've got %1 dollars left!",playermoney]
goto exit

#notenough
hint "You don't have enough money for a glock with ammo!"

#exit
Exit

"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Gcfungus

  • Members
  • *
Re: Money Question #2
« Reply #10 on: 18 May 2008, 09:24:26 »
I'll have to side with the admins. This post is 3 years old! Do not post in very old topics, as it's not relevant!!
The object of war is not to die for your country, but to make the other bastard die for his.
~George Patton

Offline ModestNovice

  • Members
  • *
Re: Money Question #2
« Reply #11 on: 18 May 2008, 22:00:25 »
Yes but when I was trying to learn a money system, it was 2 year old posts here from OFP that helped me  :)
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley