if SERVER then local function CheckLicense() for k,v in pairs( player.GetAll() ) do if ValidEntity( v:GetVehicle() ) and v:GetVehicle():IsVehicle() then if not v.License then v:ExitVehicle() -- Notify( v, 1, 5, "You need a license to drive a vehicle." ) end end end end timer.Create( "CheckLicense", 0.1, 0, CheckLicense ) local function GiveLicense( ply ) Notify( ply, 0, 4, "[DEBUG] The chat cmd worked." ) if ply:Team() == TEAM_DMV then if ply:GetEyeTrace().Entity then local target = ply:GetEyeTrace().Entity if target:IsPlayer() then target.License = true Notify( target, 0, 4, "You have been given a driver's license." ) Notify( ply, 0, 4, "Gave " .. target:Nick() .. " a driver's license." ) end else ply.License = true Notify( ply, 0, 4, "Gave yourself a driver's license." ) end end return "" end AddChatCommand( "/driverslicense", GiveLicense ) local function SpawnPlayer( ply ) ply.License = false end hook.Add( "PlayerInitialSpawn", "PlayerLicenseSet", SpawnPlayer ) end