• PointShop for Garry's Mod 13 v2
    273 replies, posted
Anyone know how to prevent items from automatically equipping on join? It seems to conflict with the SledBuild gamemode, have to re-equip everything to get it to work. Same version of PS doesn't happen on Deathrun.
[QUOTE=Ambro;40498838]Where the heck does the player data get saved by default, I can not find it anywhere on my server.[/QUOTE] in your garrysmod/garrysmod folder, there's a file named sv.db That will contain the pointshop data, it's written in mysqlite
[QUOTE=Ambro;40498838]Where the heck does the player data get saved by default, I can not find it anywhere on my server.[/QUOTE] as said by Eccid, it's located in a file called sv.db which you can browse with for example: [url]http://sqlitebrowser.sourceforge.net/[/url] [QUOTE=Eccid;40511781]in your garrysmod/garrysmod folder, there's a file named sv.db That will contain the pointshop data, it's written in mysqlite[/QUOTE] It's sqlite, mysqlite does not exist.
[QUOTE=BlackVoid;40513130]It's sqlite, mysqlite does not exist.[/QUOTE] Yeah, that's called a typo.
So, for some reason, Hats are not downloading from our server anymore, we haven't changed anything to do with where the pointshop and pointshop extra hats models or textures are, but after deleting my downloads folder, the models and textures don't download anymore. does anyone else have the same problem?
How would I go about added TTT weapons and insta T and D to the shop? Thanks for the help!
Its the same questions over and over again. If you just Google it you will get your answers but here. [lua] TRAITOR = ITEM.Name = 'Traitor' ITEM.Price = 3000 ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt' ITEM.OneUse = true function ITEM:OnEquip(ply, modifications) hook.Add("TTTBeginRound", ply:UniqueID() .. "_traitor", function() if ply:GetRoleString() != "traitor" then ply:SetRole(ROLE_TRAITOR) ply:AddCredits(GetConVarNumber("ttt_credits_starting")) end if SERVER then ply:PS_TakeItem(self.ID) end hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end) end function ITEM:OnHolster(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end function ITEM:OnSell(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end -------------------------------------------------------------------------- DETECTIVE = ITEM.Name = 'Detective' ITEM.Price = 3000 ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt' ITEM.OneUse = true function ITEM:OnEquip(ply, modifications) hook.Add("TTTBeginRound", ply:UniqueID() .. "_detective", function() if ply:GetRoleString() != "detective" then ply:SetRole(ROLE_DETECTIVE) ply:AddCredits(GetConVarNumber("ttt_credits_starting")) end if SERVER then ply:PS_TakeItem(self.ID) end hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end) end function ITEM:OnHolster(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end function ITEM:OnSell(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end [/lua]
[QUOTE=whyknot;40592052]How would I go about added TTT weapons and insta T and D to the shop? Thanks for the help![/QUOTE] Not sure why Thetomm2010 was being a dick but here, i'l try and help. To add TTT weapons the pointshop create a lua file into this directory: addons/PointShopAddon/lua/items/AnyFolder/anynameyouwant.lua I can't remember exactly what the pointshop is called in the addons directory. Once you have created that lua file in that directory put this code: [lua]ITEM.Name = 'NAME HERE' ITEM.Price = 3000 ITEM.Model = 'MODEL DIRECTORY HERE' ITEM.WeaponClass = 'WEAPON LUA FILE NAME' function ITEM:OnEquip(ply) ply:StripWeapon('WEAPON LUA FILE NAME') ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnHolster(ply) ply:StripWeapon(self.WeaponClass) ply:SelectWeapon('WEAPON LUA FILE NAME') end[/lua] And that's it, obviously you need to fill out 'name here' ect. If you do not know the 'model directory' then this is a example of a katana directory my server uses: models/weapons/w_katana.mdl The 'weapon lua file name' is the weapon code, so my weapon code was titled weapon_zm_katana and that was located in gamemodes/terrortown/entities/weapons/
I have a problem with the 50% thing off for certain groups. It shows up as 50% but it doesn't actually work. this is my sh_config.lua [code]PS.Config = {} -- Edit below PS.Config.DataProvider = 'pdata' PS.Config.Branch = "https://raw.github.com/adamdburton/pointshop/master/" -- Master is most stable, used for version checking. PS.Config.CheckVersion = true -- Do you want to be notified when a new version of Pointshop is avaliable? PS.Config.ShopKey = "F3" -- F1, F2, F3 or F4, or blank to disable PS.Config.ShopCommand = 'ps_shop' -- Console command to open the shop, set to blank to disable PS.Config.ShopChatCommand = '!shop' -- Chat command to open the shop, set to blank to disable PS.Config.NotifyOnJoin = true -- Should players be notified about opening the shop when they spawn? PS.Config.PointsOverTime = true -- Should players be given points over time? PS.Config.PointsOverTimeDelay = 1 -- If so, how many minutes apart? PS.Config.PointsOverTimeAmount = 10 -- And if so, how many points to give after the time? PS.Config.AdminCanAccessAdminTab = false -- Can Admins access the Admin tab? PS.Config.SuperAdminCanAccessAdminTab = false -- Can SuperAdmins access the Admin tab? PS.Config.CanPlayersGivePoints = true -- Can players give points away to other players? PS.Config.DisplayPreviewInMenu = true -- Can players see the preview of their items in the menu? -- Edit below if you know what you're doing PS.Config.CalculateBuyPrice = function(ply, item) -- You can do different calculations here to return how much an item should cost to buy. -- There are a few examples below, uncomment them to use them. -- Everything half price for admins: -- if ply:IsAdmin() then return math.Round(item.Price * 0.5) end --25% off for the 'donators' group if ply:IsUserGroup('donor') then return math.Round(item.Price * 0.5) end return item.Price end PS.Config.CalculateSellPrice = function(ply, item) return math.Round(item.Price * 0.75) -- 75% or 3/4 (rounded) of the original item price end [/code]
[QUOTE=pkhzor;40625743]I have a problem with the 50% thing off for certain groups. It shows up as 50% but it doesn't actually work. this is my sh_config.lua [/QUOTE] You need to open your cl_player_extension.lua and delete or comment out line 22 [code]if not self:PS_HasPoints(PS.Items[item_id].Price) then return false end[/code] It seems to be a check put in before he added the percentage feature and never removed. There's also an issue of discounted items selling as if they were full price. You need to modify the sell price in your config to reflect the correct sale percentage per usergroup. For example, my admins get 50% off in the pointshop: [code] if ply:IsAdmin() then return math.Round(item.Price * 0.5) end[/code] So theire sale price has to take in account for the reduced buy price: [code] if ply:IsAdmin() then return math.Round(item.Price * 0.375) end[/code] Otherwise your users can buy items and resell them to make easy points.
anyone else having issues with certain players points randomly resetting?
[QUOTE=Vexas;40656058]anyone else having issues with certain players points randomly resetting?[/QUOTE] happens often on my server
[QUOTE]anyone else having issues with certain players points randomly resetting? [/QUOTE] read the past posts this has been a problem from the beginning
On my server the items just reset not the points. In frustrated with it and I'm not sure of this problem is related the to mysterious disappearing points.
just wondering if anyone has a found a fix, guess not
The disappearing points thing wasn't a permanent points loss, say if the map changed people would get them back. but yeah it was definitely an issue with the Sqlite version. We have switched to MySQL and haven't had this issue again.
[QUOTE=ikoN420;40661979]The disappearing points thing wasn't a permanent points loss, say if the map changed people would get them back. but yeah it was definitely an issue with the Sqlite version. We have switched to MySQL and haven't had this issue again.[/QUOTE] After switching to mysql, point loss has dropped immensely, but it still happens from time to time. It seems mainly when specific people crash, or disconnect at a weird time.
even not using mysql, some players points permanently reset
The issue page is down on the github so I'll ask this here, When a player buys and equips a hat, then leaves it doesnt show them with the hat on when they rejoin. They have they holster it and equip it again. Any idea why it does this?
Vilusia If they re-spawn, they get it back. It's really weird, I plan on looking into it/trying to fix it myself.
Well it's stranded so they can't respawn. If they die they lose all their tools and items.
yeah, maybe slay and respawn them before equiping their loadout upon join.
Uh no.. Did you not read what I just said? All the items are stored in a database and load as soon as they join. Edit: Never it actually did work. I added this to the InitialSpawn for the player: [CODE]timer.Simple(0.1, function() ply:Spawn() end )[/CODE] Thanks scratch :D
I cant find the code posted from before but how would you make it to that when Traitors win or kill innocents/detectives on TTT, they get a certain amount of points?
Here's one I wrote for a deathrun server [CODE]local amount = 10; hook.Add( "PlayerDeath", "KillPoints", function( victim, weapon, killer) if( IsValid( killer ) and IsValid( victim ) ) then if( killer:IsPlayer() and victim:IsPlayer() ) then if ( killer:Team() == TEAM_RUNNER and victim:Team() == TEAM_DEATH ) then killer:PS_GivePoints( amount ); killer:PS_Notify("You've been given "..amount.." points for killing a death!"); elseif ( killer:Team() == TEAM_DEATH and victim:Team() == TEAM_RUNNER ) then killer:PS_GivePoints( amount ); killer:PS_Notify("You've been given "..amount.." points for killing a runner!"); end; end; end; end )[/CODE]
This is for TTT, put it in /garrysmod/lua/autorun/server Just edit the variables at the top to your liking. [CODE]--To be placed in lua/autorun/server/ -- ROLE_INNOCENT = 0 -- ROLE_TRAITOR = 1 -- ROLE_DETECTIVE = 2 -- ROLE_NONE = ROLE_INNOCENT local RolePoints = { [2] = {[2] = 0,--Killed Detective as Detective [0] = 0,--Killed Innocent as Detective [1] = 10--Killed Traitor as Detective }, [0] = {[2] = 0,--Killed Detective as Innocent [0] = 0,--Killed Innocent as Innocent [1] = 10--Killed Traitor as Innocent }, [1] = {[2] = 15,--Killed Detective as Traitor [0] = 10,--Killed Innocent as Traitor [1] = 0--Killed Traitor as Traitor } } function NotifyPlayer(ply, killer) local num = RolePoints[killer:GetRole()][ply:GetRole()] local bool = string.find(num, "-") ply:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were killed by "..killer:Nick().." they were "..killer:GetRoleString()..".") if bool then killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You had "..num.." points taken away for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".") else killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were awarded "..num.." points for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".") end killer:PS_GivePoints(num) end function PointShopDeathHook(ply, killer, dmginfo) if !IsValid(killer) or !killer:IsPlayer() or !IsValid(ply) or !ply:IsPlayer() then return end if GetRoundState() == ROUND_ACTIVE then NotifyPlayer(ply, killer) end end hook.Add("DoPlayerDeath", "PointShopDeathHook", PointShopDeathHook)[/CODE]
That is a nice script, but it does notify people of killing traitors and etc while not having to identify the body. I'm just going to edit it so that it doesn't show the notifications. Is there a similar script just for round wins/ends?
[QUOTE=The-Spy;40721951]That is a nice script, but it does notify people of killing traitors and etc while not having to identify the body. I'm just going to edit it so that it doesn't show the notifications. Is there a similar script just for round wins/ends?[/QUOTE] --killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were awarded "..num.." points for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".") What do you think?
I just commented out the parts that notify people. It's a passive script on my server so that my users don't have to worry about making points, they just do. I just uncommented it before posting.
Okay so would there be a way to give a certain group (ulx groups) extra points for ever so many minutes? Only selected groups.
Sorry, you need to Log In to post a reply to this thread.