• [QUESTION] DarkRP - Change Pay Days for Admins
    1 replies, posted
I'm trying to change the pay day for admins, so that they get 25% more each day.. but it's really weird because I'm trying to edit the payday function, and it's like it doesn't change it at all. I'm also getting this error: [code]Timer Error: [lua\includes\extensions\player_auth.lua:29] attempt to index local 'self' (a nil value)[/code] Here is my Player.lua script. [lua]function meta:PayDay() if ValidEntity(self) and self:GetTable().Pay == 1 then if not RPArrestedPlayers[self:SteamID()] then DB.RetrieveSalary(self, function(amount) if self.IsSuperAdmin() then Notify(self, 4, 4, string.format("HE IS SUPER ADMIN")) amount = math.floor(amount or GetConVarNumber("normalsalary")) * 1.25 else Notify(self, 4, 4, string.format("HE IS NOT SUPER ADMIN")) amount = math.floor(amount or GetConVarNumber("normalsalary")) end if amount == 0 then Notify(self, 4, 4, LANGUAGE.payday_unemployed) else self:AddMoney(amount) Notify(self, 4, 4, string.format(LANGUAGE.payday_message, CUR .. amount .. amount)) end end) else Notify(self, 4, 4, LANGUAGE.payday_missed) end end end[/lua] I even tried commenting it out, and you still get paid, its really weird. How can I fix this problem
Just use. [lua] function meta:PayDay() if ValidEntity(self) and self:GetTable().Pay == 1 then if not RPArrestedPlayers[self:SteamID()] then DB.RetrieveSalary(self, function(amount) if amount == 0 then Notify(self, 4, 4, LANGUAGE.payday_unemployed) else if self:IsSuperAdmin() then amount = math.floor(amount * 1.25); end self:AddMoney(amount) Notify(self, 4, 4, string.format(LANGUAGE.payday_message, CUR .. amount .. amount)) end end) else Notify(self, 4, 4, LANGUAGE.payday_missed) end end end [/lua] Your code had the wrong syntax and was optimized.
Sorry, you need to Log In to post a reply to this thread.