OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ding 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?
-
Trigger
money1 > 50
hint format ["Player's money is %1", money1]
-
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?
-
Make it 51 then it should work. ;D
Planck
-
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
-
right got it to work
-
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
-
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."
-
ah rofl.. its simple.
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:
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:
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 ;)!
-
well i know this is old topic :P
but heck...
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...
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
-
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!!
-
Yes but when I was trying to learn a money system, it was 2 year old posts here from OFP that helped me :)