Server Refund System.

So, my role play server has a lot of players, with a lot of stuff, sadly some addons, mainly cars, are removed from the server for versions reasons, e.g A Ford Mustang can be exploited in a way we’re it’s down to the design of the model and can’t be fixed by us.

And well, players spend time making money, it’s not like on DarkRP were it take a mere 2 hours to get one million but 2 days to get 48k.

But the issue as it stands is, it’s a hassle the refund the players, I have an inventory system (one of the few things on the server I did not create my self) and I was wondering how I could creat a ‘if statement’ with a list of items which have been removed from the server, and it checks to see if a player has it, gets removed and refunds them the correct Ammount and then notify them, saying “The” …item… “Has been removed, and you have been refunded” …Ammount… “!”.

And were I would put this script.

The server is running DarkRP.



Either you too stoned or you miss under stood what I said, when i remove an addon from the server such as a car I want it to automaticly refund a player if they had purchased that item witch was from the addon.

you shouldn’t be removing addons at such a high rate that you would need this addon.

If you coded the rest of the addons why is this giving you trouble. Have “your” code check for players inventories on connect (all players) and save that inventory, then remove that addon and then have your code give players x amount of money for those items gone.(e.g. you define how much those items cost)

If you know how your inventory/vehicle table works, you could have a table of items that aren’t compatible (check below), and check in relation to the player’s items. if that item exists in the player’s vehicle storage/inventory remove it and refund with the value in the table.

[lua]removedItems = {
[“m9k_ak47”] = 2500,
[“m9k_hk45”] = 1200

An example of a table structure right there for ya.

In my inventory system I use a meta function called **hasItem **that checks for the identifier of an item to see if a player has it. If it returns true then I could remove the same item. This would be called when the player spawns just for convenience.

It’s not gonna be possible to make it fully automatic for everything you don’t have, and if you’re removing addons left right and center - you’ll be pissing off your players. Trust me with that, we had a vehicles system once in my server and we switched car pack, refunding everyone with the vehicle’s original value, and people were very pissed off.

Good luck!

I don’t understand how this is giving you trouble. If you created almost the entire server, this should be a piece of cake.

I’m not removing them at such a high rate, it’s just, players could lie, I removed like one car in 8 months, the last time I did, the just abused the fact we did not know who owned what car.

Removing an addon does not remove the database … FYI

Agree, bought cars - eg car dealers often store it inside the data/ folder, if not, get the database files and view them.

If you’re not entirely certain on who owned the car, then something is definitely wrong with your system.

Just post a job on scriptfodder for this. This isn’t a complicated script but aint nobody going to do it for you for free tbh.