I know it's possible, and it's more than likely fairly simple, I have wallettax enabled on my DarkRP server and was wondering how I make it so V.I.P and all other usergroups higher than it.
I'd assume that there's a convar file for it as well.
There's no convar to my knowledge, but you can just modify the code to only tax certain user groups. Just use an if statement that only taxes the groups you want taxed.
Forgive me if I'm wrong, still a bit of a novice in lua, but does this look right?
[CODE]-- VIPs being taxed
GM.config.VIPwallettax = {
if Ply:UserGroup(V.I.P) = "GM.Config.wallettax" = false
}[/CODE]
I put that in the settings.lua that goes into the darkrpmodifcation, and for the parameters I put;
[CODE]--VIPtax - Whether VIP players pay taxes on their wallets
GM.config.VIPwallettax = true[/CODE]
Try ply:IsUserGroup().
Alright so after a lot of thinking and looking around I concluded this.
[CODE]GM.config.VIPwallettax = {
if ( Ply ):IsUserGroup( "V.I.P" ) ) then
( "GM.Config.wallettax = false" )
end
}[/CODE]
Which I even pasted into luabin which appears to be correct, yet the console keeps giving me this error no matter what I do.
[CODE][ERROR] addons/darkrpmodification-master/lua/darkrp_config/settings.lua:303: unexpected symbol near 'if'
1. unknown - addons/darkrpmodification-master/lua/darkrp_config/settings.lua:0
[/CODE]
The line it shows the error is absolutely nothing as well, it's just a space between that config, and another config setting.
What the fuck is ( Ply )? Just do ply:IsUserGroup().
[CODE]-- Whether or not VIPs pay taxes.
GM.Config.VIPwallettax = {
customCheck = function(ply) return ply:GetNWString("usergroup")
then if Player ( 2 ):IsUserGroup( "V.I.P" ) then
ply:GM.Config.wallettax = false
end
}[/CODE]
Got this now, this one I worked with a friend, different error this time though.
[CODE][ERROR] addons/darkrpmodification-master/lua/darkrp_config/settings.lua:274: '}' expected (to close '{' at line 272) near 'then'
1. unknown - addons/darkrpmodification-master/lua/darkrp_config/settings.lua:0
[/CODE]
then if? Where's the previous if statement? Also, what's Player ( 2 )?
[editline]1st February 2014[/editline]
Just use this...
[code]-- Whether or not VIPs pay taxes.
GM.Config.VIPwallettax = {
customCheck = function(ply) return ply:GetNWString("usergroup")
if ply:IsUserGroup( "V.I.P" ) then
ply:GM.Config.wallettax = false
end
}[/code]
Still coming up with script errors that end is expected too close to if.
Oh, I see what you're trying to do now.
[code]-- Whether or not VIPs pay taxes.
GM.Config.VIPwallettax = {
customCheck = function(ply) return ply:GetNWString("usergroup") == "V.I.P" end
ply:GM.Config.wallettax = false
}[/code]
I don't know why this code is being so temperamental.
[CODE]
[ERROR] addons/darkrpmodification-master/lua/darkrp_config/settings.lua:274: '}' expected (to close '{' at line 272) near 'ply'
1. unknown - addons/darkrpmodification-master/lua/darkrp_config/settings.lua:0[/CODE]
So I then attempted to the define the value as nil.
[CODE]GM.Config.VIPwallettax = nil
customCheck = function(ply) return ply:GetNWString("usergroup") == "V.I.P" end
ply:GM.Config.wallettax = false [/CODE]
Which lead to another common error we've seen while working with this;
[CODE][ERROR] addons/darkrpmodification-master/lua/darkrp_config/settings.lua:274: function arguments expected near '.'
1. unknown - addons/darkrpmodification-master/lua/darkrp_config/settings.lua:0[/CODE]
It's asking us to take a '.' out of the [CODE]GM.Config.VIPWallettax[/CODE]
Sorry, you need to Log In to post a reply to this thread.