Home   Help Search Login Register  

Author Topic: Money system...  (Read 5104 times)

0 Members and 1 Guest are viewing this topic.

Waterman

  • Guest
Money system...
« on: 21 Mar 2003, 21:03:28 »
Hi there. I have started making an MP mission along the lines of C&R (cops and robbers).  I was wondering if there was anyone there who has a script I could use for this. ???

  What I would like it to do is, when a person goes up to a certain object or building, have the option to buy a vehicle or something then subract X amout from the player and the object that is bought appears.
 It would also have to include starting money and wages for every so often.

I know it sounds a bit much :o :P, so if there is a script already made with tutorial, could someone help me...

Cheers,
Waterman. :)

Waterman

  • Guest
Re:Money system...
« Reply #1 on: 21 Mar 2003, 22:15:13 »
I think it's ok now... ::)
I think I have it working but I will see, so I wont solve it incase this doesn't work out...

Waterman. :)

Waterman

  • Guest
Re:Money system...
« Reply #2 on: 22 Mar 2003, 12:49:41 »
Actually the scripts I found only apply for 1 player I think... :-\

Take a look at these scripts and in particular the init.sqs:

<Init.sqs>

Code: [Select]
yourcash = 1000
priceredcar = 400
redcar lock true

<Buyredcar.sqs>

Code: [Select]
? (yourcash - priceredcar) >=0 : redcar lock false; yourcash = yourcash - priceredcar
[] exec "leavecarshop.sqs"
[] exec "carshop.sqs"

<Carshop.sqs>

Code: [Select]
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"]

<leavecarshop.sqs>

Code: [Select]
player removeaction buyredcar


That is the scripts I am using at the moment and seem to work, but not sure if it would work for all players in MP.  How would I modify these so that they would apply for all players? ???  I know it has something to do with the Init.sqs, but not sure what to do.

Or better still, if you have money scripts that work already...

Cheers,
Waterman. :)

Rappy

  • Guest
Re:Money system...
« Reply #3 on: 22 Mar 2003, 14:02:00 »
did something similiar for the whole side(west/east) as a kind of RTS system.

To buy vehicles, weapons etc

add some string to init like:
westcash = 10000
then when a player from west wants to buy a car for example(lets say there's a building for that)
buyjeepw = player addaction ["BUY JEEP (400$)", "buyjeepw.sqs"]


and in buyjeepw.sqs

?(side player == east):exit
?(westcash >399):goto "continue"
~0.2
player sidechat "Damn I dont have enough money"
exit

#continue
westcash = westcash - 400
vendor sidechat "Thank you for the purchase"
~5
"Jeep" CreateVehicle getmarkerpos "vendor"
exit



Or something like that depending on your needs


For wages you could have a timer
So it reduces cash for every 2 minutes currently, and substracts 100 units of cash

timerwages = 0
#loop
?(timerwages == 60):goto "wages"
~2
timerwages = timerwages + 1
goto "loop"

#wages
~1
westcash = westcash - 100
goto  "loop"


And ófcourse to this place you could add a check to make sure there is some cash at all.

Or adjust and add the scripts to have cash for players separately etc.
« Last Edit: 22 Mar 2003, 14:04:17 by Rappy »

Waterman

  • Guest
Re:Money system...
« Reply #4 on: 22 Mar 2003, 14:42:26 »
thanks for that Rappy. I'll try that one out...

But first, how do you activate the wages script? Do you put that code in the init, or do you make a trigger ingame?
Also, I take it "vendor" is the name of the marker where you want the cars to spawn?

Cheers,
Waterman. :)

Rappy

  • Guest
Re:Money system...
« Reply #5 on: 23 Mar 2003, 11:25:43 »
Np, I enjoy writing scripts :D

might have mistakes though as I havent tested any of that


As wages is something you would like to have constantly (unless you want to cancel it like when there is no need to pay wages to anyone)
then you could have it in init.sqs  as [] exec "wages.sqs"
or in a game logic trigger with a condition of true , either way it would be execed when the game starts.


if you wanna pause it you could have a @(startwages == true) or something similiar there to wait until the startwages condition is true again so it can continue.


yah vendor is the name of the marker where you'd like the car appear to.

