DarkRP Custom Check

I’m trying to have it so that everyone expect players under IsCP(), is allowed to purchase an item under my addentities.lua file using DarkRP’s customCheck.

This was the best thing I could come up with for a solution…


	customCheck = function(ply) return CLIENT or ply:IsCP() == false end,
	CustomCheckFailMsg = "Government officials are not allowed to purchase that!"

But of course it doesn’t work…

Any help?

Try doing:




	customCheck = function(ply) return CLIENT or not ply:IsCP() end,
	CustomCheckFailMsg = "Government officials are not allowed to purchase that!"


Crazyscouter is right. That should fix your problem. Alternatively, you can just have a large amount of ply:Team() == “team” but i dont like using that.

Also, for the record, there is a DarkRP help thread you should have posted this in. Mods tend to delete threads and ban users for not posting their darkrp questions there. Just letting you know.

Thanks so much! I didn’t realize it was just that…

[editline]9th July 2013[/editline]

And yeah, I’m sorry, I’ve been inactive for quite some time, not very up to date with the rules :wink: