Jump to content
Leon0803

Money Dispencer (NPC)

Recommended Posts

Hello community, i got following problem.

 

i know that there are commands like "life_cash = 400000;"

 

to add money to your account, id like to make a npc tho which has the same function (you go to him, make a mousewheel scroll, confirm and get the money, a sort of "money dispenser")

 

sadly nomatter how i try to implement it in a npc, it wont work.

 

my best attempt so far was "AddAction[life_cash = 400000];" but that didnt work either, so what am i doing wrong?

Share this post


Link to post
Share on other sites
addAction ["Take Cash",{life_cash = life_cash + 4000000; hint "You have taken the cash";},"",0,false,false,"",'(alive player) AND !dialog && ((player distance _target) < 2)'];

That will work

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, Dexterio said:
addAction ["Take Cash",{life_cash = life_cash + 4000000; hint "You have taken the cash";},"",0,false,false,"",'(alive player) AND !dialog && ((player distance _target) < 2)'];

That will work

Don't forget 'this'!

Share this post


Link to post
Share on other sites

So it's just unlimited money from an NPC?

q-q

That's going to be a realistic server. I wish money was free in real life. ;-;

Share this post


Link to post
Share on other sites
2 hours ago, 14e_Senator_Walter said:

So it's just unlimited money from an NPC?

q-q

That's going to be a realistic server. I wish money was free in real life. ;-;

i want the NPC for testing purpose for staff members who i dont want to give money for testing purpose myself all the time, but neither the right to give it to theirself.

Share this post


Link to post
Share on other sites
10 hours ago, Liam said:

Don't forget 'this'!

so does

addAction ["Take Cash",{life_cash = life_cash + 4000000; hint "You have taken the cash";},"",0,false,false,"",'(alive player) AND !dialog && ((player distance _target) < 2)'];

 

work or do i need to add something?

Share this post


Link to post
Share on other sites
41 minutes ago, Leon0803 said:

work or do i need to add something?

Just add 'this' infront of it like this.

this addAction ["Take Cash",{life_cash = life_cash + 4000000; hint "You have taken the cash";},"",0,false,false,"",'(alive player) AND !dialog && ((player distance _target) < 2)'];

Put the above code in the init section of the NPC and it should work.

43 minutes ago, Leon0803 said:

i want the NPC for testing purpose for staff members who i dont want to give money for testing purpose myself all the time, but neither the right to give it to theirself.

So it's a temporary thing that's going to be removed? I guess that makes sense. :) 

Share this post


Link to post
Share on other sites
3 minutes ago, 14e_Senator_Walter said:

Just add 'this' infront of it like this.

this addAction ["Take Cash",{life_cash = life_cash + 4000000; hint "You have taken the cash";},"",0,false,false,"",'(alive player) AND !dialog && ((player distance _target) < 2)'];

Put the above code in the init section of the NPC and it should work.

So it's a temporary thing that's going to be removed? I guess that makes sense. :) 

thank you!

 

and yes it is, it will be removed once the testing is done.

Share this post


Link to post
Share on other sites

It makes absolutely no sense to me why you wouldn't just give them comp ability then wipe their bank accounts when your testing phase is complete......

Share this post


Link to post
Share on other sites
On 5/28/2018 at 2:29 PM, 14e_Senator_Walter said:

Just add 'this' infront of it like this.

this addAction ["Take Cash",{life_cash = life_cash + 4000000; hint "You have taken the cash";},"",0,false,false,"",'(alive player) AND !dialog && ((player distance _target) < 2)'];

Put the above code in the init section of the NPC and it should work.

So it's a temporary thing that's going to be removed? I guess that makes sense. :) 

does this command work with version 4.4? still havin some problems with it :c

Share this post


Link to post
Share on other sites
8 hours ago, Leon0803 said:

does this command work with version 4.4? still havin some problems with it :c

To be honest, I don't know why you're making this in the first place. Instead of doing this, where you're obviously having issues. Just set their admin level in the database, allow them to use the Altis Life admin menu and compensate themselves to spawn in money. After the 'testing period' just remove their money and take away their admin level if you don't want them to have it anymore. 

  • Like 1

Share this post


Link to post
Share on other sites

No need for passing arguments and having conditions, just simply add the following and then bam.

this addAction ["Take Cash",{life_cash = life_cash + 5000000; hint "You have taken the cash";}]

Once again I think this is pointless but this will do what you want.

Share this post


Link to post
Share on other sites
15 hours ago, KillerAussie said:

No need for passing arguments and having conditions, just simply add the following and then bam.

this addAction ["Take Cash",{life_cash = life_cash + 5000000; hint "You have taken the cash";}]

Once again I think this is pointless but this will do what you want.

thank you.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×