So in my last post I figured out my problem, but now I have a new one.
Everything works perfect with this code. The player spawns with the gun each round and everything works like it should. But for some reason if the player disconnects and rejoins the server, they have to re-buy the gun again... I have a few other skins and stuff that work just fine when a player rejoins so I don't think it's a mysql issue. What could be causing this?
[code]ITEM.Name = '357 Magnum'
ITEM.Price = 200
ITEM.Model = 'models/weapons/w_357.mdl'
ITEM.WeaponClass = 'weapon_357'
ITEM.SingleUse = false
function ITEM:OnBuy(ply)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end[/code]
[QUOTE=Handsome Matt;43472540]Re[b]BUY[/b] the gun? Do any of the other items make you rebuy them, if so it's an issue with the data provider.[/QUOTE]
No other items make you have to re-buy them on rejoining. All skins and effects work automatically when a player joins. This is the only thing giving me problems. If a player buys it, they can die and it will re-spawn with them, but if the map changes, or they rejoin, it will be as if they never bought it, but the points will be missing.
[QUOTE=Handsome Matt;43473661]try giving it in ITEM:PlayerLoadout(ply) as well.[/QUOTE]
Tried that.
But if the player disconnects then they have to buy the gun again... I've tried so many scrips and all weapons force you to rebuy after disconnecting for some reason... Only the weapons are giving me this problem, no skins or anything. I'm lost.
try this:
[code]
ITEM.Name = 'AK74'
ITEM.Price = 0
ITEM.Material = 'guns/ak74.vmt'
ITEM.WeaponClass = 'fas2_ak74'
ITEM.SingleUse = false
function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
[/code]
thats what i used for the loadouts in my server and it always worked fine
[QUOTE=legendofrobbo;43483635]try this:
[code]
ITEM.Name = 'AK74'
ITEM.Price = 0
ITEM.Material = 'guns/ak74.vmt'
ITEM.WeaponClass = 'fas2_ak74'
ITEM.SingleUse = false
function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
[/code]
thats what i used for the loadouts in my server and it always worked fine[/QUOTE]
yeah same issue as everything else I've tried.
Guessing it's a mysql issue or something, any ideas how I can fix it?
Just re-installed PS again and still not working. Weird.
Sorry, you need to Log In to post a reply to this thread.