You could also have the car there on the beginning alrdy aswell as you had in your first post and just have it locked down until you pay the cash.
This could be effective to have tons of cars on sight(altough could too many could lag)

But creating the vehicle on the spesific marker position would work too as you can pretty easily move it, or even preplace the car somewhere and have it getpos setpos-ed to the marker.

All sorta depends on what you would like it to end up as or look like :)

Waterman

  • Guest
Re:Money system...
« Reply #6 on: 23 Mar 2003, 14:43:43 »
Thanks again for that, but what I think I'm really after is for each player in an MP to have his own individual account, and rather than using sidechat to show items to buy, use the action menu like in the Cops and Robbers MOD.

From what you have said and given me, I think your scripts are for a side rather than individuals.  I you can modify it to work for individuals rather than teams, that would be excellent. :)

Cheers,
Waterman. :)


Rappy

  • Guest
Re:Money system...
« Reply #7 on: 23 Mar 2003, 15:14:54 »
Yah its not very much different :)

You have to have separate publicvars for each player in init like:

player1cash = 4000
player2cash = 2000
etc.


And then create an actionmenu system for the thing, I did some menu based on the action window once and it can eventually get quite complex like with subdirectories, since you need to also have another script run with each to kill all the old actions, then create the new ones (that are in the menu) and then make some action, "back" which would then load the old list again.

ok thats overcomplexed talk


What I mean:

in init.sqs

buymenu = player addaction ["Buy Cars", "buymenu.sqs"]
etc for the initial options in player action menu, if you want em to appear near buildings for example then all you needed to do for that was to add that same line to that object instead, might be wrong here though as you might also have to add a distance check:

?(player distance vendor < 10): player addaction ["buy cars", "buymenu.sqs"]


in buymenu.sqs you'd have to then summon the allmighty list of new stuff, like:

?(checker1>=1): [] exec "emptier1.sqs",checker1= 0, exit

#buy_menu
buyjeep = player addaction ["BUY JEEP (400$)", "buyjeep.sqs"]
buytruck = player addaction ["BUY TRUCK (500$)", "buytruck.sqs"]
checker1 = checker1 + 1
exit


Now where it gets complex is when it comes to getting rid of all the older actions and stuff like that especially when you have several menus
thats why I added that checker var, to make sure I dont have the menu run twice or anything like that.
and this way I can also close the menu if I select it again, you can leave it out if you have it come up when you are close to some building and then add another line there:
?(player distance vendor > 10): [] exec "emptier1.sqs"

which would also exec the script emptier1.sqs where you could clean all the actions that shouldnt be there anymore (thats why its important to add IDs so you can kill the actions)

in emptier1.sqs

Player RemoveAction buyjeep
Player RemoveAction buytruck
exit


I think this should work :D

However in mp you need to be extra sure that some things dont get mixed up.

so its good to add checks like ?(side player == west): exit
depending on which side the script was ment for or:
?(player == playername) to make it player dependant.

Waterman

  • Guest
Re:Money system...
« Reply #8 on: 23 Mar 2003, 16:00:43 »
Ok. That appears to be what I'm after... :D I'll try it out and get back to you if I have any problems or someone else...

Cheers,
Waterman. :cheers:

Waterman

  • Guest
Re:Money system...
« Reply #9 on: 23 Mar 2003, 17:44:31 »
How do you activate the "buy cars" menu?
I tried putting this in the init of the building I wanted to use and it game me an error...

Code: [Select]
?(player1 distance vendor < 10): player1 addaction ["buy cars", "buymenu.sqs"]
...where player1 is the name of a player. ;) and vendor was the name of the building I used.
I also tried that same code in a trigger and same error message...(I think it said something about invalid number or something). ::)

So what am I doing wrong?

Waterman.
« Last Edit: 23 Mar 2003, 17:45:08 by Waterman »

Rappy

  • Guest
Re:Money system...
« Reply #10 on: 23 Mar 2003, 23:04:00 »
hmph my mistake.

into a condition of something (trigger or a gamelogic):
player1 distance vendor < 10

