Double VIP's Salary Error.

Hey there guys,

I’m trying to make a super simple script which doubles a person’s salary if they are a certain ULX rank.

I am using

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 self:IsUserGroup("superadmin") then
                amount = math.floor(amount)*2
            elseif self:IsUserGroup("vip") then
                amount = math.floor(amount)*1.25
            if amount == 0 or not amount then
                GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_unemployed)
                GAMEMODE:Notify(self, 4, 4, string.format(LANGUAGE.payday_message, CUR .. amount))
        GAMEMODE:Notify(self, 4, 4, LANGUAGE.payday_missed)

to try and do it but I believe some of the code is deprecated.

When I receive my payday it isn’t multiplied by the set amount.

Thank’s guys :slight_smile:

local extraSalary = {
	superadmin = 1,
	vip = 0.25

hook.Add("playerGetSalary", "extra", function(ply, amount)
	amount = amount + amount * (extraSalary[ply:GetUserGroup()] or 0)
	return true, amount

I’m not sure if this will help you get $1, but it must be easier to write. I don’t know, how all this darkrp hooks works, but i think, you can do something with this :smile:


Sadly it doesn’t work but thanks for trying <3

It’s playerGetSalary not PlayerGetSalary

First of all. Why are you giving superadmins twice as much and vips 1.25? Superadmins shouldnt have an gameplay advantage like that. Whatever, your choice.

Also as said its playerGetSalary not PlayerGetSalary.

You sure you’re not using old DarkRP version?