• Print

Author Topic: Custom Pointshop  (Read 6282 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Custom Pointshop
« on: March 08, 2015, 07:48:57 pm »
Hi,

So Im custom coding a Pointshop tab. Heres what I've got


You might think "THATS SO COOL"

It is but its not exact. I see as we know the most famous TTT server, SeriousTTT, their tabs are custom coded and from what I see, they use the Pointshop format. How do I do that so an equip button appears and the notification appears while keeping my custom theme?

Note: Its a mac10 and not D round because its simple and good for testing!

P.S: How do I add text to that tab only?
__category code
Code: Lua
  1. CATEGORY.Name = 'Role'
  2. CATEGORY.Icon = 'user_suit'
  3. CATEGORY.AllowedEquipped = 1
  4. CATEGORY.Desc = "Become a certain role next round!"
  5.  
  6. function CATEGORY:ModifyTab(tab)
  7.     local button = vgui.Create('DButton', tab)
  8.  
  9.     button:SetText('Buy for 1 round')
  10.     button:SetSize(130, 20)
  11.     button:SetPos( 85, 60 )
  12.     button.Paint = function( self, w, h )
  13.         draw.RoundedBox(0, 0, 0, w, h, Color(41, 128, 185, 250) )
  14.     end
  15.     button.DoClick = function ()
  16.      print( "Buying a Mac10!" )
  17.      net.Start( "BuyItem" )
  18.      net.WriteString( "PurchasedBigGun" )
  19.      net.SendToServer()
  20.     end
  21.  
  22.     local detective = vgui.Create("DImage", tab)
  23.     detective:SetPos(10, 10)
  24.     detective:SetSize(75, 75)
  25.     detective:SetImage("VGUI/ttt/icon_det")
  26. end
Network code in sv_init.lua
Code: Lua
  1. net.Receive( "BuyItem", function( len, ply )
  2. elseif net.ReadString() == "PurchasedBigGun" and ply:PS_HasPoints(600) and not ply:IsSpec then
  3. ply:Give("swb_mac10")
  4. ply:PS_TakePoints(600)
  5. end
  6. end )
  7.  
« Last Edit: March 08, 2015, 07:56:42 pm by BuilderGaming »
Newb Coder. Soon to get better

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Pointshop
« Reply #1 on: March 08, 2015, 09:09:59 pm »
You might want to share some more details about this "SeriousTTT" tab, because we don't know what you're trying to mock. Also, as for PointTab, because some of us may not know entirely what PointShop is or does, so try to explain what you're wanting it to do in your version. Also, what do you mean by "notification"?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Re: Custom Pointshop
« Reply #2 on: March 08, 2015, 09:39:56 pm »
You might want to share some more details about this "SeriousTTT" tab, because we don't know what you're trying to mock. Also, as for PointTab, because some of us may not know entirely what PointShop is or does, so try to explain what you're wanting it to do in your version. Also, what do you mean by "notification"?
Serious TTT Pointshop {Custom coded}


If I were to buy something, the buy would change to a "sell" and beside it it would change to "holster", the normal Pointshop command to not have what the bought item does.

The notfication is this. It happens when you buy something.
{Coming ASAP}

What pointshop is:
http://facepunch.com/threads/1286577
Newb Coder. Soon to get better

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom Pointshop
« Reply #3 on: March 09, 2015, 12:10:51 am »
Alright, well now that everyone knows what you want... I believe it's above my capability, as I do not like client side or understand it really, someone else here can possibly assist you with what you need. I only said what I said to give everyone else more details.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

  • Print