• PointShop for Garry's Mod 13 v2
    273 replies, posted
The MYSQL part of this pointshop doesn't even work correctly. I can't even set points and no one can even earn points. I followed all of the directions and another coder had the same problem.
Did you make sure you got the pointshop provider connected to your mysql database?
Yes I changed the pdata into MySQL in sh.config lua
If you read the first few lines of the MySQL.lua, it tells you what to do.
[QUOTE=Thetomm2010;40748567]Okay so would there be a way to give a certain group (ulx groups) extra points for ever so many minutes? Only selected groups.[/QUOTE] Go to /garrysmod/addons/Pointshop/lua/sv_player_extension.lua and replace lines 69-75: [CODE]if PS.Config.PointsOverTime then timer.Create('PS_PointsOverTime_' .. self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function() self:PS_GivePoints(PS.Config.PointsOverTimeAmount) self:PS_Notify("You've been given ", PS.Config.PointsOverTimeAmount, " points for playing on the server!") end) end end[/CODE] With this: [CODE]if PS.Config.PointsOverTime then if self:IsUserGroup("owner") then pluspoints = 15 elseif self:IsAdmin() then pluspoints = 10 elseif self:IsUserGroup("donator") then pluspoints = 5 else pluspoints = 0 end timer.Create('PS_PointsOverTime_' .. self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function() self:PS_GivePoints(PS.Config.PointsOverTimeAmount + pluspoints) self:PS_Notify("You've been given ", PS.Config.PointsOverTimeAmount + pluspoints, " points for playing on the server!") end) end end[/CODE] Just modify the number for each usergroup, and add more elseif statements to add usergroups. This is also only for those using ULX, for clarification.
Wierd all I did was change the pluspoints = 15 to like 5000 to see if it worked and it just gave random people on my server 5000 points. Not sure what I did wrong.
[QUOTE=Thetomm2010;40762271]Wierd all I did was change the pluspoints = 15 to like 5000 to see if it worked and it just gave random people on my server 5000 points. Not sure what I did wrong.[/QUOTE] I'll test it further. I just wrote it and tested it alone, I'll work on it in the next couple of hours.
okay I'll try a few things I really appreciate it though.
how do you use steamids for the playercanbuy i want to use it so only certain people get it rather than making an entire diffrent group for them. Please help!
[QUOTE=Asianmon;40819164]how do you use steamids for the playercanbuy i want to use it so only certain people get it rather than making an entire diffrent group for them. Please help![/QUOTE] [lua]ITEM.CanPlayerBuy = function(self, ply) if ( ply:SteamID() == "STEAM_0:1:12345678" ) then return true end return false end[/lua]
I'm pretty new to all of this MySQL stuff. Is it needed in order to add the pointshop to the server, or can it be used entirely without it? If it is needed, could someone link me to any tutorial on how to set it up for a TTT Gmod server? I would be very appreciative.
it can be used without mysql, but items and points sometimes glitch. its recommended
[QUOTE=ChosenOne912;40871888]I'm pretty new to all of this MySQL stuff. Is it needed in order to add the pointshop to the server, or can it be used entirely without it? If it is needed, could someone link me to any tutorial on how to set it up for a TTT Gmod server? I would be very appreciative.[/QUOTE] What Rejax said but in more detail. The MySQL module is extremely recommended, without the module you and your players [B]will[/B] experience points being reset/lost and items being reset/lost, it may not happen at first but it will. When I first noticed this problem I though, what the heck, so I tried the MySQL module and it worked amazing. Setting up the MySQL module is also really easy, just put the folder into your addons directory on your server then open it up, inside there should be a config file, just fill it out with your correct MySQL database information. Most website/server hosting give you free MySQL hosting, if not then they are very easy to rent. I am not trying to sell for BlackVoid but he offers a better MySQL module for the Pointshop than the standard version, it has a lot of improvements and was worth the 'investment', but the default MySQL module will sort you for now. Again, the MySQL module is [B]NOT[/B] required, instead it will store it using pdata.
Hello guys. I had this code i used in my pointsjop back at gmod 12 but it never really worked. Could someone please rewrite it to gmod 13 and make it work? :) (If someone is wondering i want it to give people points when they kill someone.) hook.Add('DoPlayerDeath', 'Points', function(ply, attacker, victim) if ValidEntity(attacker) and attacker:IsPlayer() then attacker:PS_GivePoints(10) end
[QUOTE=dimsen;40874878]Hello guys. I had this code i used in my pointsjop back at gmod 12 but it never really worked. Could someone please rewrite it to gmod 13 and make it work? :) (If someone is wondering i want it to give people points when they kill someone.) hook.Add('DoPlayerDeath', 'Points', function(ply, attacker, victim) if ValidEntity(attacker) and attacker:IsPlayer() then attacker:PS_GivePoints(10) end[/QUOTE] Fixed [code] hook.Add('DoPlayerDeath', 'Points', function(ply, attacker, victim) if IsValid(attacker) and attacker:IsPlayer() then attacker:PS_GivePoints(10) end [/code]
[QUOTE=smithy285;40874632]What Rejax said but in more detail. The MySQL module is extremely recommended, without the module you and your players [B]will[/B] experience points being reset/lost and items being reset/lost, it may not happen at first but it will. When I first noticed this problem I though, what the heck, so I tried the MySQL module and it worked amazing. Setting up the MySQL module is also really easy, just put the folder into your addons directory on your server then open it up, inside there should be a config file, just fill it out with your correct MySQL database information. Most website/server hosting give you free MySQL hosting, if not then they are very easy to rent. I am not trying to sell for BlackVoid but he offers a better MySQL module for the Pointshop than the standard version, it has a lot of improvements and was worth the 'investment', but the default MySQL module will sort you for now. Again, the MySQL module is [B]NOT[/B] required, instead it will store it using pdata.[/QUOTE] I've personally had more problems with points/items saving with the MySQL module over pdata. Also why would you buy a MySQL module? With some basic knowledge and trial+error you can make one yourself.
[QUOTE=Pandaman09;40877370]I've personally had more problems with points/items saving with the MySQL module over pdata. Also why would you buy a MySQL module? With some basic knowledge and trial+error you can make one yourself.[/QUOTE] I trust BlackVoid more than myself...*crys*
[QUOTE=Neddy;40875511]Fixed [code] hook.Add('DoPlayerDeath', 'Points', function(ply, attacker, victim) if IsValid(attacker) and attacker:IsPlayer() then attacker:PS_GivePoints(10) end [/code][/QUOTE] Hmm. I guess i dont put it in the right file.. Which file should i paste the code in?
Hey guys, I recently tried to add some custom stuff to the point shop. I've succefully added some playermodels by copy/pasting the lua file then changing the infos. Now have tried doing this with weapons, I tried to add an entry for some Customisable Weaponry guns AND some M9k rockets. All of them show in the Pointshop now, but I cant seem to buy any of those I have added. I tried modifying default weapons, which worked perfectly. Please FP, enlighten me with your infinite knowledge.. [HTML]ITEM.Name = 'Milkor' ITEM.Price = 12000 ITEM.Model = 'models/weapons/w_milkor_mgl1.mdl' ITEM.WeaponClass = 'm9k_milkormgl' ITEM.SingleUse = true function ITEM:OnBuy(ply) ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnSell(ply) ply:StripWeapon(self.WeaponClass) end[/HTML]
The ITEM.WeaponClass needs to match the name of the folder that holds the weapon's shared.lua file. Assuming you're using TTT, it would be 'weapon_ttt_name'.
Is there a way to disable the point shop for one team (and everything is holstered)? (E.G. Zombies in Zombie Survival)
[QUOTE=Eccid;40752058]Go to /garrysmod/addons/Pointshop/lua/sv_player_extension.lua and replace lines 69-75: [CODE]if PS.Config.PointsOverTime then timer.Create('PS_PointsOverTime_' .. self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function() self:PS_GivePoints(PS.Config.PointsOverTimeAmount) self:PS_Notify("You've been given ", PS.Config.PointsOverTimeAmount, " points for playing on the server!") end) end end[/CODE] With this: [CODE]if PS.Config.PointsOverTime then if self:IsUserGroup("owner") then pluspoints = 15 elseif self:IsAdmin() then pluspoints = 10 elseif self:IsUserGroup("donator") then pluspoints = 5 else pluspoints = 0 end timer.Create('PS_PointsOverTime_' .. self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function() self:PS_GivePoints(PS.Config.PointsOverTimeAmount + pluspoints) self:PS_Notify("You've been given ", PS.Config.PointsOverTimeAmount + pluspoints, " points for playing on the server!") end) end end[/CODE] Just modify the number for each usergroup, and add more elseif statements to add usergroups. This is also only for those using ULX, for clarification.[/QUOTE] Hmm, I use Evolve. How easy would it be to modify this to get it working for that?
[QUOTE=Epies;40905524]The ITEM.WeaponClass needs to match the name of the folder that holds the weapon's shared.lua file. Assuming you're using TTT, it would be 'weapon_ttt_name'.[/QUOTE] Thanks you, I got it figured out. Actually needed to specify the skin number too. Now I am wondering what kind of modifications would be necessary to include Entities Spawning in the Shop. Things such as Ammo boxes, WAC, PlayXrepeaters, Nukes and such.
[QUOTE=Tardigrade;40917205]Thanks you, I got it figured out. Actually needed to specify the skin number too. Now I am wondering what kind of modifications would be necessary to include Entities Spawning in the Shop. Things such as Ammo boxes, WAC, PlayXrepeaters, Nukes and such.[/QUOTE] ents.Create in an item's OnBuy function? No modification required.
Guys, what's wrong? (Item doesn't remove) [CODE]function ITEM:OnBuy(ply) ply:ChatPrint("Bougth and removed") ply:PS_TakeItem(self.ID) end[/CODE] [editline]6th June 2013[/editline] And one more: how to customize player models?
Fixing the MySQL would be awesome Matt Also adding a little more detail on how you can make it work for your admin mod, eg self:IsUserGroup for ULX. (as people keep asking) And i would also like to thank _Undefined and the rest of the creators for this awesome addon!
[QUOTE=Handsome Matt;40925354]Are there any major bugs or minor features you guys want added? I have a little spare time over the weekend which I can dedicate towards you neglected people. c: ( I'm the Matt OP mentions by the way )[/QUOTE] The mod is awesome! If you could make a tab for Vehicles and general Sents it'd be awesome! The only problem I have encountered is with holstering weapons. If you could include a perma buy option with a diff price thad be "the shit".
-snip-
[QUOTE=Eccid;40934959]Since this update, the pointshop will not work at all on my ttt server. No one has points, gets points, or can get items; and bodies disappear when people die.[/QUOTE] It works on my TTT server
[QUOTE=Eccid;40934959]Since this update, the pointshop will not work at all on my ttt server. No one has points, gets points, or can get items; and bodies disappear when people die.[/QUOTE] Did you make sure you moved the MySQL lib over?
Sorry, you need to Log In to post a reply to this thread.