OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Serial Killer on 12 Jan 2005, 18:20:12

Title: I need script help!!
Post by: Serial Killer on 12 Jan 2005, 18:20:12
I need script help! If somebody can create scripts like this, e-mail at tomi.koivula@kotinet.com

You have to create few money scripts, like this.. In Init script, player has 200 dollars. When the player buys a weapon, he loses 200 dollars. When the player burglarizes a bank, he wins 500 dollars, something like that..

Please help me! I will do anything.. :'( Thanks in advance!
Title: Re:I need script help!!
Post by: Silencer on 12 Jan 2005, 18:37:35
Why don't you ask the makers of the Noville mission if you can use their scripts?
Title: Re:I need script help!!
Post by: Serial Killer on 12 Jan 2005, 18:41:22
Where can I find Noville mission?? Hmm.. Wait a minute! Now I remember where I can find Noville.. It is a MP mission right? If it is, I can find it..
Title: Re:I need script help!!
Post by: RujiK on 12 Jan 2005, 18:46:22
Or, why not just make your own script?
Just put in the init.sqs file Cash=200
Then too buy the weapon put in the script
?(Cash <= 200):hint"You dont have enough cash!";exit
hint"You got a glock!"
ap addmagazine "Glockmag"
ap addweapon "glock"
Cash=cash-200


And that would work for buying a weapon.
For the tank just put

?(ap in Tank):cash=cash+500;hint"you got 500 bucks!!"

Really very simple.
Title: Re:I need script help!!
Post by: Serial Killer on 12 Jan 2005, 19:00:37
Cool, I owe you one, buddy! I will send that mission where I need that script, if you want ;) You earn it!!
Title: Re:I need script help!!
Post by: RujiK on 12 Jan 2005, 19:10:48
Um, actually I just made that script up,
glad you like it though.
If you have anymore questions just PM me.
Title: Re:I need script help!!
Post by: Serial Killer on 12 Jan 2005, 21:08:55
Well, I have a problem again..

How I can add an Action to player when he's near a man named Man1?? If that man is dead, the trigger has to be deleted.. When the player left's the trigger area, the action must be deleted.

Is it possible that the trigger follows that man named Man1? If the Man1 moves somewhere, the trigger follows him..? Thanks in advance!

Ps: Sorry about my English, it's not a perfect :-\
Title: Re:I need script help!!
Post by: Triggerhappy on 12 Jan 2005, 21:58:47
just add the action to man1
when a player gets near him the action will appear

btw, Yes you can make a trigger follow someone:
name the trigger and put it in a setpos loop (a script)
#loop
trigger1 setpos getpos man1
~.1
goto "loop"
Title: Re:I need script help!!
Post by: Serial Killer on 13 Jan 2005, 14:17:17
Oh no, I have a problem again  I use a removeAction function, but the action wont be deleted..?
 
Code: [Select]
OnActivition: steal = ap addaction ["Steal money","Money.sqs"]
OnDeactivation: ap removeAction steal

Did I do something wrong?
Title: Re:I need script help!!
Post by: RujiK on 13 Jan 2005, 18:02:47
Removeaction command seems too be a little faulty.
Instead of having "removeaction steal" try ap Removeaction 0;ap removeaction 1
Title: Re:I need script help!!
Post by: Serial Killer on 13 Jan 2005, 20:04:02
Thanks!