I take it _Undefined doesn't want to help people?
[img]http://puu.sh/2gDfs[/img] @ issues page.
apparently.. right when I needed his help with :
[code]L 03/12/2013 - 20:16:09: Lua Error:
[ERROR] addons/pointshop/lua/sv_player_extension.lua:417: Tried to use a NULL entity!
1. SendLua - [C]:-1
2. PS_Notify - addons/pointshop/lua/sv_player_extension.lua:417
3. unknown - addons/pointshop/lua/sv_player_extension.lua:44
L 03/12/2013 - 20:16:09: Lua Error:
[ERROR] addons/pointshop/lua/sv_player_extension.lua:417: Tried to use a NULL entity!
1. SendLua - [C]:-1
2. PS_Notify - addons/pointshop/lua/sv_player_extension.lua:417
3. unknown - addons/pointshop/lua/sv_player_extension.lua:50
L 03/12/2013 - 20:16:09: Lua Error:
[ERROR] addons/pointshop/lua/sv_player_extension.lua:417: Tried to use a NULL entity!
1. SendLua - [C]:-1
2. PS_Notify - addons/pointshop/lua/sv_player_extension.lua:417
3. unknown - addons/pointshop/lua/sv_player_extension.lua:56
L 03/12/2013 - 20:16:14: Lua Error:
[ERROR] addons/pointshop/lua/sv_player_extension.lua:417: Tried to use a NULL entity!
1. SendLua - [C]:-1
2. PS_Notify - addons/pointshop/lua/sv_player_extension.lua:417
3. unknown - addons/pointshop/lua/sv_player_extension.lua:61[/code]
which is self:SendLua('notification.AddLegacy("' .. str .. '", NOTIFY_GENERIC, 5)')
that's what I get when I try to add a trail :\ it crashes me and the server.. anyone know how to properly setup a trail item for the shop?
Can anyone tell me how to switch from pdata to mysql and not lose all my data? I've tried converting sv.db(sqlite) to mysql, and it won't import and I've tried using the old mysql code and the sync com command with no luck. I've spent countless hours trying to convert and import the database and it refuses to work, there has to be a way to do it, and it's infuriating how hard it is.
[QUOTE=kaytaro;39894073]apparently.. right when I needed his help with :
-snip code-
which is self:SendLua('notification.AddLegacy("' .. str .. '", NOTIFY_GENERIC, 5)')
that's what I get when I try to add a trail :\ it crashes me and the server.. anyone know how to properly setup a trail item for the shop?[/QUOTE]
LINE 60-63:
[lua]
timer.Simple(10, function() -- Give them time to load up
if not IsValid(self) then return end
self:PS_Notify('You have ' .. self:PS_GetPoints() .. ' points to spend!')
end)
[/lua]
LINE 416-420:
[lua]
function Player:PS_Notify(...)
if not IsValid(self) then return end
local str = table.concat({...}, '')
self:SendLua('notification.AddLegacy("' .. str .. '", NOTIFY_GENERIC, 5)')
end
[/lua]
That should fix the problem... along with not breaking everything.
This will check to see if the player is valid. The timer was being called after the player disconnected... if you read the code.
[editline]13th March 2013[/editline]
[QUOTE=Eccid;39897750]...Pdata to sql...[/QUOTE]
Contact me on skype: -snip-
I MIGHT be able to help.
Awesome! Thanks for the share
[QUOTE=Thetomm2010;39884378]I like tinos Idea because I have had to remove the buy in function because VIP players "abuse" it.[/QUOTE]
Here you (and anyone else interested in limiting items) go! I figured it out :)
Place this code in
[B]sv_player_extension.lua
[/B]within the[I] Player:PS_BuyItem(item_id)[/I] function.
[lua]
-- Limit them tiems!
if ITEM.Limited then
local Roundcount = 0
for _, p in pairs(player.GetAll()) do
--if p:PS_HasItem(item_id) then
if p.PS_Items[item_id] then
Roundcount = Roundcount + 1
end
end
--return Roundcount
self:PS_Notify( Roundcount .. ' of ' .. ITEM.LimitAmount .. ' bought so far.')
if Roundcount >= ITEM.LimitAmount then return false end
else ITEM.Limited = false
end
---------------------
[/lua]
And then add this code to items you'd like to limit:
[lua]
ITEM.Limited = true
ITEM.LimitAmount = 2 --Can be any number.
[/lua]
I'm fairly new to lua, if someone sees a problem let me know, I've tested this and seems to work fine.
[I]ps. how do I post lua code with numbering?[/I]
[QUOTE=tinos;39905924][I]ps. how do I post lua code with numbering?[/I][/QUOTE]
use [.lua][./lua]
instead of
[.code][./code]
(don't use the periods!)
TINOS THANK YOUUUUU!!! :)
There was a snippet of code someone posted on the other thread for networks that share a database, that if someone had an item on one server that didn't exist on the other, it would ignore the string instead of causing errors. Does anyone have this?
When I use mysql, it lags my server like crazy, I think it's trying to update too often or something. Does anyone know how to fix this?
Yea.. I used the mysql addon too and it like makes the latency go up 8x
-SNIPPED-
(Problem sorted for me)
Is there a command to yourself points?
[QUOTE=bluemist;39914084]-SNIPPED-
(Problem sorted for me)
Is there a command to yourself points?[/QUOTE]
No you cannot turn yourself into a point
If anyone is interested in buying a working MySQL integrated version of pointshop based on the latest build without all those nasty reset bugs and lag, including bug fixes contact me on steam.
[QUOTE=Lebofly;39920401]No you cannot turn yourself into a point[/QUOTE]
Let me rephrase that:
Is there a command to give yourself points
(Forgets to read over last post.)
Lol I don't want to be a point, i just cannot imagine that....
[QUOTE=bluemist;39926488]Let me rephrase that:
Is there a command to give yourself points
(Forgets to read over last post.)
Lol I don't want to be a point, i just cannot imagine that....[/QUOTE]
use the admin tab.
[QUOTE=BlackVoid;39926646]use the admin tab.[/QUOTE]
Yes i am using that at the moment was just wondering if i could use
RunConsoleCommand to give players points through an lua script.
[QUOTE=BlackVoid;39922164]If anyone is interested in buying a working MySQL integrated version of pointshop based on the latest build without all those nasty reset bugs and lag, including bug fixes contact me on steam.[/QUOTE]
Oh you're so kind.
[QUOTE=bluemist;39926762]Yes i am using that at the moment was just wondering if i could use
RunConsoleCommand to give players points through an lua script.[/QUOTE]
Serverside you can use Player:PS_GivePoints(points)
or if you want a console command you can add this code
[lua]concommand.Add("ps_give_points", function(ply, cmd, args)
if #args != 2 then
ply:ChatPrint("Missing arguments! ps_give_points <player-id> <points>")
return
end
other = player.GetByID(args[1])
points = tonumber(args[2])
if points < 0 then
ply:ChatPrint("You can't give a negative amount of points")
return
end
if (ply:IsAdmin()) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_GivePoints(points)
other:PS_Notify(ply:Nick(), ' gave you ', points, ' points.')
ply:PS_Notify('You gave "', other:Nick(), '" ', points, ' points.')
end
end)
[/lua]
Not tested but should work.
Ok i managed to fix the 'ChatPrint' a nil value
By adding IsValid(ply)
but I've encountered another error
attempt to compare a nil value with number: line 8
[lua]
concommand.Add("ps_give_points", function(ply, cmd, args)
if IsValid(ply) and #args != 2 then
ply:ChatPrint("Missing arguments! ps_give_points <player-id> <points>")
return
end
other = player.GetByID(args[1])
points = tonumber(args[2])
if points < 0 then
ply:ChatPrint("You can't give a negative amount of points")
return
end
if (ply:IsAdmin()) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_GivePoints(points)
other:PS_Notify(ply:Nick(), ' gave you ', points, ' points.')
ply:PS_Notify('You gave "', other:Nick(), '" ', points, ' points.')
end
end)[/lua]
[QUOTE=bluemist;39932541]Ok i managed to fix the 'ChatPrint' a nil value
By adding IsValid(ply)
but I've encountered another error
attempt to compare a nil value with number: line 8
[lua]
concommand.Add("ps_give_points", function(ply, cmd, args)
if IsValid(ply) and #args != 2 then
ply:ChatPrint("Missing arguments! ps_give_points <player-id> <points>")
return
end
other = player.GetByID(args[1])
points = tonumber(args[2])
if points < 0 then
ply:ChatPrint("You can't give a negative amount of points")
return
end
if (ply:IsAdmin()) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_GivePoints(points)
other:PS_Notify(ply:Nick(), ' gave you ', points, ' points.')
ply:PS_Notify('You gave "', other:Nick(), '" ', points, ' points.')
end
end)[/lua][/QUOTE]
Are you even entering any arguments? Because you removed the check for it when you added IsValid, this command only works if its a player calling it.
-snip-
Didn't see you were trying to add a console command, "feels stupid for snipping"
Can anyone tell me, how to make buyable sound clips what would be one time use?
Can anyone tell me how I would make a part of the HUD that would show how many points you currently have?
Ive added this into a DarkRP server the ip is 216.231.130.117:27015
is it possible to make a winning team get like 10 points?
is there a script you need to buy first like the crabhat before you can buy a skeletonmodel ???
[editline]21st March 2013[/editline]
[QUOTE=Drewdinie;39990054]is it possible to make a winning team get like 10 points?[/QUOTE]
yes but IDK how i'm searching for it if I found it I will tell it
I need a person to code me a custom swep for the pointshop.
Will pay 30$
Thread overrun with noobies?
Is _Undefined gone for good?
[QUOTE=Tumaxi;40001407]I need a person to code me a custom swep for the pointshop.
Will pay 30$[/QUOTE]
Your a very funny individual you know that? Never seen such comedy. [URL="http://facepunch.com/showthread.php?t=1032378"]*Click Me*[/URL] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8e50.html"]*Click Me To!*[/URL]
Sorry, you need to Log In to post a reply to this thread.