Falco added the getPrice field in response to a github thread (that I made, haha) and I'm having a small issue.
[code]getPrice = function(ply,price) return ply:Team() == TEAM_WEAPON and math.Round(price * 0.75) or price end, [/code]
Gives the class TEAM_WEAPON the discount, but doesn't display it in the F4 menu.
[code]getPrice = function(ply,price) return ( ply:Team() == TEAM_WEAPON ) and math.Round(price * 0.75) or price end,[/code]
Works on my dev server (which is windows based) but does not work on the live server (which is linux based)
Any idea what would cause them to not work between the two? We're running 100% mirrored copies of DarkRP, both the latest version.
tl;dr: why does a line of code that works fine on windows not work on linux
[editline]14th November 2013[/editline]
[code]getPrice = function(ply,price) return ply:query( "donator" ) and math.Round(price * 0.75) or price end,[/code]
That works just fine, for having it show to a donator (shows and buys at discounted pricing) or if we check a usergroup, it also gives/sells at the discounted price.
Garry's too lazy to make linux stable and reliable.
Try
[code]
getPrice = function(ply,price) return ( ply:Team() == TEAM_WEAPON and math.Round(price * 0.75) ) or price end,
[/code]
[QUOTE=MuteTM;42870863]Try
[code]
getPrice = function(ply,price) return ( ply:Team() == TEAM_WEAPON and math.Round(price * 0.75) ) or price end,
[/code][/QUOTE]
No dice :(