DarkRP.Player.HasPriv

From Official DarkRP Wiki
Jump to navigation Jump to search
This page refers to DarkRP 2.4.3. This information may be incorrect as of later versions.
Check here for a up-to-date list of functions.
Function
Function name Player:HasPriv(string priv)
Description:
Returns true or false depending on if the player has the privilige.
Returns: boolean
Part of Library: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=DarkRP.Player.HasPriv]Player:HasPriv[/url][/b]

Examples

DescriptionIf the player is an admin, give player the cookie item/swep (non-existent)
Used onNewerServer.png
Code
function DoIGetACookie( ply )
	if ply:HasPriv("admin") then
		ply:Give("cookie")
	else
		ply:Kill()
	end
end
OutputN/A


Additional Notes

  • Possible privilages are: admin, mayor, cp, tool, phys and prop.