Forum Jump :

Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2011-07-06 21:56        
     
Hello, i have been making a mission for some time now and i have it almost done. The only thing i am missing is a script to give money to another player at the same time it takes money from you. I have looked far and wide yet have not found anything on this and i have posted on other sites yet have had no help. This is what i have but it does not seem to work, if some one could help me out I would be in your debt.

_target = cursorTarget;
if (Mymoney < 250) then {
	Mymoney = Mymoney - 250;
	hint "you gave the person money"}
	
if (_target == !Alive) then {
	 Mymoney = Mymoney + 250 (cursorTarget)};

Thank you in advance for any help you can offer


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 44
In-game name: kylania

 
#2 Posted at 2011-07-07 00:21        
     
There's some syntax errors in there, but how exactly are you calling that?

Unless you'll only ever do transactions in 250 increments you'll probably want to make that a function that can take input instead of hard coded to the 250 amount.


Advertisement


Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2011-07-07 01:59        
     
Well i am not the best at scripting so i was using the fixed money as a base till I get better, is there a better way I can do it? An example would be nice but from what i know it would be rather complex.


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 44
In-game name: kylania

 
#4 Posted at 2011-07-07 07:43        
     
I'm asking more of a mechanical standpoint, as in how is money used in your mission and how exactly do you want to be able to transfer it.

You use cursorTarget meaning you point at someone and use an action menu to transfer money but why and what for?:)


Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2011-07-07 17:31        
     
I use the money for NPC traders so that you can buy items all the way from a simple map to buying like the MI17 (this i have down already and was rather simple its the money to players i need help with). I would like it more if i could put an input into my give money command so that it is less of a pain to give other players money, for example lets say one of my players gives another a small mission to do (it an RP game mode) for about $1000 or so I need the cursorTarget so that he can give that player the money directly. Another example would when players have the right amount of money they can buy the power to become a trader themselves and sell some items. I need to make it so that the player buying can give the playertrader money.


Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2011-07-13 02:22        
     
Ok i have fixed up my script a little to make it work better and this is what i have
_DCPlayer = _this select 0; 
_target = cursorTarget; 
_kv = _DCPlayer knowsAbout _target; 

if (_kv == 4) then { 
    if (player == _DCPlayer) then { 
    	Mymoney = Mymoney -100;
    	_DCPlayer (Mymoney = Mymoney + 100);
    };
    
    };

its fine untill i add the "_DCPlayer (Mymoney = Mymoney + 100);". I am not the best scripter and could use a little help, can anyone assist me?






Tags: Give, Money, Target