This is what i have now..
[lua]require( "mysql" )
local db, error = mysql.connect("", "", "", "")
if (db == 0) then print(tostring(error) .. "\n") return end
print("connection opened - " .. db .. "!\n");
grabgc, isok, error = mysql.query(db, "SELECT gccash FROM gcusers WHERE steamid='" .. ply:SteamID .. "'");
if (grabgc) then
PrintTable(test)
end
if (!isok) then
print(tostring(error) .. "\n");
end
-- Lua generated by DermaDesigner
function shop()
local DTextEntry2
local DTextEntry1
local DButton1
local Skull
local main
DTextEntry2 = vgui.Create('DTextEntry')
DTextEntry2:SetSize(40, 20)
DTextEntry2:SetPos(105, 175)
DTextEntry2:SetText('100 GC')
DTextEntry2.OnEnter = function() end
DTextEntry1 = vgui.Create('DTextEntry')
DTextEntry1:SetSize(50, 15)
DTextEntry1:SetPos(95, 90)
DTextEntry1:SetText('Skull Hat')
DTextEntry1.OnEnter = function() end
DButton1 = vgui.Create('DButton')
DButton1:SetSize(70, 25)
DButton1:SetPos(470, 400)
DButton1:SetText('Buy')
DButton1.DoClick = function() end
DButton2 = vgui.Create('DButton')
DButton2:SetSize(70, 25)
DButton2:SetPos(470, 400)
DButton2:SetText('Buy')
DButton2.DoClick = function() end
Skull = vgui.Create('SpawnIcon')
Skull:SetPos(90, 115)
Skull:SetToolTip('Change your head into a FUCKING SKULL YEAH!')
PropertySheet:AddSheet( "Regular Users", Skull, "gui/silkicons/user", false, false, "Anyone can buy from here!" )
PropertySheet:AddSheet( "VIPS Only", DButton2, "gui/silkicons/group", false, false, "You must buy vip and GC cash to get this menu!! <3" )
main = vgui.Create('DFrame')
main:SetSize(480, 380)
main:Center()
main:SetTitle('GC Hat Shop')
main:SetDeleteOnClose(false)
main:MakePopup()
end
concommand.Add("shop_menu", shop)[/lua]
Now i want it to spawn entity's (Hat and glasses) and then remove the amount needed to buy that entity.. But i have no idea how to do that :/ Last thing is to have it print the amount you have in the menu
So what i need to know is
1.adding/removing amounts
2.showing how much you have in the menu
3.only being able to buy when you have enough
Someone please help :/
[editline]28th February 2011[/editline]
:BUMP:
Anyone?
The people who rated you dumb are the exact downfall of this community. But I will tell you that what you want to do is keep your Derma clientside, and use the server to run the MySQL queries.
I rated him dumb because all he did was post a random code, then ask a really confusing question that doesn't help anyone complete this code.
[editline]2nd March 2011[/editline]
I'd be willing to help if he offered the names of the entities/more info on exactly what he needed.
Why do you need mysql for this, use sqllite its much simpler, if you don't plan on using your server with a website or other servers, use sqllite
Sorry, you need to Log In to post a reply to this thread.