on activation field:
player1 addaction ["buy cars", "buymenu.sqs"]

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #11 on: 23 Mar 2003, 23:51:06 »
dat meens he wil have 2 make difrent variable foreach player right ? - and addaction 4each player alone ? 2 heavy i think ;D - ill make somin betar tomoz and attach it here (need som time 2 work on it ;))

on da meantime waterman go and work on skye  ;)  ;D

@ rappy - if u wanna do dat script here is hint (or foor 4 though or watever ;D)

arrays is da key (actualy 1 array 4 all)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Rappy

  • Guest
Re:Money system...
« Reply #12 on: 24 Mar 2003, 17:22:05 »
Yah arrays make a lot of things easier, but I think they can sometimes be a bit complex aswell if you are just trying to get into scripting.

You could just have all of the players that you will use in the game in the array and launch its own script for all of em via:
"_x exec scriptname" ForEach arrayname

And yah now than I think about it, the script can be made shorter with an array :D
But it rarely is the first thing I think about for some reason  ;)

Waterman

  • Guest
Re:Money system...
« Reply #13 on: 24 Mar 2003, 20:08:59 »
Ok. Thanks LCD... You telling me what to do?! >:(  ;) LOL.

Waiting for that script(s)... ;)

Cheers Rappy also for you effort,
Waterman. :D

P.S. @LCD - Asmo has made a new mission like that one he made a while ago... Im going to get more kills than you are... ;) ;D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #14 on: 25 Mar 2003, 00:36:22 »
here is da script u want ;D

u wil need 2 make all da oder scripts but it should b simple  ;)  ;D

2 start an account (note da script is named LCD_Swiss_Bank - so its account ;))

do

["init",unitname,startinMoneyAmmount(number)] exec "LCD_Swiss_Bank.sqs"

2 show how much money dere is - do

["show",unitname] exec "LCD_Swiss_Bank.sqs" (it shows in hint now but it can b changed)

2 add or remove 2 account

["add_remove",unitname,ammount(can b negative number or positive number)] exec "LCD_Swiss_Bank.sqs"

now wen u use it w/ action script instead of unitname use _this select 1 in da action script (gives da name of da man who made da action ;D

im sure o forgot somin  ::) but u wil have 2 tel me wat ;D

:cheers:

tel me if u need more help on somin ;D

LCD OUT

P.S yes i do tel u wat 2 do :P i need dat island finished ;) and u wil never get higher score muhahahahahahaha
« Last Edit: 25 Mar 2003, 00:38:13 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #15 on: 25 Mar 2003, 19:53:54 »
I think I get what you mean... just need to clarify some stuff... ;)

Code: [Select]
["init",unitname,startinMoneyAmmount(number)] exec "LCD_Swiss_Bank.sqs" Does that go in the persons init field or someplace else like the init.sqs?

and...
Code: [Select]
["show",unitname] exec "LCD_Swiss_Bank.sqs"where does that go? How do you get that option in the action menu?

and...
Code: [Select]
["add_remove",unitname,ammount(can b negative number or positive number)] exec "LCD_Swiss_Bank.sqs"I take thats for if someone wants to buy a car say... so you would use a negative number to subtract money from a players account.  For wages you would use same code but use positive number, right? ???

And what is this "action menu" script your talking about?

Sorry for being a pain. I can usually understand you but when you talk about scripting and type like that, it gets hard to understand... ;) ;D

Cheers,
Waterman. ::)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #16 on: 25 Mar 2003, 22:29:54 »
lol ;D k here is wat u need ;D

1. Yes

2. make action like : show money (or somin like dat) and in da action script do

Code: [Select]
["show",_this select 1] exec "LCD_Swiss_Bank.sqs"
exit

3. yes

4. just 2 buy da line u need is (in da action script)

["add_remove",_this select 1,ammount(can b negative number or positive number)] exec "LCD_Swiss_Bank.sqs"

so every1 who uses da action pays from his own money ;D

:cheers:

btw u have 2 put LCD_Swiss_Bank=[] in da init.sqs

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #17 on: 26 Mar 2003, 17:49:18 »
It's giving me all sorts of errors... ::)

For a start is doen't like when you use "_this select 1"

