How to make a buymenu

Ello ello

Came onto the forums looking for a thread about buy menus or something, couldn’t find anything. I’ve also looked at the coding for CakeScript and DarkRP, but it was all mashed up in notepad, so I couldn’t make sense of it :S. So yeah, looking for someone who can point me in the direction to making a buy menu.

This? -

Basically make a money code:

[lua]local meta = FindMetaTable(“Player”)

function LoadMoney(pl)
if file.Exists(“money/”…pl:UniqueID()…".txt") then

function SaveMoney()
for k,v in pairs(player.GetAll()) do

function meta:AddMoney(amt)

function meta:GetMoney()
return tonumber(self:GetNWInt(“money”))

And then take the code for the Derma menu and items from the point mod, and make it when you buy certain stuff, it removes a certain amount of money from the players wallet, but say “You cannot afford this!” when they don’t have enough, if you’re still not sure, look how Rick Darkliano did it in DarkRP.

Hope this helps :smiley:

Nvars are bad as all clients get the information that they dont need for example one players money will be readable by anyone

Having an individual file for each player is kinda stupid too, especially when you can just use SQL.

Use MySQLite.

You mean SQLite.

I preferr MySQL, its fast and wont corrupt like hell as SQLite tends to do for me :saddowns:

Yeah, it’s kind of a habit to type “My” in front of Sql hah.

Here this may help you, Entoros posted this in another thread for someone, but this is 100% Entoros not mine, all credit goes to him.

Danke you all very much for the help :stuck_out_tongue:

You are fucking retarded.
My pointmod does exactly that, but a** lot **better

Yes, i’m fucking retarded, but so are you to flame.

Hows the air up on the high horse o’ yours?
This is the “Newbie questions” section. Don’t flame people who are trying to help others/learn.

The first step is admitting you are well done you have come a long way

This will certainly help, but it´s the most unoptimized way I could ever think of.

You’re seriously stalking HeavyMtl123.


Nice spelling, btw.