Skip to content

Using the Wallet

Hannele Ruiz edited this page Jan 2, 2021 · 1 revision

Using the PlayerCompanion wallet system in your own mod is pretty easy to implement.

Manipulating the current Money

It is very easy to change the money of any of the player peds.

Current Player Ped

The property Companion.Wallet.Money allows you to change the Money on the wallet of the current player ped. This property will always point to the current player ped.

Specific Player Ped

The Companion.Wallet class allows you to get or set the money of any ped model via the indexer. You just need to pass the Ped Model and you will be able to change the money of a specific ped, like this:

// The Model struct allows implicit casts, so all of this examples are valid
int llenn = Companion.Wallet["llenn"];      // LLENN (addon ped)
int lamar = Companion.Wallet[1706635382];   // Lamar
Companion.Wallet[1302784073] = 0;           // Lester
Companion.Wallet["ig_jimmydisanto"] = 420;  // Jimmy

How is the Money saved

For Trevor, Michael and Franklin, the money is stored on the savegame just like normal. For all other pedestrians and addons, it is stored on Money.json in the PlayerCompanion directory.