I created a script called "action.sqs" and put this in it:
Code: [Select]
["show money",player5] exec "LCD_Swiss_Bank.sqs"
["add_remove",player5,20000] exec "LCD_Swiss_Bank.sqs"
exit

where player5 is me.
When I try and activate it via a trigger "On Activation field" using "[] exec action.sqs", I get an error message.

For this init.sqs I put:
Code: [Select]
LCD_Swiss_Bank=[]
["init",player1,100000] exec "LCD_Swiss_Bank.sqs"
["init",player2,100000] exec "LCD_Swiss_Bank.sqs"
["init",player3,100000] exec "LCD_Swiss_Bank.sqs"
["init",player4,100000] exec "LCD_Swiss_Bank.sqs"
["init",player5,100000] exec "LCD_Swiss_Bank.sqs"
["init",player6,100000] exec "LCD_Swiss_Bank.sqs"
["init",player7,100000] exec "LCD_Swiss_Bank.sqs"
["init",player8,100000] exec "LCD_Swiss_Bank.sqs"

What am I doing wrong now? :-[
« Last Edit: 26 Mar 2003, 17:50:32 by Waterman »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #18 on: 26 Mar 2003, 18:18:15 »
lol

["show money",player5] exec "LCD_Swiss_Bank.sqs"

should b

["show",player5] exec "LCD_Swiss_Bank.sqs"

 :P

read carefully ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #19 on: 26 Mar 2003, 18:50:04 »
Right I have no errors now, but it only shows you the money you have for a short time even if you have the trigger activated repeatedly.  It would also be nice to make the option available via the action menu.

Also how do I go about the shop thing?

I know this comes into it:

["add_remove",player5,20000] exec "LCD_Swiss_Bank.sqs"

but how do I make the option in the action menu like: "Buy Ferrari for $80000" appear? then make the car appear at a spot? I only want this option to appear when near a certain building.

I know I being a pain, but you missed out bits... ;) ::)

Sorry,
Waterman. :)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #20 on: 26 Mar 2003, 19:56:30 »
lol make da place and in its init write

this addaction ["Buy Ferrari for $80000","scripotname.sqs]

now in da script make

Code: [Select]
_man = _this select 1
["add_remove",_man,80000] exec "LCD_Swiss_Bank.sqs"

and use createvehicle 2 create da car werever u want :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

stalin

  • Guest
Re:Money system...
« Reply #21 on: 27 Mar 2003, 17:11:01 »
How would one interact with those money in another script?

For example if I wanted an action not to appear in a shop if I didn't have enough money.

Could I do something like tihs:

? (money <= 1000): goto "end"

or do I have to call the swiss_bank script. If so, how?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #22 on: 27 Mar 2003, 18:22:56 »
 :o :o :o
i know i forgot somin ;D

ill make somkin p nd put it here tomoz ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

stalin

  • Guest
Re:Money system...
« Reply #23 on: 27 Mar 2003, 19:19:04 »
Thanks. I really like that swiss_bank script..  thinking about using it in a mission if the problem can be solved.  :)

Waterman

  • Guest
Re:Money system...
« Reply #24 on: 27 Mar 2003, 19:48:32 »
Emm... how do I use createvehicle? ::)
To be more precise, how do I get the vehicle to appear when the option in the action menu is selected?

Cheers,
Waterman. :)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #25 on: 27 Mar 2003, 21:17:18 »
_name = "vehicletype" createvehicle position

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #26 on: 27 Mar 2003, 22:44:30 »
Right. I have almost got this figured out...

Just one last question... ;)

Rather than typing out lots of different scripts, is there something I can use instead of each players name? At the moment, this is what I have got:

Code: [Select]
["show",player8] exec "LCD_Swiss_Bank.sqs"
_man = _this select 1
["add_remove",_man,-80000] exec "LCD_Swiss_Bank.sqs"

vendor sidechat "Thank you for the purchase"
~5
"F360" CreateVehicle getmarkerpos "vendor"
["show",player8] exec "LCD_Swiss_Bank.sqs"
exit

Rather than using "player8" or "player whatever", can I use somethng that will apply for any player? Is it something like "_man" or something or is it just "player".

