DIRTY MONEY SYSTEM

public functions usage guide

add this to your class MyScirptName : Script

public bool UseDirtyMoney;

add this to your MyScriptName()

UseDirtyMoney = File.Exists("scripts/Dirty Money.dll");

add this after your MyScriptName()

1
2
3
4
5
6
7
8
private void AddDirtyMoney(int value)
{
 Assembly DirtyMoneyDLL = Assembly.LoadFrom("scripts/Dirty Money.dll");
 Type Dirty_Money_AddRemove = DirtyMoneyDLL.GetType("Dirty_Money.AddRemove");
 MethodInfo AddDirtyMoney = Dirty_Money_AddRemove.GetMethod("AddDirtyMoney");
 object[] parametersArray = new object[] { value };
 AddDirtyMoney.Invoke(AddDirtyMoney, parametersArray);
}

now, where in your script you add money to player, do this:

1
2
3
4
if (UseDirtyMoney == true)
{ AddDirtyMoney(value_from_your_script); }
else
{ Game.Player.Money += value_from_your_script; }

other functions you may want to use are:

DirtyMoneyWalletValue(), to know how much dirty money player are carrying

1
2
3
4
5
6
7
private int DirtyMoneyWalletValue()
{
Assembly DirtyMoneyDLL = Assembly.LoadFrom("scripts/Dirty Money.dll");
Type Dirty_Money_AddRemove = DirtyMoneyDLL.GetType("Dirty_Money.AddRemove");
MethodInfo DirtyMoneyWallet = Dirty_Money_AddRemove.GetMethod("DirtyMoneyWallet");
return (int)DirtyMoneyWallet.Invoke(DirtyMoneyWallet, null);
}

DeductDirtyMoney(value_you_want), to deduct dirty money from player

1
2
3
4
5
6
7
8
private void DeductDirtyMoney(int value)
{
Assembly DirtyMoneyDLL = Assembly.LoadFrom("scripts/Dirty Money.dll");
Type Dirty_Money_AddRemove = DirtyMoneyDLL.GetType("Dirty_Money.AddRemove");
MethodInfo DeductDirtyMoney = Dirty_Money_AddRemove.GetMethod("DeductDirtyMoney");
object[] parametersArray = new object[] { value };
DeductDirtyMoney.Invoke(DeductDirtyMoney, parametersArray);
}
Edit
Pub: 13 Dec 2021 08:29 UTC
Edit: 13 Dec 2021 08:39 UTC
Views: 1710