Vehicles donator only

hey, ive tried,

nil, function(ply) return ply:GetNWString(“usergroup”) == “Donator” end) - Which doesn’t post any errors but doesn’t work

so i tried
CustomCheck = function(ply)
return ply:IsUserGroup(“donator”) or ply:IsUserGroup(“admin”) or ply:IsUserGroup(“superadmin”)
end)

Which gave me the error expected “=” etc etc

Can anyone help please?

All you have to do is add another = after CustomCheck

[lua]CustomCheck == function(ply)
return ply:IsUserGroup(“donator”) or ply:IsUserGroup(“admin”) or ply:IsUserGroup(“superadmin”)
end)
[/lua]

Since you didn’t give us much information , this is as much as I can tell.

Sorry man XD i’m very inexperienced with lua coding and the forum use such as adding the lua to a box like that.

Thanks alot for your help man

[editline]25th February 2013[/editline]

I tried what you said and it stops the errors but it doesn’t restrict it for anyone. any ideas? :slight_smile:
TY in advance

The AddCustomVehicle function doesn’t support customCheck.
And it’s customCheck not CustomCheck as well as it’s customCheck = function(ply)… Not CustomCheck == function(ply)

[editline]25th February 2013[/editline]

https://github.com/FPtje/DarkRP/blob/master/gamemode/shared/MakeThings.lua#L90

No way of making cars donator only then? what about giving them spawn privileges like an admin? without the rest of the admin abilities?

I asked him to add it.

[editline]25th February 2013[/editline]

Thanks a lot man, :slight_smile: your a legend, the only other way i could come up with without some major scripting was just giving them admin privileges but removing all there command capabilities, only down side is disabling work entities from FPP for admins.

[editline]25th February 2013[/editline]

So if he does add it then

Will work?

Yes.

No

Lol, I mean with this:



customCheck = function(ply) return ply:GetUserGroup() == "Group" or ply:GetUserGroup("superadmin") end


I don’t really see why you use two methods?
Only IsUserGroup takes arguments. And you can simply use IsSuperAdmin()

[editline]25th February 2013[/editline]

He fixed it.

I didn’t know you could do IsSuperAdmin(), lol thx :stuck_out_tongue:

Instead of using multiple isusergroup why the hell don’t you just setup your hierarchy in ulx like a normal person, and use ply:CheckGroup(“donator”). This would check to see if the user is donator or higher.

Yes, that could be easier…

[editline]26th February 2013[/editline]

I just noticed, you have a big C at the beginning of customCheck. Make it lower case.