-snip- wrong section... Staff please remove... sorry for wasting time/space
I'm sorry but have you even attempted to fix this on your own? If not you're asking the wrong place.
[QUOTE=RedXVIII;50613302]I'm sorry but have you even attempted to fix this on your own? If not you're asking the wrong place.[/QUOTE]
Yes, I have tried just about everything... Im just about to the point of wiping the server.
Then post your attempted code.
[QUOTE=RedXVIII;50613320]Then why haven't you shown us your attempted code?[/QUOTE]
Is there some code i could add to the gamemode or lua/autorun. I have removed and edited the pointshop and re-added all addons and edited. I have the current knives spam the loadout of the pointshop equiption seven times with this code: [QUOTE]local function PlayerLoadout(ply)
ply:Give(self.WeaponClass)
end[/QUOTE] I have done a few other things as well. If you have thoughts please let me know!?!
We're here to help give you a better understanding of lua, not fix your problems for you.
Then ill give you what my knifes do when a player spawns and the pdata.lua for the pointshop...
Here is a knife in the pointshop... [QUOTE]ITEM.Name = 'Bayonet | Damascus'
ITEM.Price = 9000
ITEM.Model = 'models/weapons/w_csgo_bayonet.mdl'
ITEM.WeaponClass = 'csgo_bayonet_damascus'
ITEM.SingleUse = false
function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:Give(self.WeaponClass)
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
local function PlayerLoadout(ply)
ply:Give(self.WeaponClass)
end[/QUOTE]
And here is my PointShop/lua/pointshop/providers/pdata.lua
[QUOTE]function PROVIDER:GetData(ply, callback)
return callback(ply:GetPData('PS_Points', 0), util.JSONToTable(ply:GetPData('PS_Items', '{}')))
end
function PROVIDER:SetPoints(ply, set_points)
ply:SetPData('PS_Points', set_points)
end
function PROVIDER:GivePoints(ply, add_points)
ply:SetPData('PS_Points', ply:GetPData('PS_Points', 0) + add_points)
end
function PROVIDER:TakePoints(ply, points)
self:GivePoints(ply, -points)
end
function PROVIDER:SaveItem(ply, item_id, data)
self:GiveItem(ply, item_id, data)
end
function PROVIDER:GiveItem(ply, item_id, data)
local tmp = table.Copy(ply.PS_Items)
tmp[item_id] = data
ply:SetPData('PS_Items', util.TableToJSON(tmp))
end
function PROVIDER:TakeItem(ply, item_id)
local tmp = util.JSONToTable(ply:GetPData('PS_Items', '{}'))
tmp[item_id] = nil
ply:SetPData('PS_Items', util.TableToJSON(tmp))
end
function PROVIDER:SetData(ply, points, items)
ply:SetPData('PS_Points', points)
ply:SetPData('PS_Items', util.TableToJSON(items))
end[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.