Cheers,
Waterman. :P

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #27 on: 28 Mar 2003, 04:04:11 »
just use da man ;D

 
_man = _this select 1
["show",_man] exec "LCD_Swiss_Bank.sqs"
["add_remove",_man,-80000] exec "LCD_Swiss_Bank.sqs"

vendor sidechat "Thank you for the purchase"
~5
"F360" CreateVehicle getmarkerpos "vendor"
["show",_man] exec "LCD_Swiss_Bank.sqs"
exit


i think u need 2 put name b4 da createvehicle ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #28 on: 28 Mar 2003, 17:09:16 »
O.K. Thanks... hopefully this will be it.

Waterman. :D

P.S. How do you add a check to make sure the player has enough money... ??? ;) ::)
« Last Edit: 28 Mar 2003, 17:24:19 by Waterman »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #29 on: 28 Mar 2003, 20:25:55 »
i said ill make somthin but itll take som time - ill post it tomoz i think :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #30 on: 29 Mar 2003, 20:22:20 »
i did it ;D

u need in da init.sqs


LCD_Check_Money= preprocessfile "LCD_Swiss_Bank_Check_Money.sqf"

now 2 check if da man have da moneydo it like dat (may cuse prob in trigs  :-X)

[unitname,amount(inNums)] call LCD_Check_Money

wil return true if he have da money and false if not  ;D 4 example in watermans script (edited 2 use da function)

Code: [Select]
_man = _this select 1
["show",_man] exec "LCD_Swiss_Bank.sqs"
if (not ([player,80000] call LCD_Check_Money)) then {hint "Dont try cheating LCD, He will send alot of armed people to shot you";exit}
["add_remove",_man,-80000] exec "LCD_Swiss_Bank.sqs"

vendor sidechat "Thank you for the purchase"
~5
"F360" CreateVehicle getmarkerpos "vendor"
["show",_man] exec "LCD_Swiss_Bank.sqs"
exit

just change da hint ;) ;D

LCD OUT

"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #31 on: 29 Mar 2003, 23:27:16 »
LOL! You mad LCD...

"if (not ([player,80000] call LCD_Check_Money)) then {hint "Dont try cheating LCD, He will send alot of armed people to shot you";exit}"

You been on the drugs again... ;) ;D
Waterman. ;D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #32 on: 30 Mar 2003, 00:42:46 »
me ? on drugs ?  :o no way

* smokes noder 1

 ::) ::) ::) ::) ::)

it works ?

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #33 on: 30 Mar 2003, 16:39:34 »
It appears to be working... :D

Can I ask you an off topic question... oh well, Im asking anyway... ::)

I have managed to set up a script based on the one you gave me earlier to rob a bank... this is what I have got so far:

Code: [Select]
_man = _this select 1
["show",_man] exec "LCD_Swiss_Bank.sqs"
["add_remove",_man,20000] exec "LCD_Swiss_Bank.sqs"

_mancash = _mancash - 8000
hintc "The bank has been robbed"
~5
["show",_man] exec "LCD_Swiss_Bank.sqs"
exit

Now how do I make the alarm noise go off for about half a minute, and de-activate the option to rob the bank during that time.  To activate the option I have put this in the init if it helps...
Code: [Select]
this addaction ["Rob the Bank","Robbank1.sqs"]
In other words a plyer could keep robbing the bank really quickly, rather than the option dissapearing for a while so they cannot cheat. :P Probably don't understand what Im meaning but nevermind... ::)

Cheers,
Waterman.

stalin

  • Guest
Re:Money system...
« Reply #34 on: 31 Mar 2003, 01:01:59 »
Great scrips LCD! Best money system I've found..

I'm going to use them in my mission if you don't mind..?
I'll give you credits  ;)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #35 on: 31 Mar 2003, 01:08:32 »
@ stalin

u dont have 2 gimme credits ;D

just go nd test ma misions :P (check da sig line and da beta testing thread ;D)- but u can gimme credits if u realy want 2 ;D  ;)

@ waterman

Code: [Select]
_man = _this select 1
["show",_man] exec "LCD_Swiss_Bank.sqs"
["add_remove",_man,20000] exec "LCD_Swiss_Bank.sqs"

