DARKRP - VIP INCREASED SALARY

The default code

[lua]function meta:PayDay()
if not IsValid(self) then return end
if not self:isArrested() then
DB.RetrieveSalary(self, function(amount)
amount = math.floor(amount or GAMEMODE.Config.normalsalary)
hook.Call(“PlayerGetSalary”, GAMEMODE, self, amount)
if amount == 0 or not amount then
GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_unemployed)
else
self:AddMoney(amount)
GAMEMODE:Notify(self, 4, 4, string.format(LANGUAGE.payday_message, CUR … amount))
end
end)
else
GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_missed)
end
end[/lua]

I’ve tried several ways to make the amount vary depending on usergroup… In this case, vip and admin. For example I will implement the following but this breaks the paychecks
[lua]if self.Player:IsUserGroup(“vip”) then
amount = math.floor(amount)*1.25
elseif self.Player:IsUserGroup(“superadmin”) then
amount = math.floor(amount)*2
elseif self.Player:IsUserGroup(“guest”) then
amount = math.floor(amount)*1[/lua]

Could anyone help me get this working so that I can customize the setting for the payday amount varying on the usergroup.

IF anyone is kind enough to help me out, I need “vip” and IsAdmin() implemented and that’s it.

Thanks in advance for ANY help/info, much appreciated.

Untested but it should work:
[lua]
function meta:PayDay()
if not IsValid(self) then return end
if not self:isArrested() then
DB.RetrieveSalary(self, function(amount)
amount = math.floor(amount or GAMEMODE.Config.normalsalary)
hook.Call(“PlayerGetSalary”, GAMEMODE, self, amount)
if amount == 0 or not amount then
GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_unemployed)
else
if self.Player:IsUserGroup(“vip”) then
self:AddMoney(amount1.25)
elseif self.Player:IsSuperAdmin() then
self:AddMoney(amount
2)
elseif self.Player:IsAdmin() then
self:AddMoney(amount*1.5)
end
end
GAMEMODE:Notify(self, 4, 4, string.format(LANGUAGE.payday_message, CUR … amount))
end
end)
else
GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_missed)
end
end
[/lua]

Thanks for the help ms333, however I am recieving another error when inputting your code.


[ERROR] gamemodes/darkrp/gamemode/server/player.lua:406: ')' expected (to close '(' at line 390) near 'end'
  1. unknown - gamemodes/darkrp/gamemode/server/player.lua:0

LINE 390 = LINE 4

Any other ideas?

Thanks

bump?

I am a whore for bumps, yes.

I made if from the code you posted, which I (now) see is wrong. Try this:
[lua]
function meta:PayDay()
if not IsValid(self) then return end
if not self:isArrested() then
DB.RetrieveSalary(self, function(amount))
amount = math.floor(amount or GAMEMODE.Config.normalsalary)
hook.Call(“PlayerGetSalary”, GAMEMODE, self, amount)
if amount == 0 or not amount then
GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_unemployed)
else
if self.Player:IsUserGroup(“vip”) then
self:AddMoney(amount1.25)
elseif self.Player:IsSuperAdmin() then
self:AddMoney(amount
2)
elseif self.Player:IsAdmin() then
self:AddMoney(amount*1.5)
end
end
GAMEMODE:Notify(self, 4, 4, string.format(LANGUAGE.payday_message, CUR … amount))
end
end)
else
GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_missed)
end
end
[/lua]

Not sure if trolling or just stupid.