_mancash = _mancash - 8000
hintc "The bank has been robbed"
(_this select 0) removeaction (_this select 2)
~5
["show",_man] exec "LCD_Swiss_Bank.sqs"
~25 <----------------------- change da time
(_this select 0) addaction ["Rob the Bank","Robbank1.sqs"]
exit

check da code - should do wat u want ;D

LCD OUT


« Last Edit: 03 Apr 2003, 19:18:30 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #36 on: 03 Apr 2003, 18:35:16 »
Emm... It does take away the action but it doesn't put it back after x (25) time. :P
Maybe it's because it doesn't know which building to apply the addaction command to...? ???

Waterman. :)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #37 on: 03 Apr 2003, 19:19:07 »
oops ;D

lol - i modified da script nd it should work now ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Waterman

  • Guest
Re:Money system...
« Reply #38 on: 05 Apr 2003, 14:01:02 »
That's great. All seems to be working well! :D
But I just remembered... ::) That script still allows the cops to rob the bank say... :P How do you make it that the script only works for certain players?

I take it you use a check code say, and if player1, player2 and player3 (who are cops), go to the bank, it wont work for them so that they cannot rob bank. You understand me?

Cheers,
Waterman. ::) :o ;D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #39 on: 05 Apr 2003, 19:17:52 »
da probw/ actions is dat every1 can use em 1ce dey r added 2 somin  :-\

but i can make it so no1 can rob da bank wen dere r comps in it  ;D

just use trig 2 check if 1 of da cops r in nd remove da action or  u can do somin like dat (wil make da action stay but wont allow em 2 rob da bank)

Code: [Select]
_man = _this select 1
? (_man =  player1) or (_man = player2) or (_man = player3) : hint "wat kind of cop r u ? u cant rob da bank - deyll know u"; exit
["show",_man] exec "LCD_Swiss_Bank.sqs"
["add_remove",_man,20000] exec "LCD_Swiss_Bank.sqs"

_mancash = _mancash - 8000
hintc "The bank has been robbed"
(_this select 0) removeaction (_this select 2)
~5
["show",_man] exec "LCD_Swiss_Bank.sqs"
~25 <----------------------- change da time
(_this select 0) addaction ["Rob the Bank","Robbank1.sqs"]
exit

"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Loc-Dog

  • Guest
Re:Money system...
« Reply #40 on: 05 Apr 2003, 19:27:41 »
Remember to post this mission on this topic when you have a beta version of it so we can try it, I can't wait to robb those suckers blind!!

Waterman

  • Guest
Re:Money system...
« Reply #41 on: 05 Apr 2003, 19:41:28 »
Right, I think I know what to do...

So you can do this or something simular?:

Code: [Select]
_man = _this select 1
["show",_man] exec "LCD_Swiss_Bank.sqs"
? (_man = player1) or (_man = player2) or (_man = player3) or (_man = player4) : (_this select 0) removeaction (_this select 2); exit
["add_remove",_man,20000] exec "LCD_Swiss_Bank.sqs"

_mancash = _mancash - 8000
hintc "The bank has been robbed"
playsound "alarm"
(_this select 0) removeaction (_this select 2)
~5
["show",_man] exec "LCD_Swiss_Bank.sqs"
~25
(_this select 0) addaction ["Rob the Bank","Robbank1.sqs"]

I'll try a few things out and hopefully get what Im after...

Cheers,
Waterman. :)

P.S. When I have a beta map ready I'll tell you... ;)
« Last Edit: 05 Apr 2003, 19:50:42 by Waterman »

Offline zip

  • Members
  • *
  • Zip mission maker of WW2ec team
Re:Money system...
« Reply #42 on: 12 Apr 2003, 12:17:30 »
can you guys please post the FULL buy script ?!!!
"words wich isnt is bringed to action, isnt worth saying.."

Offline D.murphy man

  • Members
  • *
  • I'm a llama!
Re:Money system...
« Reply #43 on: 12 Apr 2003, 14:25:19 »
And i nice little example mission  ;D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Money system...
« Reply #44 on: 12 Apr 2003, 15:15:28 »
dere is no full buy script :P

dere is my SWIS_BANK script nd it can b put in meny difrent situations - read nd c :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta